using std::endl;
using std::pair;
-#ifdef WITH_WARNINGS
-#warning Do we need this horrible thing? (JMarc)
-#endif
-bool use_babel;
-
BufferParams::BufferParams()
// Initialize textclass to point to article. if `first' is
if (tmpret == -1)
++tmpret;
else
- papersize2 = tmpret;
+ papersize2 = VMARGIN_PAPER_TYPE(tmpret);
} else if (token == "\\paperpackage") {
int tmpret = lex.findToken(string_paperpackages);
if (tmpret == -1) {
++tmpret;
paperpackage = BufferParams::PACKAGE_NONE;
} else
- paperpackage = tmpret;
+ paperpackage = PAPER_PACKAGES(tmpret);
} else if (token == "\\use_geometry") {
lex.nextToken();
use_geometry = lex.getInteger();
}
-void BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
+bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
TexRow & texrow) const
{
os << "\\documentclass";
if (!use_geometry &&
(paperpackage == PACKAGE_NONE)) {
switch (papersize) {
+ case PAPER_A3PAPER:
+ clsoptions << "a3paper,";
+ break;
case PAPER_A4PAPER:
clsoptions << "a4paper,";
break;
case PAPER_LEGALPAPER:
clsoptions << "legalpaper,";
break;
+ case PAPER_DEFAULT:
+ break;
}
}
clsoptions << "landscape,";
// language should be a parameter to \documentclass
- use_babel = false;
- ostringstream language_options;
if (language->babel() == "hebrew"
&& default_language->babel() != "hebrew")
// This seems necessary
features.useLanguage(default_language);
- if (lyxrc.language_use_babel ||
- language->lang() != lyxrc.default_language ||
- features.hasLanguages()) {
- use_babel = true;
+ ostringstream language_options;
+ bool const use_babel = features.useBabel();
+ if (use_babel) {
language_options << features.getLanguages();
language_options << language->babel();
if (lyxrc.language_global_options)
// At the very beginning the text parameters.
if (paperpackage != PACKAGE_NONE) {
switch (paperpackage) {
+ case PACKAGE_NONE:
+ break;
case PACKAGE_A4:
os << "\\usepackage{a4}\n";
texrow.newline();
}
os << lyxpreamble;
+ return use_babel;
}
void BufferParams::setPaperStuff()