X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLaTeXFeatures.cpp;h=1f88eb0f9a857cf5e3e19666684d7174d882f16b;hb=ad132e2e99f851b42e71397e6a32d86dc8eac43d;hp=862c3240618b23ab0f546a547ba32419e6a28c87;hpb=e0acb978ff34c174dcfaddae08caa70eed11ef35;p=lyx.git diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 862c324061..1f88eb0f9a 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -182,12 +182,12 @@ static docstring const changetracking_dvipost_def = from_ascii( static docstring const changetracking_xcolor_ulem_def = from_ascii( "%% Change tracking with ulem\n" - "\\newcommand{\\lyxadded}[3]{{\\color{lyxadded}#3}}\n" + "\\newcommand{\\lyxadded}[3]{{\\color{lyxadded}{}#3}}\n" "\\newcommand{\\lyxdeleted}[3]{{\\color{lyxdeleted}\\sout{#3}}}\n"); static docstring const changetracking_xcolor_ulem_hyperref_def = from_ascii( "%% Change tracking with ulem\n" - "\\newcommand{\\lyxadded}[3]{{\\texorpdfstring{\\color{lyxadded}}{}#3}}\n" + "\\newcommand{\\lyxadded}[3]{{\\texorpdfstring{\\color{lyxadded}{}}{}#3}}\n" "\\newcommand{\\lyxdeleted}[3]{{\\texorpdfstring{\\color{lyxdeleted}\\sout{#3}}{}}}\n"); static docstring const changetracking_none_def = from_ascii( @@ -195,8 +195,11 @@ static docstring const changetracking_none_def = from_ascii( "\\newcommand{\\lyxdeleted}[3]{}\n"); static docstring const textgreek_def = from_ascii( - "\\DeclareRobustCommand{\\greektext}{%\n" - " \\fontencoding{LGR}\\selectfont\\def\\encodingdefault{LGR}}\n" + "\\providecommand*{\\perispomeni}{\\char126}\n" + "\\AtBeginDocument{\\DeclareRobustCommand{\\greektext}{%\n" + " \\fontencoding{LGR}\\selectfont\\def\\encodingdefault{LGR}%\n" + " \\renewcommand{\\~}{\\perispomeni}\n" + "}}\n" "\\DeclareRobustCommand{\\textgreek}[1]{\\leavevmode{\\greektext #1}}\n" "\\DeclareFontEncoding{LGR}{}{}\n"); @@ -365,12 +368,10 @@ void LaTeXFeatures::useInsetLayout(InsetLayout const & lay) { docstring const & lname = lay.name(); DocumentClass const & tclass = params_.documentClass(); - if (!tclass.hasInsetLayout(lname)) { - lyxerr << "LaTeXFeatures::useInsetLayout: layout `" - << to_utf8(lname) << "' does not exist in this class" - << endl; + + // this is a default inset layout, nothing useful here + if (!tclass.hasInsetLayout(lname)) return; - } // Is this layout already in usedInsetLayouts? if (find(usedInsetLayouts_.begin(), usedInsetLayouts_.end(), lname) != usedInsetLayouts_.end()) @@ -399,7 +400,7 @@ bool LaTeXFeatures::isAvailable(string const & name) if (i != string::npos) { string const from = name.substr(0,i); string const to = name.substr(i+2); - LYXERR0("from=[" << from << "] to=[" << to << "]"); + //LYXERR0("from=[" << from << "] to=[" << to << "]"); return theConverters().isReachable(from, to); } @@ -649,6 +650,14 @@ string const LaTeXFeatures::getPackages() const if (mustProvide("accents")) packages << "\\usepackage{accents}\n"; + // mathdots must be loaded after amsmath + if (mustProvide("mathdots")) + packages << "\\usepackage{mathdots}\n"; + + // yhmath must be loaded after amsmath + if (mustProvide("yhmath")) + packages << "\\usepackage{yhmath}\n"; + // [x]color and pdfcolmk are handled in getColorOptions() above // makeidx.sty @@ -736,6 +745,11 @@ string const LaTeXFeatures::getPackages() const packages << "\\PassOptionsToPackage{normalem}{ulem}\n" "\\usepackage{ulem}\n"; + if (mustProvide("mhchem") && + params_.use_mhchem != BufferParams::package_off) + packages << "\\PassOptionsToPackage{version=3}{mhchem}\n" + "\\usepackage{mhchem}\n"; + if (mustProvide("nomencl")) { // Make it work with the new and old version of the package, // but don't use the compatibility option since it is