use_amsmath = package_auto;
use_esint = package_auto;
use_mhchem = package_auto;
+ use_mathdots = package_auto;
cite_engine_ = ENGINE_BASIC;
use_bibtopic = false;
use_indices = false;
// We assume that a tex class exists for local or unknown layouts so this warning
// will only be given for system layouts.
if (!baseClass()->isTeXClassAvailable()) {
- docstring desc =
+ docstring const desc =
translateIfPossible(from_utf8(baseClass()->description()));
+ docstring const prereqs = from_utf8(baseClass()->prerequisites());
docstring const msg =
bformat(_("The selected document class\n"
"\t%1$s\n"
"requires external files that are not available.\n"
- "The document class can still be used, but LyX\n"
- "will not be able to produce output until the\n"
- "following prerequisites are installed:\n"
+ "The document class can still be used, but the\n"
+ "document cannot be compiled until the following\n"
+ "prerequisites are installed:\n"
"\t%2$s\n"
"See section 3.1.2.2 of the User's Guide for\n"
- "more information."),
- desc, from_utf8(baseClass()->prerequisites()));
+ "more information."), desc, prereqs);
frontend::Alert::warning(_("Document class not available"),
msg);
}
int usemhchem;
lex >> usemhchem;
use_mhchem = packagetranslator().find(usemhchem);
+ } else if (token == "\\use_mathdots") {
+ int usemathdots;
+ lex >> usemathdots;
+ use_mathdots = packagetranslator().find(usemathdots);
} else if (token == "\\cite_engine") {
string engine;
lex >> engine;
<< "\n\\use_amsmath " << use_amsmath
<< "\n\\use_esint " << use_esint
<< "\n\\use_mhchem " << use_mhchem
+ << "\n\\use_mathdots " << use_mathdots
<< "\n\\cite_engine " << citeenginetranslator().find(cite_engine_)
<< "\n\\use_bibtopic " << convert<string>(use_bibtopic)
<< "\n\\use_indices " << convert<string>(use_indices)
features.require("esint");
if (use_mhchem == package_on)
features.require("mhchem");
+ if (use_mathdots == package_on)
+ features.require("mathdots");
// Document-level line spacing
if (spacing().getSpace() != Spacing::Single && !spacing().isDefault())
features.useLanguage(default_language);
ostringstream language_options;
- bool const use_babel = features.useBabel();
+ bool const use_babel = features.useBabel() && !tclass.provides("babel");
if (use_babel) {
language_options << features.getLanguages();
if (!language->babel().empty()) {
texrow.newlines(lines);
// set back for the rest
lyxpreamble.clear();
- }
+ } else if (features.isRequired("nameref"))
+ // hyperref loads this automatically
+ lyxpreamble += "\\usepackage{nameref}\n";
// Will be surrounded by \makeatletter and \makeatother when not empty
docstring atlyxpreamble;