- ColorCode const bg = buffer_.isExporting()
- ? Color_white : PreviewLoader::backgroundColor();
- ColorCode const fg = buffer_.isExporting()
- ? Color_black : PreviewLoader::foregroundColor();
- // The conversion command.
- ostringstream cs;
- cs << pconverter_->command << ' ' << pconverter_->to << ' '
- << quoteName(latexfile.toFilesystemEncoding()) << ' '
- << int(font_scaling_factor) << ' '
- << theApp()->hexName(fg) << ' '
- << theApp()->hexName(bg);
- if (buffer_.bufferFormat() == "xetex")
- cs << " xelatex";
+ if (!buffer_.isExporting()) {
+ ColorCode const fg = PreviewLoader::foregroundColor();
+ ColorCode const bg = PreviewLoader::backgroundColor();
+ cs << " --fg " << theApp()->hexName(fg)
+ << " --bg " << theApp()->hexName(bg);
+ }
+
+ // 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";