> 
> Which version of lilypond do you have in /opt/homebrew/bin/lilypond ?


I have 2.24.4 in that folder. I also use macOS Sonoma 14.8.3. 

Update: I just updated LilyPond to 2.26.0 via homebrew. Just as I initially 
made TeXShop and LilyPond run on my computer, I had to do a few additional 
work. Specifically, steps 1-3 of this thread:

https://lists.gnu.org/archive/html/lilypond-user/2007-04/msg00319.html

Essentially, I had to create via a text editor a file called “LilyPond.engine” 
in /Library/TeXShop/Engines where you put the following code (I did take this 
code from somewhere on GitHub or very possibly when the former LilyPond 
Snippets Repository was still active and running:

> #!/bin/tcsh
> 
> # Version 2.1.0b
> # Author: Nicola Vitacolonna ([email protected])
> 
> # Uncomment the following to debug:
> #set echo
> #set verbose
> 
> set lilypondfolder = ADDRESS  # Custom LilyPond folder
> set path = ($path /opt/homebrew/Cellar/lilypond/2.26.0/bin)
> set path = ($path /usr/local/bin)
> set path = ($path /opt/local/bin)
> set path = ($path /sw/bin)
> if ( $?lilypondfolder ) then
> set path = ($path /opt/homebrew/Cellar/lilypond/2.26.0/bin)
> endif
> echo "Feeding $1 to lilypond... Please wait...";
> lilypond "$1"                      # With "point-and-click"
> #lilypond -dno-point-and-click "$1"  # Without "point-and-click"
> echo "Finished."

When I updated the LilyPond via Homebrew just now, this .engine file thought to 
look for version 2.24.4, but of course it was gone. So I had to update the file 
path accordingly as above.

For ADDRESS, replace that with a folder of your choice. When compiling a 
LilyPond code on TeXShop, it will create some temporary files.

Then, when I choose “LilyPond” as an engine to typeset, it will call the 
Homebrew-installed lilypond, given the LilyPond file in question has the 
following at the beginning of the file:

% !TEX TS-program = LilyPond

I hope this helps somehow!

Yoshi


 
-- -- --
Yoshiaki Onishi
https://github.com/yoshiakionishi/lilypond-snippets





> On May 6, 2026, at 14:22, David Wright <[email protected]> wrote:
> 
> On Sun 03 May 2026 at 23:10:33 (-0400), Yoshiaki Onishi wrote:
>> I use TeXShop to prepare documents on LaTeX and I often combine LilyPond and 
>> LaTeX together, as well. 
>> 
>> Of the code David provided, I was able to make it work with a slight tweak, 
>> i.e. to add the location of the LilyPond in the \usepackage{lyluatex} as 
>> follows:
>> 
>> \usepackage[program=/opt/homebrew/bin/lilypond]{lyluatex}
>> 
>> That is, to add square brackets in which the pathname to LilyPond is 
>> preceded by “program=“
>> 
>> I don’t know if TeXShop and TeXLive behave fundamentally differently, but it 
>> might be worth a try.
> 
> Which version of lilypond do you have in /opt/homebrew/bin/lilypond ?
> 
> Running   lualatex --shell-escape lytest.ly   on Debian, with
> downloaded lilypond versions specified as shown in [program=…] here:
> 
>  \documentclass{article}
>  \usepackage[program=/home/auser/lilypond.2.18.2.1/bin/lilypond]{lyluatex}
>  \begin{document}
>  Hi!
>  \begin{lilypond}
>    {c' c'}
>  \end{lilypond}
>  \end{document}
> 
> or with Debian installed versions (omitting [program=…]), ie versions
> 2.22.0-10 (Debian bullseye), 2.24.1-2 (bookworm), and 2.24.4-5
> (trixie), I get successful output in all versions up to 2.24.1-2.
> However, versions 2.24.4 and 2.26.0 result in the process stalling
> at the point where one sees, or would expect to see:
> 
>  (lyluatex) Compiling score tmp-ly/123…456 with LilyPond executable 
> '/home/auser/lilypond.2.24.4/bin/lilypond'.
> 
> The failing lualatex process runs one core at 100% and has to be killed.
> 
> I don't think that the problem is caused by increasing hardening of
> the OS because the oldest OS (bullseye), which one would suppose to
> be the least hardened, still fails with downloaded 2.24.4 and 2.26.0,
> yet the newest (trixie), most hardened, succeeds with downloaded
> 2.18.2; but I am guessing here.
> 
> A failing run leaves behind four files: ./lytest.aux, ./lytest.log
> (both these look as expected), $TMP/lilypond-tmp-987…, and
> ./tmp-ly/123…456.pdf. The last two are a PostScript full-page
> rendition of the lilypond score and the equivalent PDF file
> generated from it. As the PDF's version is 1.4, I don't think
> https://github.com/jperon/lyluatex/issues/301 applies.
> 
> So for the time being, I shall continue to produce mixed text
> and scores using independent LP runs to produce cropped PDFs
> of individual score fragments, followed by a pdflatex run to
> set the text, placing the PDFs with \includegraphics.
> 
> (An aside to Ivan Kuznetsov: PDFs avoid the loss of resolution
> caused by PNGs being rasterised.)
> 
> Cheers,
> David.


Reply via email to