(with apologies for the digression on a previous thread[1])
I have now succeeded in getting lyLuaTex[2][3] working, and this posting seems
as good a place as any to record the steps, in case anyone else might find it
helpful. This is a summary of a moderately painful learning curve, full of
interruptions and blind alleys, so I hope I've captured the result properly
(modulo any spurious linebreaks introduced in the email chain)...
My environment:
Ubuntu Linux 18.04
Lilypond 2.23.10 (I think this procedure should work for more up-to-date
versions)
Texlive packages from Ubuntu (of which most are almost certainly unnecessary
for this purpose, but never mind): texlive-base, texlive-binaries,
texlive-extra-utils, texlive-font-utils, texlive-fonts-recommended,
texlive-lang-english, texlive-latex-base, texlive-latex-extra,
texlive-latex-recommended, texlive-luatex, texlive-music, texlive-pictures,
texlive-plain-generic, texlive-pstricks.
Editor: TeXstudio 2.12.6 (my choice; yours may differ)
Install some luaTex extension packages:
mkdir -p ~/texmf/tex/latex
cd ~/texmf/tex/latex
git clone https://github.com/lualatex-tools/luaoptions
<https://github.com/lualatex-tools/luaoptions>
git clone https://github.com/jperon/luatex-tools
<https://github.com/jperon/luatex-tools>
texhash ~/texmf
Create a wrapper script to suppress TeXstudio complaints about $TERM [4]:
cat > ~/bin/lualatex-wrapper <<-EOF
#! /bin/bash
# Don't indent the previous line!
# Wrapper script for luatex invoked from TeXstudio.
TERM=dumb /usr/bin/lualatex "$@"
EOF
chmod 755 ~/bin/lualatex-wrapper
In TeXstudio, select <Options><Configure TeXstudio>:
In the commands tab:
LuaLaTeX: /home/yourusername/bin/lualatex-wrapper -synctex=1
-interaction=nonstopmode -shell-escape %.tex
Note that the -shell-escape option opens a security hole if you are going to
compile latex docs from dodgy sources. I don't judge ;)
In the build tab:
Default compiler: txs:///lualatex
Now we should be ready to compile a fairly minimal example document:
\documentclass{article}
% Adjust the program path to match your installation:
\usepackage[program=/usr/local/lilypond/lilypond-2.23.10/bin/lilypond]{lyluatex}
\begin{document}
Here is an example:
\begin{ly}
{a' b' c''}
\addlyrics{a -- b -- c}
\end{ly}
And here is a fragment, \lilypond{\new RhythmicStaff { \time 3/4 c4( c16) c c c
c c c c \bar "|."}} inserted inline.
\end{document}
(Remember to use <Tools><Build and View(F5)> if you want to see the updated PDF)
HTH. Grateful thanks to all the contributors listed at [2].
-- Graham
References:
[1] https://lists.gnu.org/archive/html/lilypond-user/2022-11/msg00403.html
<https://lists.gnu.org/archive/html/lilypond-user/2022-11/msg00403.html>
[2] https://github.com/jperon/lyluatex <https://github.com/jperon/lyluatex>
[3] https://mirror.ox.ac.uk/sites/ctan.org/support/lyluatex/lyluatex.pdf
<https://mirror.ox.ac.uk/sites/ctan.org/support/lyluatex/lyluatex.pdf>
[4]
https://htmlpreview.github.io/?https://github.com/texstudio-org/texstudio/master/utilities/manual/usermanual_en.html#configuring-the-latex-related-commands