On Mon, Feb 23, 2009 at 5:52 PM, Wolfgang Schuster
Am 23.02.2009 um 17:21 schrieb Mojca Miklavec:
Hello,
I did not try to analyze how the following macros work (they are too complex), but they somehow fail in mkiv. (I don't need the "F" kerning, so that portion of code may go away, but the macro itself is very very handy.)
All I want is to have a macro that "converts" _{...} into \low{...} and ^{...} into \high{...} (or possibly enable using both at the same time).
\startluacode
thirddata = thirddata or { }
function thirddata.molecule(text) text = string.gsub(text,"_","\\low") text = string.gsub(text,"%^","\\high") tex.sprint(text) end
\stopluacode
\def\molecule#1{\ctxlua{thirddata.molecule('#1')}}
hmm Isn't better to remember original \molecule ? I mean, something like \let\ORIGINALmolecule\molecule \def\molecule#1{\ctxlua{thirddata.molecule('#1')}} Sometimes in some contexts ORGINAL works and modified no, and you haven't time to find why . -- luigi