- cs << pconverter_->command << ' ' << pconverter_->to << ' '
- << quoteName(latexfile.toFilesystemEncoding()) << ' '
- << int(font_scaling_factor) << ' '
- << theApp()->hexName(PreviewLoader::foregroundColor()) << ' '
- << theApp()->hexName(PreviewLoader::backgroundColor());
+ cs << pconverter_->command
+ << " " << quoteName(latexfile.toFilesystemEncoding())
+ << " --dpi " << int(font_scaling_factor);
+
+ // FIXME XHTML
+ // The colors should be customizable.
+ 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";