]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.cpp
Use ASCII number in \char definition
[lyx.git] / src / LaTeXFeatures.cpp
index 4c993b6f7b9c55041a4a08e1e9b2f0490b5725d2..4dacfcdbe1374f10066886167b03456750d7c1ca 100644 (file)
@@ -123,19 +123,19 @@ static docstring const textquotedbl_def = from_ascii(
 
 static docstring const textquotedblp_xetex_def = from_ascii(
        "\\providecommand\\textquotedblplain{%\n"
-       "  \\bgroup\\addfontfeatures{Mapping=}\\textquotedbl\\egroup}");
+       "  \\bgroup\\addfontfeatures{Mapping=}\\char34\\egroup}");
 
 static docstring const textquotedblp_luatex_def = from_ascii(
        "\\providecommand\\textquotedblplain{%\n"
-       "  \\bgroup\\addfontfeatures{RawFeature=-tlig}\\textquotedbl\\egroup}");
+       "  \\bgroup\\addfontfeatures{RawFeature=-tlig}\\char34\\egroup}");
 
 static docstring const textquotesinglep_xetex_def = from_ascii(
        "\\providecommand\\textquotesingleplain{%\n"
-       "  \\bgroup\\addfontfeatures{Mapping=}\\textquotesingle\\egroup}");
+       "  \\bgroup\\addfontfeatures{Mapping=}\\char39\\egroup}");
 
 static docstring const textquotesinglep_luatex_def = from_ascii(
        "\\providecommand\\textquotesingleplain{%\n"
-       "  \\bgroup\\addfontfeatures{RawFeature=-tlig}\\textquotesingle\\egroup}");
+       "  \\bgroup\\addfontfeatures{RawFeature=-tlig}\\char39\\egroup}");
 
 static docstring const paragraphleftindent_def = from_ascii(
        "\\newenvironment{LyXParagraphLeftIndent}[1]%\n"
@@ -865,10 +865,11 @@ void LaTeXFeatures::getFontEncodings(vector<string> & encodings) const
 {
        // 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"))
+       if (mustProvide("textgreek")
+           && find(encodings.begin(), encodings.end(), "LGR") == encodings.end())
                encodings.insert(encodings.begin(), "LGR");
-       if (mustProvide("textcyr"))
+       if (mustProvide("textcyr")
+           && find(encodings.begin(), encodings.end(), "T2A") == encodings.end())
                encodings.insert(encodings.begin(), "T2A");
 
        LanguageList::const_iterator it  = UsedLanguages_.begin();
@@ -962,6 +963,7 @@ char const * bibliofeatures[] = {
        "authordate1-4",
        "babelbib",
        "bibgerm",
+       "chapterbib",
        "chicago",
        "chscite",
        "harvard",
@@ -1211,6 +1213,8 @@ string const LaTeXFeatures::getPackages() const
                        packages << "numbers";
                else
                        packages << "authoryear";
+               if (!params_.biblio_opts.empty())
+                       packages << ',' << params_.biblio_opts;
                packages << "]{natbib}\n";
        }
 
@@ -1222,8 +1226,12 @@ string const LaTeXFeatures::getPackages() const
        }
 
        // jurabib -- we need version 0.6 at least.
-       if (mustProvide("jurabib"))
-               packages << "\\usepackage{jurabib}[2004/01/25]\n";
+       if (mustProvide("jurabib")) {
+               packages << "\\usepackage";
+               if (!params_.biblio_opts.empty())
+                       packages << '[' << params_.biblio_opts << ']';
+               packages << "{jurabib}[2004/01/25]\n";
+       }
 
        // opcit -- we pass custombst as we output \bibliographystyle ourselves
        if (mustProvide("opcit")) {