- string infile = ChangeExtension(from_file, (*it).from);
- if (!(*it).original_dir)
- infile = OnlyFilename(infile);
- string outfile = ChangeExtension(infile, (*it).to);
-
- string command = (*it).command;
- command = subst(command, "$$FName", infile);
- command = subst(command, "$$BaseName", basename);
- command = subst(command, "$$OutName", outfile);
- lyxerr << "Calling " << command << endl;
- ShowMessage(buffer, _("Executing command:"), command);
-
- Systemcalls one;
+ if (conv.need_aux && !run_latex
+ && !latex_command_.empty()) {
+ lyxerr[Debug::FILES]
+ << "Running " << latex_command_
+ << " to update aux file"<< endl;
+ runLaTeX(buffer, latex_command_, runparams);
+ }
+
+ string infile2 = (conv.original_dir)
+ ? infile : MakeRelPath(infile, path);
+ string outfile2 = (conv.original_dir)
+ ? outfile : MakeRelPath(outfile, path);
+
+ string command = conv.command;
+ command = subst(command, token_from, QuoteName(infile2));
+ command = subst(command, token_base, QuoteName(from_base));
+ command = subst(command, token_to, QuoteName(outfile2));
+ command = LibScriptSearch(command);
+
+ if (!conv.parselog.empty())
+ command += " 2> " + QuoteName(infile2 + ".out");
+
+ if (conv.from == "dvi" && conv.to == "ps")
+ command = add_options(command,
+ buffer->params.dvips_options());
+ else if (conv.from == "dvi" && prefixIs(conv.to, "pdf"))
+ command = add_options(command,
+ dvipdfm_options(buffer->params));
+
+ lyxerr[Debug::FILES] << "Calling " << command << endl;
+ if (buffer)
+ buffer->message(_("Executing command: ") + command);
+ Systemcall::Starttype type = (dummy)
+ ? Systemcall::DontWait : Systemcall::Wait;
+ Systemcall one;