X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLaTeXFeatures.cpp;h=feab83769981c4c9416dafbb7d6a9e70c5cd9132;hb=5b5b1a451512026f4d201f60c9228313037ed735;hp=0d2114516aa470982c9256d30b9350c31d112ae7;hpb=468cedb923bf0fb1e7e2ab947b009fdcd2d1c1c6;p=lyx.git diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 0d2114516a..feab837699 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -516,24 +516,24 @@ bool LaTeXFeatures::isProvided(string const & name) const bool const ot1 = (params_.font_encoding() == "default" || params_.font_encoding() == "OT1"); - bool const complete = (params_.fonts_sans == "default") - && (params_.fonts_typewriter == "default"); - bool const nomath = (params_.fonts_math == "default"); + bool const complete = (params_.fontsSans() == "default" + && params_.fontsTypewriter() == "default"); + bool const nomath = (params_.fontsMath() == "default"); return params_.documentClass().provides(name) || theLaTeXFonts().getLaTeXFont( - from_ascii(params_.fonts_roman)).provides(name, ot1, + from_ascii(params_.fontsRoman())).provides(name, ot1, complete, nomath) || theLaTeXFonts().getLaTeXFont( - from_ascii(params_.fonts_sans)).provides(name, ot1, + from_ascii(params_.fontsSans())).provides(name, ot1, complete, nomath) || theLaTeXFonts().getLaTeXFont( - from_ascii(params_.fonts_typewriter)).provides(name, ot1, + from_ascii(params_.fontsTypewriter())).provides(name, ot1, complete, nomath) || theLaTeXFonts().getLaTeXFont( - from_ascii(params_.fonts_math)).provides(name, ot1, + from_ascii(params_.fontsMath())).provides(name, ot1, complete, nomath); // TODO: "textbaltic" provided, if the font-encoding is "L7x" @@ -711,8 +711,9 @@ set LaTeXFeatures::getEncodingSet(string const & doc_encoding) const void LaTeXFeatures::getFontEncodings(vector & encodings) const { - // these must be loaded if glyphs of this script - // are used (notwithstanding the language) + // these must be loaded if glyphs of this script are used + // unless a language providing them is used in the document + // FIXME: currently the option is written twice in this case if (mustProvide("textgreek")) encodings.insert(encodings.begin(), "LGR"); if (mustProvide("textcyr")) @@ -796,7 +797,8 @@ char const * simplefeatures[] = { "pdfcomment", "fixme", "todonotes", - "forest" + "forest", + "varwidth" }; char const * bibliofeatures[] = { @@ -933,7 +935,7 @@ string const LaTeXFeatures::getPackages() const string const amsPackages = loadAMSPackages(); bool const ot1 = (params_.font_encoding() == "default" || params_.font_encoding() == "OT1"); bool const use_newtxmath = - theLaTeXFonts().getLaTeXFont(from_ascii(params_.fonts_math)).getUsedPackage( + theLaTeXFonts().getLaTeXFont(from_ascii(params_.fontsMath())).getUsedPackage( ot1, false, false) == "newtxmath"; if (!params_.useNonTeXFonts && !use_newtxmath && !amsPackages.empty()) @@ -1171,24 +1173,15 @@ docstring const LaTeXFeatures::getMacros() const // ensure LGR font encoding is defined also if fontenc is not loaded by LyX if (params_.font_encoding() == "default") macros << textgreek_LGR_def; - // Avoid a LaTeX error if times fonts are used and the grtimes - // package is installed but actual fonts are not (bug 6469). - if (params_.fonts_roman == "times") - macros << subst(textgreek_def, - from_ascii("\\greektext #1"), - from_ascii("%\n \\IfFileExists" - "{grtm10.tfm}{}{\\fontfamily" - "{cmr}}\\greektext #1")) - << '\n'; - else - macros << textgreek_def << '\n'; + macros << textgreek_def << '\n'; } - if (!usePolyglossia() && mustProvide("textcyr")) - // ensure T2A font encoding is set up also if fontenc is not loaded by LyX - if (params_.font_encoding() == "default") + if (!usePolyglossia() && mustProvide("textcyr")) { + // ensure T2A font encoding is set up also if fontenc is not loaded by LyX + if (params_.font_encoding() == "default") macros << textcyr_T2A_def; macros << textcyr_def << '\n'; + } // non-standard text accents: if (mustProvide("textcommaabove") || mustProvide("textcommaaboveright") ||