string const token_path("$$p");
string const token_orig_path("$$r");
string const token_encoding("$$e");
+string const token_latex_encoding("$$E");
string const add_options(string const & command, string const & options)
<< conv.from << " to " << conv.to);
}
infile = outfile;
- outfile = FileName(conv.result_dir.empty()
+ outfile = FileName(conv.result_file.empty()
? changeExtension(from_file.absFileName(), conv.To->extension())
: addName(subst(conv.result_dir,
token_base, from_base),
// if input and output files are equal, we use a
// temporary file as intermediary (JMarc)
FileName real_outfile;
+ if (!conv.result_file.empty())
+ real_outfile = FileName(changeExtension(from_file.absFileName(),
+ conv.To->extension()));
if (outfile == infile) {
real_outfile = infile;
// when importing, a buffer does not necessarily exist
if (conv.latex) {
run_latex = true;
- string const command = subst(conv.command, token_from, "");
+ string command = conv.command;
+ command = subst(command, token_from, "");
+ command = subst(command, token_latex_encoding, buffer ?
+ buffer->params().encoding().latexName() : string());
LYXERR(Debug::FILES, "Running " << command);
if (!runLaTeX(*buffer, command, runparams, errorList))
return false;