* 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
This commit is contained in:
Jürgen Spitzmüller 2010-11-28 17:51:21 +00:00
parent 7538a23c15
commit 3d1226b4f2
3 changed files with 47 additions and 7 deletions

View File

@ -277,6 +277,7 @@
\TestPackage{listings}
\TestPackage[lithuanian.ldf]{lithuanian}
\TestPackage{longtable}
\TestPackage{luainputenc}
\TestPackage{mathdots}
\TestPackage{mathrsfs}
\TestPackage{mhchem}

View File

@ -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

View File

@ -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")