#include "mathed/MathMacroTemplate.h"
#include "mathed/MathSupport.h"
+#include "graphics/GraphicsCache.h"
#include "graphics/PreviewLoader.h"
#include "frontends/alert.h"
ignore_parent(false), toc_backend(owner), macro_lock(false), timestamp_(0),
checksum_(0), wa_(0), gui_(0), undo_(*owner), bibinfo_cache_valid_(false),
bibfile_cache_valid_(false), cite_labels_valid_(false), preview_error_(false),
- inset(0), preview_loader_(0), cloned_buffer_(cloned_buffer), clone_list_(0),
- doing_export(false), parent_buffer(0),
+ inset(0), preview_loader_(0), cloned_buffer_(cloned_buffer),
+ clone_list_(0), doing_export(false), parent_buffer(0),
word_count_(0), char_count_(0), blank_count_(0)
{
if (!cloned_buffer_) {
// Write the preamble
runparams.use_babel = params().writeLaTeX(os, features,
d->filename.onlyPath());
+
+ if (!runparams.dryrun && features.hasPolyglossiaExclusiveLanguages()
+ && !features.hasOnlyPolyglossiaLanguages()) {
+ docstring blangs;
+ docstring plangs;
+ vector<string> bll = features.getBabelExclusiveLanguages();
+ vector<string> pll = features.getPolyglossiaExclusiveLanguages();
+ if (!bll.empty()) {
+ docstring langs;
+ for (vector<string>::const_iterator it = bll.begin(); it != bll.end(); ++it) {
+ if (!langs.empty())
+ langs += ", ";
+ langs += _(*it);
+ }
+ blangs = bll.size() > 1 ?
+ support::bformat(_("The languages %1$s are only supported by Babel."), langs)
+ : support::bformat(_("The language %1$s is only supported by Babel."), langs);
+ }
+ if (!pll.empty()) {
+ docstring langs;
+ for (vector<string>::const_iterator it = pll.begin(); it != pll.end(); ++it) {
+ if (!langs.empty())
+ langs += ", ";
+ langs += _(*it);
+ }
+ plangs = pll.size() > 1 ?
+ support::bformat(_("The languages %1$s are only supported by Polyglossia."), langs)
+ : support::bformat(_("The language %1$s is only supported by Polyglossia."), langs);
+ if (!blangs.empty())
+ plangs += "\n";
+ }
+
+ frontend::Alert::warning(
+ _("Incompatible Languages!"),
+ support::bformat(
+ _("You cannot use the following languages "
+ "together in one LaTeX document because "
+ "they require conflicting language packages:\n"
+ "%1$s%2$s"),
+ plangs, blangs));
+ }
// Japanese might be required only in some children of a document,
// but once required, we must keep use_japanese true.
}
// make the body.
+ // mark the beginning of the body to separate it from InPreamble insets
+ os.texrow().start(TexRow::beginDocument());
os << "\\begin{document}\n";
+ // mark the start of a new paragraph by simulating a newline,
+ // so that os.afterParbreak() returns true at document start
+ os.lastChar('\n');
+
// output the parent macros
MacroSet::iterator it = parentMacros.begin();
MacroSet::iterator end = parentMacros.end();
if (! tclass.class_header().empty())
os << from_ascii(tclass.class_header());
else if (runparams.flavor == OutputParams::XML)
- os << "PUBLIC \"-//OASIS//DTD DocBook XML//EN\" "
+ os << "PUBLIC \"-//OASIS//DTD DocBook XML V4.2//EN\" "
<< "\"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\"";
else
os << " PUBLIC \"-//OASIS//DTD DocBook V4.2//EN\"";
MacroContext mc = MacroContext(this, it);
for (DocIterator::idx_type i = 0; i < n; ++i) {
MathData & data = minset->cell(i);
- data.updateMacros(0, mc, utype);
+ data.updateMacros(0, mc, utype, 0);
}
}
}
// in order to know if we should output polyglossia
// macros (instead of babel macros)
LaTeXFeatures features(*this, params(), runparams);
- params().validate(features);
+ validate(features);
runparams.use_polyglossia = features.usePolyglossia();
// latex or literate
otexstream ots(os);
void Buffer::bufferErrors(TeXErrors const & terr, ErrorList & errorList) const
{
for (auto const & err : terr) {
- TextEntry start, end = TexRow::text_none;
+ TexRow::TextEntry start, end = TexRow::text_none;
int errorRow = err.error_in_line;
Buffer const * buf = 0;
Impl const * p = d;