On 7/2/06, Taco Hoekwater wrote:
Mojca Miklavec wrote:
It works perfect except in a single case: \title{\molecule{SF_6}}
I had seen that, but not yet bothered to fix it. Still, it is fairly easy to change the macro, try the version below.
Sorry, I thought you were talking about the spacing between F and 6.
;) great. You solved two problems now ;)
Didn't work in titles either (or I did something strange) :( But If I write a couple of explicit \lohi-s, it will still be OK.
Good, but it can be fixed, by changing the definition of \domolecule to:
\def\domolecule#1% {\expandafter\scantokens\expandafter {\detokenize{#1\finishchem}}\egroup}
This re-tokenizes the argument (needed because it was grabbed by \title already before \molecule had a chance to change the catcodes.)
Seems like understanding \expandafter would solve 90% of my problems. I tried to understand that part in TeX book, but it's so cryptic (too short) ... I understand the concept, but I'm not able to write the code for it yet :( Thanks!
I didn't really understand the \iffluor-part of the code ... but don't bother too much.
It is there to trigger a negative italic superscript correction (TeX doesn't have a primitive for that :-))
Oh, great!
Thanks a lot for the trickery again (I'm still impressed by the \uppercase part),
That is actually a fairly standard trick, not something I invented
But it's nevertheless nice ;) I never saw it (probably because I didn't read and write enough of TeX sources). Mojca