static char const * const string_papersize[] = {
+ "default", "custom", "letter", "legal", "executive",
+ "a0", "a1", "a2", "a3", "a4", "a5", "a6",
+ "b0", "b1", "b2", "b3", "b4", "b5", "b6",
+ "c0", "c1", "c2", "c3", "c4", "c5", "c6",
+ "b0j", "b1j", "b2j", "b3j", "b4j", "b5j", "b6j", ""
+};
+
+
+static char const * const string_papersize_geometry[] = {
"default", "custom", "letterpaper", "legalpaper", "executivepaper",
- "a0paper", "a1paper", "a2paper", "a3paper", "a4paper", "a5paper",
- "a6paper", "b0paper", "b1paper", "b2paper","b3paper", "b4paper",
- "b5paper", "b6paper", "c0paper", "c1paper", "c2paper", "c3paper",
- "c4paper", "c5paper", "c6paper", "b0j", "b1j", "b2j", "b3j", "b4j", "b5j",
- "b6j", ""
+ "a0paper", "a1paper", "a2paper", "a3paper", "a4paper", "a5paper", "a6paper",
+ "b0paper", "b1paper", "b2paper", "b3paper", "b4paper", "b5paper", "b6paper",
+ "c0paper", "c1paper", "c2paper", "c3paper", "c4paper", "c5paper", "c6paper",
+ "b0j", "b1j", "b2j", "b3j", "b4j", "b5j", "b6j", ""
};
{
// set initial author
// FIXME UNICODE
- authorlist.record(Author(from_utf8(lyxrc.user_name), from_utf8(lyxrc.user_email)));
+ authorlist.record(Author(from_utf8(lyxrc.user_name),
+ from_utf8(lyxrc.user_email),
+ from_utf8(lyxrc.user_initials)));
}
save_transient_properties = true;
track_changes = false;
output_changes = false;
+ change_bars = false;
+ postpone_fragile_content = true;
use_default_options = true;
- maintain_unincluded_children = false;
+ maintain_unincluded_children = CM_None;
secnumdepth = 3;
tocdepth = 3;
language = default_language;
html_math_output = MathML;
html_math_img_scale = 1.0;
html_css_as_file = false;
+ docbook_table_output = HTMLTable;
display_pixel_ratio = 1.0;
shell_escape = false;
} else if (token == "\\begin_includeonly") {
readIncludeonly(lex);
} else if (token == "\\maintain_unincluded_children") {
- lex >> maintain_unincluded_children;
+ string tmp;
+ lex >> tmp;
+ if (tmp == "no")
+ maintain_unincluded_children = CM_None;
+ else if (tmp == "mostly")
+ maintain_unincluded_children = CM_Mostly;
+ else if (tmp == "strict")
+ maintain_unincluded_children = CM_Strict;
} else if (token == "\\options") {
lex.eatLine();
options = lex.getString();
lex >> track_changes;
} else if (token == "\\output_changes") {
lex >> output_changes;
+ } else if (token == "\\change_bars") {
+ lex >> change_bars;
+ } else if (token == "\\postpone_fragile_content") {
+ lex >> postpone_fragile_content;
} else if (token == "\\branch") {
lex.eatLine();
docstring branch = lex.getDocString();
branch_ptr->setColor(color);
// Update also the Color table:
if (color == "none")
- color = lcolor.getX11Name(Color_background);
+ color = lcolor.getX11HexName(Color_background);
// FIXME UNICODE
lcolor.setColor(to_utf8(branch), color);
}
index_ptr->setColor(color);
// Update also the Color table:
if (color == "none")
- color = lcolor.getX11Name(Color_background);
+ color = lcolor.getX11HexName(Color_background);
// FIXME UNICODE
if (!shortcut.empty())
lcolor.setColor(to_utf8(shortcut), color);
} else if (token == "\\html_latex_end") {
lex.eatLine();
html_latex_end = lex.getString();
+ } else if (token == "\\docbook_table_output") {
+ int temp;
+ lex >> temp;
+ docbook_table_output = static_cast<TableOutput>(temp);
} else if (token == "\\output_sync") {
lex >> output_sync;
} else if (token == "\\output_sync_macro") {
// removed modules
if (!removed_modules_.empty()) {
os << "\\begin_removed_modules" << '\n';
- list<string>::const_iterator it = removed_modules_.begin();
- list<string>::const_iterator en = removed_modules_.end();
- for (; it != en; ++it)
- os << *it << '\n';
+ for (auto const & mod : removed_modules_)
+ os << mod << '\n';
os << "\\end_removed_modules" << '\n';
}
// the modules
if (!layout_modules_.empty()) {
os << "\\begin_modules" << '\n';
- LayoutModuleList::const_iterator it = layout_modules_.begin();
- LayoutModuleList::const_iterator en = layout_modules_.end();
- for (; it != en; ++it)
- os << *it << '\n';
+ for (auto const & mod : layout_modules_)
+ os << mod << '\n';
os << "\\end_modules" << '\n';
}
// includeonly
if (!included_children_.empty()) {
os << "\\begin_includeonly" << '\n';
- list<string>::const_iterator it = included_children_.begin();
- list<string>::const_iterator en = included_children_.end();
- for (; it != en; ++it)
- os << *it << '\n';
+ for (auto const & c : included_children_)
+ os << c << '\n';
os << "\\end_includeonly" << '\n';
}
- os << "\\maintain_unincluded_children "
- << convert<string>(maintain_unincluded_children) << '\n';
+ string muc = "no";
+ switch (maintain_unincluded_children) {
+ case CM_Mostly:
+ muc = "mostly";
+ break;
+ case CM_Strict:
+ muc = "strict";
+ break;
+ case CM_None:
+ default:
+ break;
+ }
+ os << "\\maintain_unincluded_children " << muc << '\n';
// local layout information
docstring const local_layout = getLocalLayout(false);
os << "\\papersize " << string_papersize[papersize]
<< "\n\\use_geometry " << convert<string>(use_geometry);
map<string, string> const & packages = auto_packages();
- for (map<string, string>::const_iterator it = packages.begin();
- it != packages.end(); ++it)
- os << "\n\\use_package " << it->first << ' '
- << use_package(it->first);
+ for (auto const & pack : packages)
+ os << "\n\\use_package " << pack.first << ' '
+ << use_package(pack.first);
os << "\n\\cite_engine ";
if (boxbgcolor != lyx::rgbFromHexName("#ff0000"))
os << "\\boxbgcolor " << lyx::X11hexname(boxbgcolor) << '\n';
- BranchList::const_iterator it = branchlist().begin();
- BranchList::const_iterator end = branchlist().end();
- for (; it != end; ++it) {
- os << "\\branch " << to_utf8(it->branch())
- << "\n\\selected " << it->isSelected()
- << "\n\\filename_suffix " << it->hasFileNameSuffix()
- << "\n\\color " << lyx::X11hexname(it->color())
+ for (auto const & br : branchlist()) {
+ os << "\\branch " << to_utf8(br.branch())
+ << "\n\\selected " << br.isSelected()
+ << "\n\\filename_suffix " << br.hasFileNameSuffix()
+ << "\n\\color " << lyx::X11hexname(br.color())
<< "\n\\end_branch"
<< "\n";
}
- IndicesList::const_iterator iit = indiceslist().begin();
- IndicesList::const_iterator iend = indiceslist().end();
- for (; iit != iend; ++iit) {
- os << "\\index " << to_utf8(iit->index())
- << "\n\\shortcut " << to_utf8(iit->shortcut())
- << "\n\\color " << lyx::X11hexname(iit->color())
+ for (auto const & id : indiceslist()) {
+ os << "\\index " << to_utf8(id.index())
+ << "\n\\shortcut " << to_utf8(id.shortcut())
+ << "\n\\color " << lyx::X11hexname(id.color())
<< "\n\\end_index"
<< "\n";
}
<< (save_transient_properties ? convert<string>(output_changes) : "false")
<< '\n';
+ os << "\\change_bars "
+ << (save_transient_properties ? convert<string>(change_bars) : "false")
+ << '\n';
+
+ os << "\\postpone_fragile_content " << convert<string>(postpone_fragile_content) << '\n';
+
os << "\\html_math_output " << html_math_output << '\n'
<< "\\html_css_as_file " << html_css_as_file << '\n'
<< "\\html_be_strict " << convert<string>(html_be_strict) << '\n';
+ os << "\\docbook_table_output " << docbook_table_output << '\n';
+
if (html_math_img_scale != 1.0)
os << "\\html_math_img_scale " << convert<string>(html_math_img_scale) << '\n';
if (!html_latex_start.empty())
void BufferParams::validate(LaTeXFeatures & features) const
{
- features.require(documentClass().requires());
+ features.require(documentClass().required());
if (columns > 1 && language->rightToLeft())
features.require("rtloutputdblcol");
if (output_changes) {
- bool dvipost = LaTeXFeatures::isAvailable("dvipost");
bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
LaTeXFeatures::isAvailable("xcolor");
switch (features.runparams().flavor) {
case OutputParams::LATEX:
case OutputParams::DVILUATEX:
- if (dvipost) {
- features.require("ct-dvipost");
- features.require("dvipost");
- } else if (xcolorulem) {
+ if (xcolorulem) {
features.require("ct-xcolor-ulem");
features.require("ulem");
features.require("xcolor");
default:
break;
}
+ if (change_bars)
+ features.require("changebar");
}
// Floats with 'Here definitely' as default setting.
if (float_placement.find('H') != string::npos)
features.require("float");
- for (PackageMap::const_iterator it = use_packages.begin();
- it != use_packages.end(); ++it) {
- if (it->first == "amsmath") {
+ for (auto const & pm : use_packages) {
+ if (pm.first == "amsmath") {
// AMS Style is at document level
- if (it->second == package_on ||
+ if (pm.second == package_on ||
features.isProvided("amsmath"))
- features.require(it->first);
- } else if (it->second == package_on)
- features.require(it->first);
+ features.require(pm.first);
+ } else if (pm.second == package_on)
+ features.require(pm.first);
}
// Document-level line spacing
if (use_microtype)
features.require("microtype");
- if (!language->requires().empty())
- features.require(language->requires());
+ if (!language->required().empty())
+ features.require(language->required());
}
if (tokenPos(tclass.opt_fontsize(),
'|', fontsize) >= 0) {
// only write if existing in list (and not default)
- clsoptions << fontsize << "pt,";
+ clsoptions << subst(tclass.fontsizeformat(), "$$s", fontsize) << ",";
}
- // all paper sizes except of A4, A5, B5 and the US sizes need the
+ // paper sizes not supported by the class itself need the
// geometry package
- bool nonstandard_papersize = papersize != PAPER_DEFAULT
- && papersize != PAPER_USLETTER
- && papersize != PAPER_USLEGAL
- && papersize != PAPER_USEXECUTIVE
- && papersize != PAPER_A4
- && papersize != PAPER_A5
- && papersize != PAPER_B5;
-
- if (!use_geometry || features.isProvided("geometry-light")) {
- switch (papersize) {
- case PAPER_A4:
- clsoptions << "a4paper,";
- break;
- case PAPER_USLETTER:
- clsoptions << "letterpaper,";
- break;
- case PAPER_A5:
- clsoptions << "a5paper,";
- break;
- case PAPER_B5:
- clsoptions << "b5paper,";
- break;
- case PAPER_USEXECUTIVE:
- clsoptions << "executivepaper,";
- break;
- case PAPER_USLEGAL:
- clsoptions << "legalpaper,";
- break;
- case PAPER_DEFAULT:
- case PAPER_A0:
- case PAPER_A1:
- case PAPER_A2:
- case PAPER_A3:
- case PAPER_A6:
- case PAPER_B0:
- case PAPER_B1:
- case PAPER_B2:
- case PAPER_B3:
- case PAPER_B4:
- case PAPER_B6:
- case PAPER_C0:
- case PAPER_C1:
- case PAPER_C2:
- case PAPER_C3:
- case PAPER_C4:
- case PAPER_C5:
- case PAPER_C6:
- case PAPER_JISB0:
- case PAPER_JISB1:
- case PAPER_JISB2:
- case PAPER_JISB3:
- case PAPER_JISB4:
- case PAPER_JISB5:
- case PAPER_JISB6:
- case PAPER_CUSTOM:
- break;
- }
- }
+ vector<string> classpsizes = getVectorFromString(tclass.opt_pagesize(), "|");
+ bool class_supported_papersize = papersize == PAPER_DEFAULT
+ || find(classpsizes.begin(), classpsizes.end(), string_papersize[papersize]) != classpsizes.end();
+
+ if ((!use_geometry || features.isProvided("geometry-light"))
+ && class_supported_papersize && papersize != PAPER_DEFAULT)
+ clsoptions << subst(tclass.pagesizeformat(), "$$s", string_papersize[papersize]) << ",";
// if needed
if (sides != tclass.sides()) {
if (!options.empty()) {
clsoptions << options << ',';
}
-
- string strOptions(clsoptions.str());
+
+ docstring const strOptions = from_utf8(clsoptions.str());
if (!strOptions.empty()) {
- strOptions = rtrim(strOptions, ",");
- // FIXME UNICODE
- os << '[' << from_utf8(strOptions) << ']';
+ // Check if class options contain uncodable glyphs
+ docstring uncodable_glyphs;
+ docstring options_encodable;
+ Encoding const * const enc = features.runparams().encoding;
+ if (enc) {
+ for (size_t n = 0; n < strOptions.size(); ++n) {
+ char_type c = strOptions[n];
+ if (!enc->encodable(c)) {
+ docstring const glyph(1, c);
+ LYXERR0("Uncodable character '"
+ << glyph
+ << "' in class options!");
+ uncodable_glyphs += glyph;
+ if (features.runparams().dryrun) {
+ options_encodable += "<" + _("LyX Warning: ")
+ + _("uncodable character") + " '";
+ options_encodable += c;
+ options_encodable += "'>";
+ }
+ } else
+ options_encodable += c;
+ }
+ } else
+ options_encodable = strOptions;
+
+ // On BUFFER_VIEW|UPDATE, warn user if we found uncodable glyphs
+ if (!features.runparams().dryrun && !uncodable_glyphs.empty()) {
+ frontend::Alert::warning(
+ _("Uncodable character in class options"),
+ support::bformat(
+ _("The class options of your document contain glyphs "
+ "that are unknown in the current document encoding "
+ "(namely %1$s).\nThese glyphs are omitted "
+ " from the output, which may result in "
+ "incomplete output."
+ "\n\nPlease select an appropriate "
+ "document encoding\n"
+ "(such as utf8) or change the "
+ "class options accordingly."),
+ uncodable_glyphs));
+ }
+ options_encodable = rtrim(options_encodable, ",");
+ os << '[' << options_encodable << ']';
}
os << '{' << from_ascii(tclass.latexname()) << "}\n";
// end of \documentclass defs
+ // The package options (via \PassOptionsToPackage)
+ os << from_ascii(features.getPackageOptions());
+
// if we use fontspec or newtxmath, we have to load the AMS packages here
string const ams = features.loadAMSPackages();
bool const ot1 = (main_font_encoding() == "default" || main_font_encoding() == "OT1");
// includeonly
if (!features.runparams().includeall && !included_children_.empty()) {
os << "\\includeonly{";
- list<string>::const_iterator it = included_children_.begin();
- list<string>::const_iterator en = included_children_.end();
bool first = true;
- for (; it != en; ++it) {
- string incfile = *it;
+ for (auto incfile : included_children_) {
FileName inc = makeAbsPath(incfile, filepath.absFileName());
string mangled = DocFileName(changeExtension(inc.absFileName(), ".tex")).
- mangledFileName();
+ mangledFileName();
if (!features.runparams().nice)
incfile = mangled;
// \includeonly doesn't want an extension
os << "}\n";
}
- if (use_geometry || nonstandard_papersize) {
+ if (!features.isProvided("geometry")
+ && (use_geometry || !class_supported_papersize)) {
odocstringstream ods;
if (!getGraphicsDriver("geometry").empty())
ods << getGraphicsDriver("geometry");
<< from_ascii(paperheight);
break;
case PAPER_USLETTER:
- ods << ",letterpaper";
- break;
case PAPER_USLEGAL:
- ods << ",legalpaper";
- break;
case PAPER_USEXECUTIVE:
- ods << ",executivepaper";
- break;
case PAPER_A0:
- ods << ",a0paper";
- break;
case PAPER_A1:
- ods << ",a1paper";
- break;
case PAPER_A2:
- ods << ",a2paper";
- break;
case PAPER_A3:
- ods << ",a3paper";
- break;
case PAPER_A4:
- ods << ",a4paper";
- break;
case PAPER_A5:
- ods << ",a5paper";
- break;
case PAPER_A6:
- ods << ",a6paper";
- break;
case PAPER_B0:
- ods << ",b0paper";
- break;
case PAPER_B1:
- ods << ",b1paper";
- break;
case PAPER_B2:
- ods << ",b2paper";
- break;
case PAPER_B3:
- ods << ",b3paper";
- break;
case PAPER_B4:
- ods << ",b4paper";
- break;
case PAPER_B5:
- ods << ",b5paper";
- break;
case PAPER_B6:
- ods << ",b6paper";
- break;
case PAPER_C0:
- ods << ",c0paper";
- break;
case PAPER_C1:
- ods << ",c1paper";
- break;
case PAPER_C2:
- ods << ",c2paper";
- break;
case PAPER_C3:
- ods << ",c3paper";
- break;
case PAPER_C4:
- ods << ",c4paper";
- break;
case PAPER_C5:
- ods << ",c5paper";
- break;
case PAPER_C6:
- ods << ",c6paper";
- break;
case PAPER_JISB0:
- ods << ",b0j";
- break;
case PAPER_JISB1:
- ods << ",b1j";
- break;
case PAPER_JISB2:
- ods << ",b2j";
- break;
case PAPER_JISB3:
- ods << ",b3j";
- break;
case PAPER_JISB4:
- ods << ",b4j";
- break;
case PAPER_JISB5:
- ods << ",b5j";
- break;
case PAPER_JISB6:
- ods << ",b6j";
+ ods << "," << from_ascii(string_papersize_geometry[papersize]);
break;
case PAPER_DEFAULT:
break;
}
docstring g_options = trim(ods.str(), ",");
+ os << "\\usepackage";
// geometry-light means that the class works with geometry, but overwrites
// the package options and paper sizes (memoir does this).
// In this case, all options need to go to \geometry
// and the standard paper sizes need to go to the class options.
- if (!features.isProvided("geometry")) {
- os << "\\usepackage";
- if (!g_options.empty() && !features.isProvided("geometry-light")) {
- os << '[' << g_options << ']';
- g_options.clear();
- }
- os << "{geometry}\n";
+ if (!g_options.empty() && !features.isProvided("geometry-light")) {
+ os << '[' << g_options << ']';
+ g_options.clear();
}
- if (use_geometry || features.isProvided("geometry")
- || features.isProvided("geometry-light")) {
+ os << "{geometry}\n";
+ if (use_geometry || features.isProvided("geometry-light")) {
os << "\\geometry{verbose";
if (!g_options.empty())
// Output general options here with "geometry light".
if (paragraph_separation) {
// when skip separation
+ string psopt;
switch (getDefSkip().kind()) {
case VSpace::SMALLSKIP:
- os << "\\setlength{\\parskip}{\\smallskipamount}\n";
+ psopt = "\\smallskipamount";
break;
case VSpace::MEDSKIP:
- os << "\\setlength{\\parskip}{\\medskipamount}\n";
+ psopt = "\\medskipamount";
break;
case VSpace::BIGSKIP:
- os << "\\setlength{\\parskip}{\\bigskipamount}\n";
+ psopt = "\\bigskipamount";
+ break;
+ case VSpace::HALFLINE:
+ // default (no option)
+ break;
+ case VSpace::FULLLINE:
+ psopt = "\\baselineskip";
break;
case VSpace::LENGTH:
- os << "\\setlength{\\parskip}{"
- << from_utf8(getDefSkip().length().asLatexString())
- << "}\n";
+ psopt = getDefSkip().length().asLatexString();
break;
- default: // should never happen // Then delete it.
- os << "\\setlength{\\parskip}{\\medskipamount}\n";
+ default:
break;
}
- os << "\\setlength{\\parindent}{0pt}\n";
+ if (!features.isProvided("parskip")) {
+ if (!psopt.empty())
+ psopt = "[skip=" + psopt + "]";
+ os << "\\usepackage" + psopt + "{parskip}\n";
+ } else {
+ os << "\\setlength{\\parskip}{" + psopt + "}\n";
+ }
} else {
// when separation by indentation
// only output something when a width is given
os << "\\synctex=-1\n";
}
- // The package options (via \PassOptionsToPackage)
- os << from_ascii(features.getPackageOptions());
-
// due to interferences with babel and hyperref, the color package has to
// be loaded (when it is not already loaded) before babel when hyperref
// is used with the colorlinks option, see
// Additional Indices
if (features.isRequired("splitidx")) {
- IndicesList::const_iterator iit = indiceslist().begin();
- IndicesList::const_iterator iend = indiceslist().end();
- for (; iit != iend; ++iit) {
+ for (auto const & idx : indiceslist()) {
os << "\\newindex{";
- os << escape(iit->shortcut());
+ os << escape(idx.shortcut());
os << "}\n";
}
}
// now setup the other languages
set<string> const polylangs =
features.getPolyglossiaLanguages();
- for (set<string>::const_iterator mit = polylangs.begin();
- mit != polylangs.end() ; ++mit) {
+ for (auto const & pl : polylangs) {
// We do not output the options here; they are output in
// the language switch commands. This is safer if multiple
// varieties are used.
- if (*mit == language->polyglossia())
+ if (pl == language->polyglossia())
continue;
os << "\\setotherlanguage";
- os << "{" << from_ascii(*mit) << "}\n";
+ os << "{" << from_ascii(pl) << "}\n";
}
}
{
if (LayoutFileList::get().haveClass(pimpl_->baseClass_))
return &(LayoutFileList::get()[pimpl_->baseClass_]);
- else
- return 0;
+
+ return nullptr;
}
invalidateConverterCache();
LayoutModuleList mods;
- LayoutModuleList::iterator it = layout_modules_.begin();
- LayoutModuleList::iterator en = layout_modules_.end();
- for (; it != en; ++it)
- mods.push_back(*it);
+ for (auto const & mod : layout_modules_)
+ mods.push_back(mod);
doc_class_ = getDocumentClass(*baseClass(), mods, cite_engine_, clone);
bool BufferParams::addLayoutModule(string const & modName)
{
- LayoutModuleList::const_iterator it = layout_modules_.begin();
- LayoutModuleList::const_iterator end = layout_modules_.end();
- for (; it != end; ++it)
- if (*it == modName)
+ for (auto const & mod : layout_modules_)
+ if (mod == modName)
return false;
layout_modules_.push_back(modName);
return true;
bool BufferParams::isExportable(string const & format, bool need_viewable) const
{
FormatList const & formats = exportableFormats(need_viewable);
- FormatList::const_iterator fit = formats.begin();
- FormatList::const_iterator end = formats.end();
- for (; fit != end ; ++fit) {
- if ((*fit)->name() == format)
+ for (auto const & fmt : formats) {
+ if (fmt->name() == format)
return true;
}
return false;
if (useNonTeXFonts) {
excludes.insert("latex");
excludes.insert("pdflatex");
- } else if (inputenc != "ascii" && inputenc != "utf8-plain")
+ } else if (inputenc != "ascii" && inputenc != "utf8-plain") {
// XeTeX with TeX fonts requires input encoding ascii (#10600).
excludes.insert("xetex");
- FormatList result = theConverters().getReachable(backs[0], only_viewable,
- true, excludes);
- for (vector<string>::const_iterator it = backs.begin() + 1;
- it != backs.end(); ++it) {
+ }
+
+ FormatList result =
+ theConverters().getReachable(backs[0], only_viewable, true, excludes);
+ vector<string>::const_iterator it = backs.begin() + 1;
+ for (; it != backs.end(); ++it) {
FormatList r = theConverters().getReachable(*it, only_viewable,
false, excludes);
result.insert(result.end(), r.begin(), r.end());
}
v.push_back("xhtml");
+ v.push_back("docbook5");
v.push_back("text");
v.push_back("lyx");
return v;
// something with formats.
if (dformat == "xhtml")
result = OutputParams::HTML;
+ else if (dformat == "docbook5")
+ result = OutputParams::DOCBOOK5;
else if (dformat == "text")
result = OutputParams::TEXT;
else if (dformat == "lyx")
if (!default_output_format.empty()
&& default_output_format != "default")
return default_output_format;
- if (isDocBook()) {
- FormatList const & formats = exportableFormats(true);
- if (formats.empty())
- return string();
- // return the first we find
- return formats.front()->name();
- }
if (encoding().package() == Encoding::japanese)
return lyxrc.default_platex_view_format;
if (useNonTeXFonts)
}
-bool BufferParams::isDocBook() const
-{
- return documentClass().outputType() == DOCBOOK;
-}
-
-
void BufferParams::readPreamble(Lexer & lex)
{
if (lex.getString() != "\\begin_preamble")
// added. normally, that will be because default modules were added in
// setBaseClass(), which gets called when \textclass is read at the
// start of the read.
- list<string>::const_iterator rit = removed_modules_.begin();
- list<string>::const_iterator const ren = removed_modules_.end();
- for (; rit != ren; ++rit) {
+ for (auto const & rm : removed_modules_) {
LayoutModuleList::iterator const mit = layout_modules_.begin();
LayoutModuleList::iterator const men = layout_modules_.end();
- LayoutModuleList::iterator found = find(mit, men, *rit);
+ LayoutModuleList::iterator found = find(mit, men, rm);
if (found == men)
continue;
layout_modules_.erase(found);
}
-string BufferParams::paperSizeName(PapersizePurpose purpose) const
+string BufferParams::paperSizeName(PapersizePurpose purpose, string const & psize) const
{
- switch (papersize) {
+ PAPER_SIZE ppsize = psize.empty() ? papersize : papersizetranslator().find(psize);
+ switch (ppsize) {
case PAPER_DEFAULT:
- // could be anything, so don't guess
- return string();
+ if (documentClass().pagesize() == "default")
+ // could be anything, so don't guess
+ return string();
+ return paperSizeName(purpose, documentClass().pagesize());
case PAPER_CUSTOM: {
if (purpose == XDVI && !paperwidth.empty() &&
!paperheight.empty()) {