#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.
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);