Stefan Svensson <[EMAIL PROTECTED]> wrote: > I'm quite used to programming, but I have never programmed TeX (or do > you mainly use MusicTeX macros?). Do you think you could give me a brief > explanation of what's really happening here?
Thank you very much for your using this macro, Stefan. I made some mistakes in previous version. Fixed version of \TAG is here: %---- \def\TAG#1{{% \kern30pt\kern-\afterruleskip{% \medtype \setbox0\hbox{#1}\relax \dimen0=\wd0 \ifdim\dimen0<2ex\relax \dimen0=2ex\fi \boxit{\hbox to \dimen0{\hss\box0\hss}}}}}\relax %---- The automatic horizontal alignment to barline is provided by "\kern30pt\kern-\afterruleskip" . The PMX command "h" generates following ~~~~~'d code: (see the example I wrote) % Bar count 1 \pnotes{2.83}\zcharnote{16}{\bigfont\kern-30pt \TAG{Intro}}\qu c\qu c% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "\kern-30pt" moves the reference position of next string to 30pt left. This code is inserted by the PMX program and is always "-30pt". However, "-30pt" may be not appropriate when \afterruleskip (=length from previous barline to first note of current bar) is NOT 30pt. This mismatch may be caused by change with bars/line, notes/bar, etc. That's why you were in trouble with adjusting horizontal position. So, I supress this inappropriate backspace "\kern-30pt" by "\kern30pt" and make the correct backspace with "\kern-\afterruleskip" . (Of course, this method is dependent on PMX versions.) Other codes are basic commands of MusiXTeX or otherwise primitives of plain-TeX. So, please look at the MusiXTeX document and some plain-TeX based guidance book (for example "TeX by Topic" by Victor Eijkhout) for further information. (A LaTeX-based guidance book will be no use for this purpose.) Sincerely, ---- Hiroaki MORIMOTO <[EMAIL PROTECTED]> _______________________________________________ TeX-music mailing list [EMAIL PROTECTED] http://sunsite.dk/mailman/listinfo/tex-music