]> git.lyx.org Git - lyx.git/commitdiff
fix instant preview with lilypond module and pdf output
authorJulien Rioux <jrioux@lyx.org>
Thu, 24 Mar 2011 18:37:17 +0000 (18:37 +0000)
committerJulien Rioux <jrioux@lyx.org>
Thu, 24 Mar 2011 18:37:17 +0000 (18:37 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38028 a592a061-630c-0410-9148-cb99ea01b6c8

lib/scripts/lyxpreview-lytex2bitmap.py

index e7c873a01aa80c321195a10b773e04a9650c8644..96c70ca15e990db010174b032a259f4ae1d535dc 100755 (executable)
@@ -189,8 +189,14 @@ def main(argv):
     lytex_file = latex_file_re.sub(".lytex", latex_file)
     shutil.copyfile(latex_file, lytex_file)
 
+    # Determine whether we need pdf or eps output
+    pdf_output = latex in ["lualatex", "pdflatex", "xelatex"]
+
     # Preprocess the latex file through lilypond-book.
-    lytex_call = '%s --safe --latex-program=%s "%s"' % (lilypond_book, latex, lytex_file)
+    if pdf_output:
+        lytex_call = '%s --safe --pdf --latex-program=%s "%s"' % (lilypond_book, latex, lytex_file)
+    else:
+        lytex_call = '%s --safe --latex-program=%s "%s"' % (lilypond_book, latex, lytex_file)
     lytex_status, lytex_stdout = run_command(lytex_call)
     if lytex_status != None:
         warning("%s failed to compile %s" \