Compare commits

...

2 Commits

Author SHA1 Message Date
Juergen Spitzmueller
2051bfed43 Amend 770362da97
preview needs proper --lily-output-dir

(cherry picked from commit 135889c634)
2024-09-29 18:23:50 +02:00
Juergen Spitzmueller
86ba8bb7ed Fix preview of lilypond (book) snippets (#13103)
1. The --safe option has been removed with lilypond 2.24 and causes
   the program to error out
2. We default to PDF output (and pdflatex) if no program is explicitly
   given, since latex generates *.eps snippets which fail to convert
   on many recent systems due to security measures

(cherry picked from commit 770362da97)
2024-09-29 18:21:37 +02:00
2 changed files with 11 additions and 1 deletions

View File

@ -412,7 +412,11 @@ def main(argv):
bibtex = find_exe(bibtex or bibtex_commands)
if lilypond:
lilypond_book = find_exe_or_terminate(lilypond_book or
["lilypond-book --safe"])
["lilypond-book"])
if lilypond_book and latex == "latex":
# with lilypond, we default to pdflatex rather than latex
# as we do not want to deal with eps conversion (see #13103)
latex = "pdflatex"
# These flavors of latex are known to produce pdf output
pdf_output = latex in pdflatex_commands
@ -433,6 +437,10 @@ def main(argv):
if pdf_output:
lilypond_book += " --pdf"
lilypond_book += " --latex-program=%s" % latex.split()[0]
if pdf_output:
lilypond_book += " --lily-output-dir=ly-pdf"
else:
lilypond_book += " --lily-output-dir=ly-eps"
# Make a copy of the latex file
lytex_file = latex_file_re.sub(".lytex", latex_file)

View File

@ -55,6 +55,8 @@ What's new
- Work around bug in aa.cls in the "Astronomy & Astrophysics" template
and example documents.
- Fix instant preview of lilypond snippets (bug 13103).
* USER INTERFACE