string flag_name, flag_value;
flag_list = split(flag_list, flag_value, ',');
flag_value = split(flag_value, flag_name, '=');
- if (flag_name == "latex")
+ if (flag_name == "latex") {
latex = true;
- else if (flag_name == "xml")
+ latex_flavor = flag_value.empty() ?
+ "latex" : flag_value;
+ } else if (flag_name == "xml")
xml = true;
else if (flag_name == "needaux")
need_aux = true;
}
converter.readFlags();
- if (converter.latex && (latex_command_.empty() || to == "dvi"))
- latex_command_ = subst(command, token_from, "");
// If we have both latex & pdflatex, we set latex_command to latex.
// The latex_command is used to update the .aux file when running
// a converter that uses it.
+ if (converter.latex
+ && (latex_command_.empty() || converter.latex_flavor == "latex"))
+ latex_command_ = subst(command, token_from, "");
if (it == converterlist_.end()) {
converterlist_.push_back(converter);
cit != path.end(); ++cit) {
Converter const & conv = converterlist_[*cit];
if (conv.latex)
- if (contains(conv.from, "xetex"))
+ if (conv.latex_flavor == "xelatex")
return OutputParams::XETEX;
- if (contains(conv.to, "pdf"))
+ if (conv.latex_flavor == "lualatex")
+ return OutputParams::LUATEX;
+ if (conv.latex_flavor == "pdflatex")
return OutputParams::PDFLATEX;
if (conv.xml)
return OutputParams::XML;
command = subst(command, token_from, quoteName(infile2));
command = subst(command, token_base, quoteName(from_base));
command = subst(command, token_to, quoteName(outfile2));
- command = subst(command, token_path, quoteName(infile.onlyPath().absFileName()));
- command = subst(command, token_orig_path, quoteName(orig_from.onlyPath().absFileName()));
+ command = subst(command, token_path, quoteName(onlyPath(infile.absFileName())));
+ command = subst(command, token_orig_path, quoteName(onlyPath(orig_from.absFileName())));
command = subst(command, token_encoding, buffer ? buffer->params().encoding().iconvName() : string());
command = libScriptSearch(command);
// FIXME: this should go out of here. For example, here we cannot say if
// it is a document (.lyx) or something else. Same goes for elsewhere.
Alert::error(_("Cannot convert file"),
- bformat(_("An error occurred whilst running %1$s"),
- from_utf8(command.substr(0, 50))));
+ bformat(_("An error occurred while running:\n%1$s"),
+ wrapParas(from_utf8(command))));
}
return false;
}
{
vector<string> l = loaders();
vector<Format const *> result = getReachableTo(l[0], true);
- for (vector<string>::const_iterator it = l.begin() + 1;
- it != l.end(); ++it) {
+ vector<string>::const_iterator it = l.begin() + 1;
+ vector<string>::const_iterator en = l.end();
+ for (; it != en; ++it) {
vector<Format const *> r = getReachableTo(*it, false);
result.insert(result.end(), r.begin(), r.end());
}
{
vector<string> s = savers();
vector<Format const *> result = getReachable(s[0], only_viewable, true);
- for (vector<string>::const_iterator it = s.begin() + 1;
- it != s.end(); ++it) {
+ vector<string>::const_iterator it = s.begin() + 1;
+ vector<string>::const_iterator en = s.end();
+ for (; it != en; ++it) {
vector<Format const *> r =
getReachable(*it, only_viewable, false);
result.insert(result.end(), r.begin(), r.end());
v.push_back("docbook");
v.push_back("latex");
v.push_back("literate");
+ v.push_back("luatex");
v.push_back("lyx");
v.push_back("xhtml");
v.push_back("pdflatex");