gnu-music-discuss
[Top][All Lists]

## Arbitrary TeX in lilypond - suggestion

 From: Silas S. Brown Subject: Arbitrary TeX in lilypond - suggestion Date: Wed, 20 Feb 2002 23:32:30 +0000

Hi,

Firstly, I'm very sorry for my arrogant and uninformed
criticism on this list several years ago.

Secondly, I noticed a comment on the web pages (sorry I've
lost the exact reference) that arbitrary TeX can be included
in lilypond, but it's unadvisable because the typesetting
engine then doesn't know how big it will be and hence can't
avoid collisions etc.

There are many instances where you might want arbitrary TeX
or LaTeX, especially in the lyrics.  For example, I want to
put Chinese characters in the lyrics, and also PinYin (a
method of romanising Chinese that requires unusual ways of
typesetting accents).

To support this better, why not get LaTeX to tell you how
big the "arbitrary LaTeX" boxes are going to be?  There are
two ways of doing this - according to the TeXbook, you can
get TeX to print out the metrics of an hbox.  Also you could
use the method employed by latex2html to generate images;
this utility manages to generate all the images while
running LaTeX only once, and they are all cropped correctly.

So basically the idea is -

1.  Extract all the "arbitrary TeX" parts, put them into
a single file, and run LaTeX to calculate their metrics.

2.  Do the typesetting, taking the above metrics into
account for avoiding collisions.

3.  Run LaTeX again on the result.

If you want to use latex2html, you can use \begin{makeimage}
and \end{makeimage} to show where each "arbitrary TeX"
fragment starts and ends, then run latex2html -no_reuse
-no_antialias_text, then inspect the images to see what
their dimensions are.

If you're worried about lining up the baselines, you could
overprint a full stop (or something) in the paper colour,
and then find it in the image - its vertical position will
give you some idea of where the baseline is.

Just a random idea - sorry if it's really silly.

Kind regards,      Silas

--
Silas S Brown, St John's College Cambridge UK http://www.cus.cam.ac.uk/~ssb22

"Whatever does not make sense can be neither understood nor appraised
and hence cannot be committed to memory." - John Comenius