From 1348aa03d794647d7fda9ff2491ad2448d41f012 Mon Sep 17 00:00:00 2001 From: Julien Rioux Date: Thu, 24 Mar 2011 18:37:17 +0000 Subject: [PATCH] fix instant preview with lilypond module and pdf output git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38028 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/scripts/lyxpreview-lytex2bitmap.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/scripts/lyxpreview-lytex2bitmap.py b/lib/scripts/lyxpreview-lytex2bitmap.py index e7c873a01a..96c70ca15e 100755 --- a/lib/scripts/lyxpreview-lytex2bitmap.py +++ b/lib/scripts/lyxpreview-lytex2bitmap.py @@ -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" \ -- 2.39.5