lex.next();
string const classname = lex.getString();
// if there exists a local layout file, ignore the system one
- // NOTE: in this case, the textclass (.cls file) is assumed to be available.
+ // NOTE: in this case, the textclass (.cls file) is assumed to
+ // be available.
string tcp;
LayoutFileList & bcl = LayoutFileList::get();
if (tcp.empty() && !filepath.empty())
setBaseClass(tcp);
else
setBaseClass(classname);
- // We assume that a tex class exists for local or unknown layouts so this warning
- // will only be given for system layouts.
+ // 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 const desc =
translateIfPossible(from_utf8(baseClass()->description()));
- docstring const prereqs = from_utf8(baseClass()->prerequisites());
+ docstring const prereqs =
+ from_utf8(baseClass()->prerequisites());
docstring const msg =
bformat(_("The selected document class\n"
"\t%1$s\n"
string BufferParams::babelCall(string const & lang_opts, bool const langoptions) const
{
- string lang_pack = lyxrc.language_package;
- if (lang_pack != "\\usepackage{babel}")
- return lang_pack;
+ if (lyxrc.language_package_selection == LyXRC::LP_CUSTOM)
+ return lyxrc.language_custom_package;
// suppress the babel call if there is no BabelName defined
// for the document language in the lib/languages file and if no
// other languages are used (lang_opts is then empty)
// be submitted to babel itself (not the class).
if (langoptions)
return "\\usepackage[" + lang_opts + "]{babel}";
- return lang_pack;
+ return "\\usepackage{babel}";
}
ostringstream os;
if (xetex) {
- if (rm != "default")
- os << "\\setmainfont[Mapping=tex-text]{"
- << parseFontName(rm) << "}\n";
+ if (rm != "default") {
+ os << "\\setmainfont[Mapping=tex-text";
+ if (osf)
+ os << ",Numbers=OldStyle";
+ os << "]{" << parseFontName(rm) << "}\n";
+ }
if (sf != "default") {
string const sans = parseFontName(sf);
if (sfscale != 100)
os << "\\setmonofont[Mapping=tex-text]{"
<< mono << "}\n";
}
- if (osf)
- os << "\\defaultfontfeatures{Numbers=OldStyle}\n";
return os.str();
}