// FIXME: this warning will be given even if there exists a local .cls
// file. Even worse, the .lyx file can not be compiled or exported
// because the textclass is marked as unavilable.
- if (!getTextClass().isTeXClassAvailable()) {
+ if (!textClass().isTeXClassAvailable()) {
docstring const msg =
bformat(_("The layout file requested by this document,\n"
"%1$s.layout,\n"
paragraph_separation = parseptranslator().find(parsep);
} else if (token == "\\defskip") {
lex.next();
- pimpl_->defskip = VSpace(lex.getString());
+ string defskip = lex.getString();
+ if (defskip == "defskip")
+ // this is invalid
+ defskip = "medskip";
+ pimpl_->defskip = VSpace(defskip);
} else if (token == "\\quotes_language") {
string quotes_lang;
lex >> quotes_lang;
lex >> headsep;
} else if (token == "\\footskip") {
lex >> footskip;
+ } else if (token == "\\columnsep") {
+ lex >> columnsep;
} else if (token == "\\paperfontsize") {
lex >> fontsize;
} else if (token == "\\papercolumns") {
if (!footskip.empty())
os << "\\footskip "
<< VSpace(footskip).asLyXCommand() << '\n';
+ if (!columnsep.empty())
+ os << "\\columnsep "
+ << VSpace(columnsep).asLyXCommand() << '\n';
os << "\\secnumdepth " << secnumdepth
<< "\n\\tocdepth " << tocdepth
<< "\n\\paragraph_separation "
void BufferParams::validate(LaTeXFeatures & features) const
{
- if (!getTextClass().requires().empty()) {
- vector<string> req = getTextClass().requires();
- for (vector<string>::const_iterator it = req.begin();
- it != req.end(); ++it) {
- features.require(*it);
- }
- }
+ features.require(textClass().requires());
if (outputChanges) {
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
// AMS Style is at document level
if (use_amsmath == package_on
- || getTextClass().provides("amsmath"))
+ || textClass().provides("amsmath"))
features.require("amsmath");
if (use_esint == package_on)
features.require("esint");
{
os << "\\documentclass";
- TextClass const & tclass = getTextClass();
+ TextClass const & tclass = textClass();
ostringstream clsoptions; // the document class options.
os << ",headsep=" << from_ascii(Length(headsep).asLatexString());
if (!footskip.empty())
os << ",footskip=" << from_ascii(Length(footskip).asLatexString());
+ if (!columnsep.empty())
+ os << ",columnsep=" << from_ascii(Length(columnsep).asLatexString());
os << "}\n";
texrow.newline();
}
// hyperref, see
// http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg129680.html
if (language->lang() == "japanese-plain" &&
- !getTextClass().provides("japanese")) {
+ !textClass().provides("japanese")) {
//load babel in case it was not loaded due to an empty language list
if (language_options.str().empty())
lyxpreamble += "\\usepackage{babel}\n";
// use hyperref explicitely when it is required
if (features.isRequired("hyperref")) {
odocstringstream oss;
- pdfoptions().writeLaTeX(oss, getTextClass().provides("hyperref"));
+ pdfoptions().writeLaTeX(oss, textClass().provides("hyperref"));
lyxpreamble += oss.str();
}
}
-TextClass const & BufferParams::getTextClass() const
+TextClass const & BufferParams::textClass() const
{
return *textClass_;
}
-TextClassPtr BufferParams::getTextClassPtr() const {
+TextClassPtr BufferParams::textClassPtr() const {
return textClass_;
}
frontend::Alert::warning(_("Package not available"), msg);
}
FileName layout_file = libFileSearch("layouts", lm->getFilename());
- textClass_->read(layout_file, TextClass::MODULE);
+ if (!textClass_->read(layout_file, TextClass::MODULE)) {
+ docstring const msg =
+ bformat(_("Error reading module %1$s\n"), from_utf8(modName));
+ frontend::Alert::warning(_("Read Error"), msg);
+ }
}
}
Font const BufferParams::getFont() const
{
- FontInfo f = getTextClass().defaultfont();
+ FontInfo f = textClass().defaultfont();
if (fontsDefaultFamily == "rmdefault")
f.setFamily(ROMAN_FAMILY);
else if (fontsDefaultFamily == "sfdefault")
{
// FIXME the class should provide the numerical/
// authoryear choice
- if (getTextClass().provides("natbib")
+ if (textClass().provides("natbib")
&& cite_engine_ != biblio::ENGINE_NATBIB_NUMERICAL)
return biblio::ENGINE_NATBIB_AUTHORYEAR;
return cite_engine_;