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) {
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();
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();
"fancybox",
"calc",
"units",
- "tipa",
- "tipx",
- "tone",
"framed",
"soul",
"textcomp",
"multirow",
"tfrupee",
"shapepar",
- "rsphrase"
+ "rsphrase",
+ "algorithm2e",
+ "sectionbox",
+ "tcolorbox"
};
char const * bibliofeatures[] = {
// The rest of these packages are somewhat more complicated
// than those above.
- // if fontspec is used, AMS packages have to be loaded before
- // fontspec (in BufferParams)
+ // 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();
- if (!params_.useNonTeXFonts && !amsPackages.empty())
+ bool const ot1 = (params_.font_encoding() == "default" || params_.font_encoding() == "OT1");
+ bool const use_newtxmath =
+ theLaTeXFonts().getLaTeXFont(from_ascii(params_.fonts_math)).getUsedPackage(
+ ot1, false, false) == "newtxmath";
+
+ if (!params_.useNonTeXFonts && !use_newtxmath && !amsPackages.empty())
packages << amsPackages;
// fixltx2e must be loaded after amsthm, since amsthm produces an error with
if (mustProvide("fixltx2e"))
packages << "\\usepackage{fixltx2e}\n";
- if (mustProvide("cancel") &&
- params_.use_package("cancel") != BufferParams::package_off)
- packages << "\\usepackage{cancel}\n";
+ if (mustProvide("cancel") &&
+ params_.use_package("cancel") != BufferParams::package_off)
+ packages << "\\usepackage{cancel}\n";
// wasysym is a simple feature, but it must be after amsmath if both
// are used
// wasysym redefines some integrals (e.g. iint) from amsmath. That
// 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";
}
}