X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLaTeXFeatures.cpp;h=1629186280413fe8ba5d87bcd18f183f107ed095;hb=489b80aef4d7904d667aeb06a32f2cc4ecbb75fa;hp=9538fd0dea3adff1e462535354f5a236c9dcf2a0;hpb=28ce123a18e4f37d8ff8a81fba462b8d0b16ac51;p=lyx.git diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 9538fd0dea..1629186280 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -195,9 +195,10 @@ static docstring const changetracking_none_def = from_ascii( "\\newcommand{\\lyxdeleted}[3]{}\n"); static docstring const textgreek_def = from_ascii( + "\\providecommand*{\\perispomeni}{\\char126}\n" "\\AtBeginDocument{\\DeclareRobustCommand{\\greektext}{%\n" " \\fontencoding{LGR}\\selectfont\\def\\encodingdefault{LGR}%\n" - " \\renewcommand{\\~}{\\char126}%\n" + " \\renewcommand{\\~}{\\perispomeni}%\n" "}}\n" "\\DeclareRobustCommand{\\textgreek}[1]{\\leavevmode{\\greektext #1}}\n" "\\DeclareFontEncoding{LGR}{}{}\n"); @@ -414,7 +415,6 @@ bool LaTeXFeatures::isAvailable(string const & name) void LaTeXFeatures::addPreambleSnippet(string const & preamble) { - LYXERR0(preamble); SnippetList::const_iterator begin = preamble_snippets_.begin(); SnippetList::const_iterator end = preamble_snippets_.end(); if (find(begin, end, preamble) == end) @@ -641,7 +641,7 @@ string const LaTeXFeatures::getPackages() const // the document does not contain integrals (then isRequired("esint") // is false) or if esint is used, since esint redefines all relevant // integral symbols from wasysym and amsmath. - // See http://bugzilla.lyx.org/show_bug.cgi?id=1942 + // See http://www.lyx.org/trac/ticket/1942 if (mustProvide("wasysym") && (params_.use_esint != BufferParams::package_off || !isRequired("esint"))) packages << "\\usepackage{wasysym}\n"; @@ -770,11 +770,8 @@ string LaTeXFeatures::getPreambleSnippets() const ostringstream snip; SnippetList::const_iterator pit = preamble_snippets_.begin(); SnippetList::const_iterator pend = preamble_snippets_.end(); - for (; pit != pend; ++pit) { - LYXERR0(*pit); + for (; pit != pend; ++pit) snip << *pit << '\n'; - } - LYXERR0(snip.str()); return snip.str(); } @@ -807,8 +804,19 @@ docstring const LaTeXFeatures::getMacros() const if (mustProvide("lyxarrow")) macros << lyxarrow_def << '\n'; - if (mustProvide("textgreek")) - macros << textgreek_def << '\n'; + if (mustProvide("textgreek")) { + // Avoid a LaTeX error if times fonts are used and the grtimes + // package is installed but actual fonts are not (bug 6469). + if (params_.fontsRoman == "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'; + } if (mustProvide("textcyr")) macros << textcyr_def << '\n';