The argument of a LilyPond command is copied to the output file and enclosed in a verbatim block
From the docs:
The argument of a LilyPond command is copied to the output file and enclosed in a verbatim block, followed by any text given with the intertext option (not implemented yet); then the actual music is displayed. This option does not work well with \lilypond{} if it is part of a paragraph.
If verbatim is used in a lilypondfile command, it is possible to enclose verbatim only a part of the source file. If the source file contain a comment containing ‘begin verbatim’ (without quotes), quoting the source in the verbatim block will start after the last occurrence of such a comment; similarly, quoting the source verbatim will stop just before the first occurrence of a comment containing ‘end verbatim’, if there is any. In the following source file example, the music will be interpreted in relative mode, but the verbatim quote will not show the relative block, i.e.
[x] produce verbatim block
(partially implemented, but code from fragments is reduced to a single line)
[x] intertext
(not implemented in lilypond-book, but we can of course do it)
[x] begin verbatim
This is probably implemented in e3cd2951 but I'm not 100% sure
We only look for the exact match % begin verbatim and not anybegin verbatim in a comment.
At least any amount of whitespace between the % and the begin is matched.
[x] If possible at all it should be enhanced by providing syntax highlighting
I think about detecting a loaded package such as lstlistings or minted.
Optionally (long-term) we could have a package that interacts with python-ly to produce "real" highlighting (better than what Pygments knows about LilyPond). We should then borrow from Pandoc's highlighting (Shaded environment).
For my personal use-case I must admit I'd be fine with not implementing this in lyluatex but take care of that in a Pandoc filter. This would not pass the verbatim option to LaTeX but insert the verbatim block directly because Pandoc already produces fine syntax highlighting.
The argument of a LilyPond command is copied to the output file and enclosed in a verbatim block
From the docs:
(partially implemented, but code from fragments is reduced to a single line)
intertext
(not implemented in lilypond-book, but we can of course do it)
begin verbatim
This is probably implemented in e3cd2951 but I'm not 100% sure
We only look for the exact match
% begin verbatim
and not anybegin verbatim
in a comment.At least any amount of whitespace between the
%
and thebegin
is matched.I think about detecting a loaded package such as lstlistings or minted.
Optionally (long-term) we could have a package that interacts with
python-ly
to produce "real" highlighting (better than what Pygments knows about LilyPond). We should then borrow from Pandoc's highlighting (Shaded
environment).For my personal use-case I must admit I'd be fine with not implementing this in
lyluatex
but take care of that in a Pandoc filter. This would not pass the verbatim option to LaTeX but insert the verbatim block directly because Pandoc already produces fine syntax highlighting.