+ // FIXME what about LuaTeX?
+ if (buffer_.params().useNonTeXFonts)
+ cs << " --latex=xelatex";
+ if (buffer_.params().encoding().package() == Encoding::japanese)
+ cs << " --latex=platex";
+ if (buffer_.params().bibtex_command != "default")
+ cs << " --bibtex=" << quoteName(buffer_.params().bibtex_command);
+ else if (buffer_.params().encoding().package() == Encoding::japanese)
+ cs << " --bibtex=" << quoteName(lyxrc.jbibtex_command);
+ else
+ cs << " --bibtex=" << quoteName(lyxrc.bibtex_command);
+ if (buffer_.params().bufferFormat() == "lilypond-book")
+ cs << " --lilypond";
+
+ string const command = libScriptSearch(cs.str());
+
+ if (wait) {
+ ForkedCall call(buffer_.filePath());
+ int ret = call.startScript(ForkedProcess::Wait, command);
+ static int fake = (2^20) + 1;
+ int pid = fake++;
+ inprogress.pid = pid;
+ inprogress.command = command;
+ in_progress_[pid] = inprogress;
+ finishedGenerating(pid, ret);
+ return;
+ }