]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.cpp
Use context-sensitive command termination
[lyx.git] / src / LaTeXFeatures.cpp
index 79ff5870c715edf8236de068323428f6955f0e5c..37209e23b02f92529cea6924313e15e5bac33573 100644 (file)
@@ -206,7 +206,7 @@ static docstring const changetracking_tikz_math_sout_def = from_ascii(
        "%% Strike out display math with tikz\n"
        "\\usepackage{tikz}\n"
        "\\usetikzlibrary{calc}\n"
-       "\\newcommand{\\lyxmathsout}[1]{\n"
+       "\\newcommand{\\lyxmathsout}[1]{%\n"
        "  \\tikz[baseline=(math.base)]{\n"
        "    \\node[inner sep=0pt,outer sep=0pt](math){#1};\n"
        "    \\draw($(math.south west)+(2em,.5em)$)--($(math.north east)-(2em,.5em)$);\n"
@@ -736,6 +736,42 @@ bool LaTeXFeatures::hasPolyglossiaExclusiveLanguages() const
 }
 
 
+vector<string> LaTeXFeatures::getPolyglossiaExclusiveLanguages() const
+{
+       vector<string> result;
+       // first the main language
+       if (params_.language->isPolyglossiaExclusive())
+               result.push_back(params_.language->display());
+       // now the secondary languages
+       LanguageList::const_iterator const begin = UsedLanguages_.begin();
+       for (LanguageList::const_iterator cit = begin;
+            cit != UsedLanguages_.end();
+            ++cit) {
+               if ((*cit)->isPolyglossiaExclusive())
+                       result.push_back((*cit)->display());
+       }
+       return result;
+}
+
+
+vector<string> LaTeXFeatures::getBabelExclusiveLanguages() const
+{
+       vector<string> result;
+       // first the main language
+       if (params_.language->isBabelExclusive())
+               result.push_back(params_.language->display());
+       // now the secondary languages
+       LanguageList::const_iterator const begin = UsedLanguages_.begin();
+       for (LanguageList::const_iterator cit = begin;
+            cit != UsedLanguages_.end();
+            ++cit) {
+               if ((*cit)->isBabelExclusive())
+                       result.push_back((*cit)->display());
+       }
+       return result;
+}
+
+
 string LaTeXFeatures::getBabelLanguages() const
 {
        ostringstream languages;
@@ -757,15 +793,16 @@ string LaTeXFeatures::getBabelLanguages() const
 }
 
 
-std::map<std::string, std::string> LaTeXFeatures::getPolyglossiaLanguages() const
+set<string> LaTeXFeatures::getPolyglossiaLanguages() const
 {
-       std::map<std::string, std::string> languages;
+       set<string> languages;
 
        LanguageList::const_iterator const begin = UsedLanguages_.begin();
        for (LanguageList::const_iterator cit = begin;
             cit != UsedLanguages_.end();
             ++cit) {
-               languages[(*cit)->polyglossia()] = (*cit)->polyglossiaOpts();
+               // We do not need the variants here
+               languages.insert((*cit)->polyglossia());
        }
        return languages;
 }