Karl and Alexender, thank you very much for the contribution. I'm not an
EMACS or VIM user, but it still is useful information.
Valentin, and everyone who might be intrigued, I would appreciate some help
with regards to the .tex file.... I've added the lyluatex package,
specified the magic command for the compiler (% !TeX program = lualatex)
and have run the command as instructed by the lyluatex's documentation
(lualatex --shell-escape).
The compiler throws errors of "The score doesn't contain any music", even
using the "nofragment" argument of the package's call.
Any help would be appreciated!
Em dom., 11 de mai. de 2025 às 05:12, Valentin Petzel <valen...@petzel.at>
escreveu:
> > Hello! I'm starting a task that requires LaTeX, so I've decided to use
> the
> > lilypond-book. I've managed to successfully use the command and compile
> all
> > examples shown in the learning material. Now, I've found myself in a
> tricky
> > spot: I'd like to use a Tex editor directly on the .lytex file to reduce
> > steps, especially when hopping between the editor, the shell terminal and
> > the PDF output. Do you guys have an editor to recommend, or an effective
> > process you have developed?
> >
> > Many thanks,
> > Lucas
>
> Hello Lucas,
>
> You could instead try using LuaLaTeX which has a native package by Jacques
> Peron and Urs Liska called `lyluatex`. This would allow you to work
> directly
> in TeX environment with the stuff `lilypond-book` would do instead being
> done
> in a lua extension.
>
> Else any TeX-Editor that allows setting a custom TeX command should be
> fine.
>
> Cheers,
> Tina
This is LuaHBTeX, Version 1.18.2 (MiKTeX 24.12) (format=lualatex 2025.5.11) 11 MAY 2025 10:17
system commands enabled.
**test.tex
(./test.tex
LaTeX2e <2024-11-01> patch level 2
L3 programming layer <2025-01-18>
Lua module: luaotfload 2024-12-03 v3.29 Lua based OpenType font support
Lua module: lualibs 2023-07-13 v2.76 ConTeXt Lua standard libraries.
Lua module: lualibs-extended 2023-07-13 v2.76 ConTeXt Lua libraries -- extended
collection.
luaotfload | conf : Root cache directory is "/home/lucas/.miktex/texmfs/data/lua
tex-cache/generic/names".
luaotfload | init : Loading fontloader "fontloader-2023-12-28.lua" from kpse-res
olved path "/home/lucas/.miktex/texmfs/install/tex/luatex/luaotfload/fontloader-
2023-12-28.lua".
Lua-only attribute luaotfload@noligature = 1
luaotfload | init : Context OpenType loader version 3.134
Inserting `luaotfload.node_processor' in `pre_linebreak_filter'.
Inserting `luaotfload.node_processor' in `hpack_filter'.
Inserting `luaotfload.glyph_stream' in `glyph_stream_provider'.
Inserting `luaotfload.define_font' in `define_font'.
Lua-only attribute luaotfload_color_attribute = 2
luaotfload | conf : Root cache directory is "/home/lucas/.miktex/texmfs/data/lua
tex-cache/generic/names".
Inserting `luaotfload.harf.strip_prefix' in `find_opentype_file'.
Inserting `luaotfload.harf.strip_prefix' in `find_truetype_file'.
Removing `luaotfload.glyph_stream' from `glyph_stream_provider'.
Inserting `luaotfload.harf.glyphstream' in `glyph_stream_provider'.
Inserting `luaotfload.harf.finalize_vlist' in `post_linebreak_filter'.
Inserting `luaotfload.harf.finalize_hlist' in `hpack_filter'.
Inserting `luaotfload.cleanup_files' in `wrapup_run'.
Inserting `luaotfload.harf.finalize_unicode' in `finish_pdffile'.
Inserting `luaotfload.glyphinfo' in `glyph_info'.
Lua-only attribute luaotfload.letterspace_done = 3
Inserting `luaotfload.aux.set_sscale_dimens' in `luaotfload.patch_font'.
Inserting `luaotfload.aux.set_font_index' in `luaotfload.patch_font'.
Inserting `luaotfload.aux.patch_cambria_domh' in `luaotfload.patch_font'.
Inserting `luaotfload.aux.fixup_fontdata' in `luaotfload.patch_font_unsafe'.
Inserting `luaotfload.aux.set_capheight' in `luaotfload.patch_font'.
Inserting `luaotfload.aux.set_xheight' in `luaotfload.patch_font'.
Inserting `luaotfload.rewrite_fontname' in `luaotfload.patch_font'.
Inserting `tracingstacklevels' in `input_level_string'. (/home/lucas/.miktex/te
xmfs/install/tex/latex/base/article.cls
Document Class: article 2024/06/29 v1.4n Standard LaTeX document class
(/home/lucas/.miktex/texmfs/install/tex/latex/base/size10.clo
File: size10.clo 2024/06/29 v1.4n Standard LaTeX file (size option)
luaotfload | db : Font names database loaded from /home/lucas/.miktex/texmfs/dat
a/luatex-cache/generic/names/luaotfload-names.luc.gz)
\c@part=\count194
\c@section=\count195
\c@subsection=\count196
\c@subsubsection=\count197
\c@paragraph=\count198
\c@subparagraph=\count199
\c@figure=\count266
\c@table=\count267
\abovecaptionskip=\skip49
\belowcaptionskip=\skip50
\bibindent=\dimen140
)
(/home/lucas/.miktex/texmfs/install/tex/lualatex/lyluatex/lyluatex.sty
Package: lyluatex 2023/04/18 v1.1.5
(/home/lucas/.miktex/texmfs/install/tex/latex/graphics/graphicx.sty
Package: graphicx 2021/09/16 v1.2d Enhanced LaTeX Graphics (DPC,SPQR)
(/home/lucas/.miktex/texmfs/install/tex/latex/graphics/keyval.sty
Package: keyval 2022/05/29 v1.15 key=value parser (DPC)
\KV@toks@=\toks17
)
(/home/lucas/.miktex/texmfs/install/tex/latex/graphics/graphics.sty
Package: graphics 2024/08/06 v1.4g Standard LaTeX Graphics (DPC,SPQR)
(/home/lucas/.miktex/texmfs/install/tex/latex/graphics/trig.sty
Package: trig 2023/12/02 v1.11 sin cos tan (DPC)
)
(/home/lucas/.miktex/texmfs/install/tex/latex/graphics-cfg/graphics.cfg
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: luatex.def on input line 106.
(/home/lucas/.miktex/texmfs/install/tex/latex/graphics-def/luatex.def
File: luatex.def 2024/04/13 v1.2e Graphics/color driver for luatex
))
\Gin@req@height=\dimen141
\Gin@req@width=\dimen142
)
(/home/lucas/.miktex/texmfs/install/tex/latex/minibox/minibox.sty
(/home/lucas/.miktex/texmfs/install/tex/latex/l3kernel/expl3.sty
Package: expl3 2025-01-18 L3 programming layer (loader)
(/home/lucas/.miktex/texmfs/install/tex/latex/l3backend/l3backend-luatex.def
File: l3backend-luatex.def 2024-05-08 L3 backend support: PDF output (LuaTeX)
\l__color_backend_stack_int=\count268
Inserting `l3color' in `luaotfload.parse_color'.
\l__pdf_internal_box=\box52
))
Package: minibox 2013/06/21 v0.2a Another type of box.
\l_minibox_rule_dim=\dimen143
\l_minibox_pad_dim=\dimen144
) (/home/lucas/.miktex/texmfs/install/tex/latex/environ/environ.sty
Package: environ 2014/05/04 v0.3 A new way to define environments
(/home/lucas/.miktex/texmfs/install/tex/latex/trimspaces/trimspaces.sty
Package: trimspaces 2009/09/17 v1.1 Trim spaces around a token list
)
\@envbody=\toks18
)
(/home/lucas/.miktex/texmfs/install/tex/latex/currfile/currfile.sty
Package: currfile 2024/03/14 v1.0 Provides the file path elements of the curren
t input file
(/home/lucas/.miktex/texmfs/install/tex/latex/kvoptions/kvoptions.sty
Package: kvoptions 2022-06-15 v3.15 Key value format for package options (HO)
(/home/lucas/.miktex/texmfs/install/tex/generic/ltxcmds/ltxcmds.sty
Package: ltxcmds 2023-12-04 v1.26 LaTeX kernel commands for general use (HO)
)
(/home/lucas/.miktex/texmfs/install/tex/latex/kvsetkeys/kvsetkeys.sty
Package: kvsetkeys 2022-10-05 v1.19 Key value parser (HO)
))
(/home/lucas/.miktex/texmfs/install/tex/latex/filehook/filehook.sty
Package: filehook 2022/10/25 v0.8b Hooks for input files
(/home/lucas/.miktex/texmfs/install/tex/latex/filehook/filehook-2020.sty
Package: filehook-2020 2022/10/25 v0.8b Hooks for input files
))
\c@currfiledepth=\count269
)
(/home/lucas/.miktex/texmfs/install/tex/latex/pdfpages/pdfpages.sty
Package: pdfpages 2025/01/30 v0.6e Insert pages of external PDF documents (AM)
(/home/lucas/.miktex/texmfs/install/tex/latex/base/ifthen.sty
Package: ifthen 2024/03/16 v1.1e Standard LaTeX ifthen package (DPC)
)
(/home/lucas/.miktex/texmfs/install/tex/latex/tools/calc.sty
Package: calc 2023/07/08 v4.3 Infix arithmetic (KKT,FJ)
\calc@Acount=\count270
\calc@Bcount=\count271
\calc@Adimen=\dimen145
\calc@Bdimen=\dimen146
\calc@Askip=\skip51
\calc@Bskip=\skip52
LaTeX Info: Redefining \setlength on input line 80.
LaTeX Info: Redefining \addtolength on input line 81.
\calc@Ccount=\count272
\calc@Cskip=\skip53
)
(/home/lucas/.miktex/texmfs/install/tex/latex/eso-pic/eso-pic.sty
Package: eso-pic 2023/05/03 v3.0c eso-pic (RN)
\ESO@tempdima=\dimen147
\ESO@tempdimb=\dimen148
(/home/lucas/.miktex/texmfs/install/tex/latex/xcolor/xcolor.sty
Package: xcolor 2024/09/29 v3.02 LaTeX color extensions (UK)
(/home/lucas/.miktex/texmfs/install/tex/latex/graphics-cfg/color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package xcolor Info: Driver file: luatex.def on input line 274.
(/home/lucas/.miktex/texmfs/install/tex/latex/graphics/mathcolor.ltx)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1349.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1353.
Package xcolor Info: Model `RGB' extended on input line 1365.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1367.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1368.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1369.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1370.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1371.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1372.
))
(/home/lucas/.miktex/texmfs/install/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2025/02/11 v2.5l e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count273
)
\AM@pagewidth=\dimen149
\AM@pageheight=\dimen150
\AM@fboxrule=\dimen151
(/home/lucas/.miktex/texmfs/install/tex/latex/pdfpages/ppluatex.def
File: ppluatex.def 2025/01/30 v0.6e Pdfpages driver for LuaTeX (AM)
)
\pdfpages@includegraphics@status=\count274
\AM@pagebox=\box53
\AM@global@opts=\toks19
\AM@pagecnt=\count275
\AM@toc@title=\toks20
\AM@lof@heading=\toks21
\c@AM@survey=\count276
\AM@templatesizebox=\box54
)
(/home/lucas/.miktex/texmfs/install/tex/latex/varwidth/varwidth.sty
Package: varwidth 2009/03/30 ver 0.92; Variable-width minipages
\@vwid@box=\box55
\sift@deathcycles=\count277
\@vwid@loff=\dimen152
\@vwid@roff=\dimen153
)
(/home/lucas/.miktex/texmfs/install/tex/lualatex/luaoptions/luaoptions.sty
Package: luaoptions 2022/10/30 v0.8
(/home/lucas/.miktex/texmfs/install/tex/luatex/luatexbase/luatexbase.sty
Package: luatexbase 2015/10/04 v1.3 luatexbase interface to LuaTeX
(/home/lucas/.miktex/texmfs/install/tex/luatex/ctablestack/ctablestack.sty
Package: ctablestack 2015/10/01 v1.0 Catcode table stable support
\@catcodetablestackcnt=\count278
)
\CatcodeTableOther=\catcodetable14
\CatcodeTableExpl=\catcodetable15
)
(/home/lucas/.miktex/texmfs/install/tex/latex/xkeyval/xkeyval.sty
Package: xkeyval 2022/06/16 v2.9 package option processing (HA)
(/home/lucas/.miktex/texmfs/install/tex/generic/xkeyval/xkeyval.tex
(/home/lucas/.miktex/texmfs/install/tex/generic/xkeyval/xkvutils.tex
\XKV@toks=\toks22
\XKV@tempa@toks=\toks23
)
\XKV@depth=\count279
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
))
Lua module: luaoptions 2022/10/30 v0.8 Module luaoptions.
Lua module: luaoptions-lib 2022/10/30 v0.8 Module luaoptions-lib.)
(/home/lucas/.miktex/texmfs/install/tex/latex/metalogo/metalogo.sty
Package: metalogo 2010/05/29 v0.12 Extended TeX logo macros
(/home/lucas/.miktex/texmfs/install/tex/generic/iftex/ifxetex.sty
Package: ifxetex 2019/10/25 v0.7 ifxetex legacy package. Use iftex instead.
(/home/lucas/.miktex/texmfs/install/tex/generic/iftex/iftex.sty
Package: iftex 2024/12/12 v1.0g TeX engine tests
))
\xl@everylogo=\toks24
\xl@@everylogo=\toks25
LaTeX Info: Redefining \TeX on input line 193.
LaTeX Info: Redefining \LaTeX on input line 202.
LaTeX Info: Redefining \LaTeXe on input line 219.
)
Lua module: lyluatex 2023/04/18 v1.1.5 Module lyluatex.) (./test.aux)
\openout1 = test.aux
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
(/home/lucas/.miktex/texmfs/install/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count280
\scratchdimen=\dimen154
\scratchbox=\box56
\nofMPsegments=\count281
\nofMParguments=\count282
\everyMPshowfont=\toks26
\MPscratchCnt=\count283
\MPscratchDim=\dimen155
\MPnumerator=\count284
\makeMPintoPDFobject=\count285
\everyMPtoPDFconversion=\toks27
) (/home/lucas/.miktex/texmfs/install/tex/latex/epstopdf-pkg/epstopdf-base.sty
Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
85.
(/home/lucas/.miktex/texmfs/install/tex/latex/00miktex/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2021/03/18 v2.0 Configuration of epstopdf for MiKTeX
))
(/home/lucas/.miktex/texmfs/install/tex/latex/pdflscape/pdflscape.sty
Package: pdflscape 2022-10-27 v0.13 Display of landscape pages in PDF
(/home/lucas/.miktex/texmfs/install/tex/latex/pdflscape/pdflscape-nometadata.st
y
Package: pdflscape-nometadata 2022-10-28 v0.13 Display of landscape pages in PD
F (HO)
(/home/lucas/.miktex/texmfs/install/tex/latex/graphics/lscape.sty
Package: lscape 2020/05/28 v3.02 Landscape Pages (DPC)
)
Package pdflscape Info: Auto-detected driver: pdftex on input line 81.
))
Inserting `readline' in `process_input_buffer'.
Removing `readline' from `process_input_buffer'.
Module lyluatex Info: Compiling score tmp-ly/96d258f1d0b184738c2c9ba6a3092b15 wi
th LilyPond executable '/usr/bin/lilypond'. on input line 13
Module lyluatex Warning: The score doesn't contain any music:
(lyluatex) this will probably cause bad output. on input line 13
...lucas/.miktex/texmfs/install/tex/latex/base/ltluatex.lua:109:
Module lyluatex Error:
(lyluatex) LilyPond failed to compile the score.
(lyluatex) Please check the log file
(lyluatex) and the generated LilyPond code in
(lyluatex) tmp-ly/96d258f1d0b184738c2c9ba6a3092b15.log
(lyluatex) tmp-ly/96d258f1d0b184738c2c9ba6a3092b15.ly
(lyluatex)
(lyluatex) As the input code has been automatically wrapped
(lyluatex) with a music expression, you may try repeating
(lyluatex) with the `nofragment` option.
(lyluatex) on input line 13
stack traceback:
[C]: in function 'error'
...lucas/.miktex/texmfs/install/tex/latex/base/ltluatex.lua:109: in function <.
..lucas/.miktex/texmfs/install/tex/latex/base/ltluatex.lua:108>
(...tail calls...)
...cas/.miktex/texmfs/install/scripts/lyluatex/lyluatex.lua:561: in method 'che
ck_compilation'
...cas/.miktex/texmfs/install/scripts/lyluatex/lyluatex.lua:1209: in method 'wr
ite_latex'
...cas/.miktex/texmfs/install/scripts/lyluatex/lyluatex.lua:1133: in method 'pr
ocess'
[\directlua]:1: in main chunk.
\ly@compilescore ...directlua {ly.score:process()}
l.13 \end{lilypond}
?
Underfull \hbox (badness 10000) in paragraph at lines 13--14
[]
[1
{/home/lucas/.miktex/texmfs/data/fonts/map/pdftex/pdftex.map}] (./test.aux)
***********
LaTeX2e <2024-11-01> patch level 2
L3 programming layer <2025-01-18>
***********
)
Here is how much of LuaTeX's memory you used:
4551 strings out of 475526
100000,662416 words of node,token memory allocated
416 words of node memory still in use:
3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 4 attribute, 50 glue_spec,
4 attribute_list, 1 write nodes
avail lists: 2:58,3:12,4:10,5:44,6:6,7:264,9:46,11:2
27429 multiletter control sequences out of 65536+600000
17 fonts using 981207 bytes
85i,5n,89p,1621b,126s stack positions out of 10000i,1000n,20000p,200000b,200000s
</home/lucas/.miktex/texmfs/install/fonts/opentype/public/lm/lmmono10-regular.ot
f></home/lucas/.miktex/texmfs/install/fonts/opentype/public/lm/lmroman10-regular
.otf>
Output written on test.pdf (1 page, 8623 bytes).
PDF statistics: 20 PDF objects out of 1000 (max. 8388607)
0 named destinations out of 1000 (max. 131072)
1 words of extra memory for PDF output out of 10000 (max. 100000000)
% !TeX program = lualatex
\documentclass[a4paper]{article}
\usepackage[program=/usr/bin/lilypond]{lyluatex}
\begin{document}
Documents for \verb+lilypond-book+ may freely mix music and text.
For example,
\begin{lilypond}
\relative {
c'2 e2 \tuplet 3/2 { f8 a b } a2 e4
}
\end{lilypond}
Options are put in brackets.
\end{document}
%%File header
\version "2.18.2"
#(define inside-lyluatex #t)
#(set-global-staff-size 16.666666666667)
#(set! paper-alist (cons '("lyluatexfmt" . (cons (* 597.507874 pt) (* 845.046844 pt))) paper-alist))
\include "lilypond-book-preamble.ly"
\header {
copyright = ""
tagline = ##f
}
\paper{
#(set-paper-size "lyluatexfmt")
two-sided = ##f
line-width = 345.0\pt
indent = 0\pt
% no alignment set
% fonts not set
}
\layout{
% no clef set
% timing not suppressed
% no time signature set
% staff symbol not suppressed
% no fix for badly cropped StaffGroup brackets
}
%%Follows original score
{\relative {
c'2 e2 \tuplet 3/2 { f8 a b } a2 e4
}}
/bin/sh: -c: line 1: unexpected EOF while looking for matching `"'