From 3d1226b4f231f308b5186cea6b856d4395f082c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sun, 28 Nov 2010 17:51:21 +0000 Subject: [PATCH] * Use the package luainputenc if LuaTeX is used as output format _with_ tex fonts. With this, the UG compiles with LuaTeX if "Unse non-TeX fonts" is not selected. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36559 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/chkconfig.ltx | 1 + lib/doc/LaTeXConfig.lyx | 34 ++++++++++++++++++++++++++++++++-- src/BufferParams.cpp | 19 ++++++++++++++----- 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index 4b9741db89..6c7bd18368 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -277,6 +277,7 @@ \TestPackage{listings} \TestPackage[lithuanian.ldf]{lithuanian} \TestPackage{longtable} +\TestPackage{luainputenc} \TestPackage{mathdots} \TestPackage{mathrsfs} \TestPackage{mhchem} diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx index 68b0244582..935ac9f812 100644 --- a/lib/doc/LaTeXConfig.lyx +++ b/lib/doc/LaTeXConfig.lyx @@ -1,5 +1,5 @@ #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/ -\lyxformat 408 +\lyxformat 410 \begin_document \begin_header \textclass article @@ -12,7 +12,7 @@ \font_sans default \font_typewriter default \font_default_family default -\use_xetex false +\use_non_tex_fonts false \font_sc false \font_osf false \font_sf_scale 100 @@ -4824,6 +4824,36 @@ listings etc. \end_layout +\begin_layout Subsection +luainputenc +\end_layout + +\begin_layout Description +Found: +\begin_inset Info +type "package" +arg "luainputenc" +\end_inset + + +\end_layout + +\begin_layout Description +CTAN: +\family typewriter +macros/luatex/latex/luainputenc/ +\end_layout + +\begin_layout Description +Notes: The package +\family sans +luainputenc +\family default +\color none + reimplements input encoding features for LuaTeX. + It is needed if LuaTeX is used as output format with tex fonts. +\end_layout + \begin_layout Subsection mathrsfs \end_layout diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index eda655b9d4..ec64e3919e 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -2459,9 +2459,18 @@ docstring BufferParams::getGraphicsDriver(string const & package) const void BufferParams::writeEncodingPreamble(odocstream & os, LaTeXFeatures & features, TexRow & texrow) const { - // fully unicode-aware backends (such as XeTeX) do not need this - if (features.runparams().isFullUnicode()) + // XeTeX does not need this + if (features.runparams().flavor == OutputParams::XETEX) return; + // LuaTeX neither, but with tex fonts, we need to load + // the luainputenc package. + if (features.runparams().flavor == OutputParams::LUATEX) { + if (!useNonTeXFonts) { + os << "\\usepackage[utf8]{luainputenc}\n"; + texrow.newline(); + } + return; + } if (inputenc == "auto") { string const doc_encoding = language->encoding()->latexName(); @@ -2724,9 +2733,9 @@ string const BufferParams::loadFonts(string const & rm, Encoding const & BufferParams::encoding() const { // FIXME: actually, we should check for the flavor - // or runparams.isFullyUnicode() here. - // useNonTeXFonts happens to match the flavors, but - // this may well likely change! + // or runparams.isFullyUnicode() here: + // This check will not work with XeTeX/LuaTeX and tex fonts. + // Thus we have to reset the encoding in Buffer::makeLaTeXFile. if (useNonTeXFonts) return *(encodings.fromLaTeXName("utf8-plain")); if (inputenc == "auto" || inputenc == "default") -- 2.39.2