lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ANN: Pygments support for LilyPond


From: Jean Abou Samra
Subject: Re: ANN: Pygments support for LilyPond
Date: Mon, 22 Nov 2021 15:14:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1

Le 22/11/2021 à 09:35, Werner LEMBERG a écrit :
So the next step now would be adding syntax highlighting to the
documentation.  I've managed a prototype for HTML fairly easily, and
Info doesn't know about colors, so that's easy.
Good.  I'm all for colours :-)

What about PDF, however?  Texinfo itself doesn't seem to have
commands for changing colors.  The packages that I could find
(color, xcolor, fancyvrb) were all for LaTeX, not plain TeX.  What
do the Texinfo and TeX experts in the room (looking at Werner and
David) think about the issue?  Is there a way to get highlighting in
PDF without too much pain?  Is it even desirable from a stylistic
point of view?
My point of view is that for printing, color is probably not the best
choice.  However, for viewing PDFs online (as probably most PDF users
do, including me), I would really like to have colour support in code
listings.

Looking into `texinfo.tex` I was surprised to see that PDF output
seems to already have generic colour support (using the not officially
documented TeX macro `@setcolor{r g b}`).


Good to know, thanks for looking at it!


However, it would be
necessary to define a special version of the `@verbatim` environment
(similar to LaTeX's `minted` environment) that recognizes color
changes.  This is certainly doable and probably not too difficult, but
I currently have other things to do.  Maybe it's best to open an
issue.

Well, we usually use @example rather than @verbatim
in the documentation because it is indented in PDF,
and much more nicely formatted in HTML (see
https://lilypond.org/doc/v2.22/Documentation/notation/table-of-contents
for an ugly page using @verbatim). However, trying
to use @setcolor or @pdfsetcolor in @example, I
fail to get it to work: using TeX, the color command
outright wipes everything following it in the document,
and using XeTeX (with PDFTEX=xetex texi2pdf ...) it doesn't
wipe but doesn't show any effect either. Any thoughts
about that? Is there a way to fix it?

Thanks,
Jean



reply via email to

[Prev in Thread] Current Thread [Next in Thread]