X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLaTeXFeatures.cpp;h=457029319b8109da841cf89bfac087c1840ee31e;hb=f37a1b8aeaf8f3a3a66a22bf0b396f7d1ceca2ff;hp=5d35d03f40b7a39ad7e01493256b3c70f399d775;hpb=c2f39490a7f33063c172f3b4b3ea0c1c14a0b4ee;p=lyx.git diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 5d35d03f40..457029319b 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -195,10 +195,9 @@ 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{\\~}{\\perispomeni}\n" + " \\renewcommand{\\~}{\\char126}%\n" "}}\n" "\\DeclareRobustCommand{\\textgreek}[1]{\\leavevmode{\\greektext #1}}\n" "\\DeclareFontEncoding{LGR}{}{}\n"); @@ -641,7 +640,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"; @@ -765,16 +764,25 @@ string const LaTeXFeatures::getPackages() const } +string LaTeXFeatures::getPreambleSnippets() const +{ + ostringstream snip; + SnippetList::const_iterator pit = preamble_snippets_.begin(); + SnippetList::const_iterator pend = preamble_snippets_.end(); + for (; pit != pend; ++pit) + snip << *pit << '\n'; + return snip.str(); +} + + docstring const LaTeXFeatures::getMacros() const { odocstringstream macros; - if (!preamble_snippets_.empty()) + if (!preamble_snippets_.empty()) { macros << '\n'; - SnippetList::const_iterator pit = preamble_snippets_.begin(); - SnippetList::const_iterator pend = preamble_snippets_.end(); - for (; pit != pend; ++pit) - macros << *pit << '\n'; + macros << from_utf8(getPreambleSnippets()); + } if (mustProvide("papersize")) { if (runparams_.flavor == OutputParams::LATEX)