X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLaTeXFeatures.cpp;h=562e0e2a00bc2bf6c693d472c9d03596154b40f9;hb=af16acb0b4c5379ac87fe0c9fae384af1babdc3a;hp=756949aefec971967d6384569e133ddb2d42cf34;hpb=3f6b034167fe87c2e4f5da0dda8b5d603973ae01;p=lyx.git diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 756949aefe..562e0e2a00 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -191,12 +191,14 @@ static docstring const textgreek_def = from_ascii( " \\fontencoding{LGR}\\selectfont\\def\\encodingdefault{LGR}}\n" "\\DeclareRobustCommand{\\textgreek}[1]{\\leavevmode{\\greektext #1}}\n" "\\ProvideTextCommand{\\~}{LGR}[1]{\\char126#1}\n"); - + +static docstring const textcyr_T2A_def = from_ascii( + "\\InputIfFileExists{t2aenc.def}{}{%\n" + " \\errmessage{File `t2aenc.def' not found: Cyrillic script not supported}}\n"); static docstring const textcyr_def = from_ascii( "\\DeclareRobustCommand{\\cyrtext}{%\n" " \\fontencoding{T2A}\\selectfont\\def\\encodingdefault{T2A}}\n" - "\\DeclareRobustCommand{\\textcyr}[1]{\\leavevmode{\\cyrtext #1}}\n" - "\\AtBeginDocument{\\DeclareFontEncoding{T2A}{}{}}\n"); + "\\DeclareRobustCommand{\\textcyr}[1]{\\leavevmode{\\cyrtext #1}}\n"); static docstring const lyxmathsym_def = from_ascii( "\\newcommand{\\lyxmathsym}[1]{\\ifmmode\\begingroup\\def\\b@ld{bold}\n" @@ -1169,21 +1171,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")) + 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") ||