#include "LaTeXFonts.h"
#include "LaTeXPackages.h"
#include "Layout.h"
-#include "Lexer.h"
#include "LyXRC.h"
+#include "OutputParams.h"
#include "TextClass.h"
#include "TexRow.h"
#include "texstream.h"
#include "support/debug.h"
#include "support/docstream.h"
-#include "support/FileName.h"
+#include "support/docstring.h"
#include "support/filetools.h"
-#include "support/gettext.h"
#include "support/lstrings.h"
-#include "support/regex.h"
#include <algorithm>
+#include <regex>
using namespace std;
} // namespace
-void LaTeXFeatures::addPreambleSnippet(TexString ts, bool allow_dupes)
+void LaTeXFeatures::addPreambleSnippet(TexString snippet, bool allow_dupes)
{
- addSnippet(preamble_snippets_, move(ts), allow_dupes);
+ addSnippet(preamble_snippets_, move(snippet), allow_dupes);
}
-void LaTeXFeatures::addPreambleSnippet(docstring const & str, bool allow_dupes)
+void LaTeXFeatures::addPreambleSnippet(docstring const & snippet, bool allow_dupes)
{
- addSnippet(preamble_snippets_, TexString(str), allow_dupes);
+ addSnippet(preamble_snippets_, TexString(snippet), allow_dupes);
}
"named"
};
-int const nb_bibliofeatures = sizeof(bibliofeatures) / sizeof(char const *);
-
-int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
-
} // namespace
// These are all the 'simple' includes. i.e
// packages which we just \usepackage{package}
- for (int i = 0; i < nb_simplefeatures; ++i) {
- if (mustProvide(simplefeatures[i]))
- packages << "\\usepackage{" << simplefeatures[i] << "}\n";
+ for (char const * feature : simplefeatures) {
+ if (mustProvide(feature))
+ packages << "\\usepackage{" << feature << "}\n";
}
// The rest of these packages are somewhat more complicated
if (mustProvide("changebar")) {
packages << "\\usepackage";
- if (runparams_.flavor == OutputParams::LATEX
- || runparams_.flavor == OutputParams::DVILUATEX)
+ if (runparams_.flavor == Flavor::LaTeX
+ || runparams_.flavor == Flavor::DviLuaTeX)
packages << "[dvips]";
packages << "{changebar}\n";
}
// [pdf]lscape is used to rotate longtables
if (mustProvide("lscape")) {
- if (runparams_.flavor == OutputParams::LATEX
- || runparams_.flavor == OutputParams::DVILUATEX)
+ if (runparams_.flavor == Flavor::LaTeX
+ || runparams_.flavor == Flavor::DviLuaTeX)
packages << "\\usepackage{lscape}\n";
else
packages << "\\usepackage{pdflscape}\n";
packages << "\\usepackage{esint}\n";
// Known bibliography packages (simple \usepackage{package})
- for (int i = 0; i < nb_bibliofeatures; ++i) {
- if (mustProvide(bibliofeatures[i]))
- packages << "\\usepackage{"
- << bibliofeatures[i] << "}\n";
+ for (char const * feature : bibliofeatures) {
+ if (mustProvide(feature))
+ packages << "\\usepackage{" << feature << "}\n";
}
// Compatibility between achicago and natbib
macros << "\\XeTeXdashbreakstate 0" << '\n';
if (mustProvide("papersize")) {
- if (runparams_.flavor == OutputParams::LATEX
- || runparams_.flavor == OutputParams::DVILUATEX)
+ if (runparams_.flavor == Flavor::LaTeX
+ || runparams_.flavor == Flavor::DviLuaTeX)
macros << papersizedvi_def << '\n';
- else if (runparams_.flavor == OutputParams::LUATEX)
+ else if (runparams_.flavor == Flavor::LuaTeX)
macros << papersizepdflua_def << '\n';
else
macros << papersizepdf_def << '\n';
if (mustProvide("textquotedbl"))
macros << textquotedbl_def << '\n';
if (mustProvide("textquotesinglep")) {
- if (runparams_.flavor == OutputParams::XETEX)
+ if (runparams_.flavor == Flavor::XeTeX)
macros << textquotesinglep_xetex_def << '\n';
else
macros << textquotesinglep_luatex_def << '\n';
}
if (mustProvide("textquotedblp")) {
- if (runparams_.flavor == OutputParams::XETEX)
+ if (runparams_.flavor == Flavor::XeTeX)
macros << textquotedblp_xetex_def << '\n';
else
macros << textquotedblp_luatex_def << '\n';
if (mustProvide("lyxgreyedout")) {
// We need different version for RTL (#8647)
if (hasRTLLanguage()) {
- if (runparams_.flavor == OutputParams::LUATEX)
+ if (runparams_.flavor == Flavor::LuaTeX)
if (useBabel())
macros << lyxgreyedout_luartl_babel_def;
else
{
// Check whether name can be encoded in the buffer encoding
bool encodable = true;
- for (size_t i = 0; i < name.size(); ++i) {
- if (!enc.encodable(name[i])) {
+ for (char_type c : name) {
+ if (!enc.encodable(c)) {
encodable = false;
break;
}