]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.cpp
Revert "Objective-C compililation support with cmake and C++11"
[lyx.git] / src / LaTeXFeatures.cpp
index 9292938c0f36d7ce71181eaceb073040ebd02d94..e20617f1c8a01ff3095b390236d125d41539ccc8 100644 (file)
@@ -428,6 +428,7 @@ void LaTeXFeatures::require(set<string> const & names)
 void LaTeXFeatures::useLayout(docstring const & layoutname)
 {
        // Some code to avoid loops in dependency definition
+       // FIXME THREAD
        static int level = 0;
        const int maxlevel = 30;
        if (level > maxlevel) {
@@ -600,6 +601,10 @@ bool LaTeXFeatures::hasLanguages() const
 
 bool LaTeXFeatures::hasOnlyPolyglossiaLanguages() const
 {
+       // first the main language
+       if (params_.language->polyglossia().empty())
+               return false;
+       // now the secondary languages
        LanguageList::const_iterator const begin = UsedLanguages_.begin();
        for (LanguageList::const_iterator cit = begin;
             cit != UsedLanguages_.end();
@@ -613,6 +618,10 @@ bool LaTeXFeatures::hasOnlyPolyglossiaLanguages() const
 
 bool LaTeXFeatures::hasPolyglossiaExclusiveLanguages() const
 {
+       // first the main language
+       if (params_.language->isPolyglossiaExclusive())
+               return true;
+       // now the secondary languages
        LanguageList::const_iterator const begin = UsedLanguages_.begin();
        for (LanguageList::const_iterator cit = begin;
             cit != UsedLanguages_.end();
@@ -701,9 +710,6 @@ char const * simplefeatures[] = {
        "fancybox",
        "calc",
        "units",
-       "tipa",
-       "tipx",
-       "tone",
        "framed",
        "soul",
        "textcomp",
@@ -735,7 +741,8 @@ char const * simplefeatures[] = {
        "multirow",
        "tfrupee",
        "shapepar",
-       "rsphrase"
+       "rsphrase",
+       "algorithm2e"
 };
 
 char const * bibliofeatures[] = {
@@ -851,6 +858,16 @@ string const LaTeXFeatures::getPackages() const
        // The rest of these packages are somewhat more complicated
        // than those above.
 
+       // The tipa package and its extensions (tipx, tone) must not
+       // be loaded with non-TeX fonts, since fontspec includes the
+       // respective macros
+       if (mustProvide("tipa") && !params_.useNonTeXFonts)
+               packages << "\\usepackage{tipa}\n";
+       if (mustProvide("tipx") && !params_.useNonTeXFonts)
+               packages << "\\usepackage{tipx}\n";
+       if (mustProvide("tone") && !params_.useNonTeXFonts)
+               packages << "\\usepackage{tone}\n";
+
        // if fontspec or newtxmath is used, AMS packages have to be loaded
        // before fontspec (in BufferParams)
        string const amsPackages = loadAMSPackages();
@@ -1680,7 +1697,8 @@ void LaTeXFeatures::getFloatDefinitions(odocstream & os) const
                        // effect. (Lgb)
                }
                if (cit->second)
-                       os << "\n\\newsubfloat{" << from_ascii(fl.floattype()) << "}\n";
+                       // The subfig package is loaded later
+                       os << "\n\\AtBeginDocument{\\newsubfloat{" << from_ascii(fl.floattype()) << "}}\n";
        }
 }