From: "Mojca Miklavec" <mojca.miklavec.lists@gmail.com>
Subject: Re: small caps italic and font switching inside math
Date: Sat, 1 Jul 2006 21:24:52 +0200 [thread overview]
Message-ID: <6faad9f00607011224l12156860we1f64cdbaa81e25b@mail.gmail.com> (raw)
In-Reply-To: <44A61BB5.7090302@elvenkind.com>
On 7/1/06, Taco Hoekwater wrote:
> Mojca Miklavec wrote:
> > On 6/29/06, Taco Hoekwater <wrote:
> >
> >>{\bf A test \variant[Caps] in small caps}
> >
> > Does this work on your computer? (I don't get any caps here.)
>
> No it doesn't, it was a leftover from a failed experiment
OK. I thought so :(
> >
> > Thanks for the magnificent macro! I replaced minus by $-$ and I had to
>
> Does that really look better? You can have bold endashes, but
> you will not get a bold minus.
emm ... I didn't think about that. And I don't notice any big
difference on the monitor to be honest. I'll use endash, but it
doesn't really matter that much.
> > 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.
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.
> It only moves a lone subscript because i like ions better
> if the count and charge are aligned, and I also added an italic
> correction.
Thanks!
> It is possible to get everything looking perfect
> (of course), but that would require spending much more time
> fine-tuning super- and sub scripts.
I don't need that perfect solution. The way it is now is already great.
> Positive ions look absolutely awful in latin modern btw. The
> plus from CM is dead-ugly when used in this fashion.
I may not bother about it - I can't redesign the font and I'll worry
about switching to some other font at the end if necessary, now it's
time to concentrate on content. (A pitty that Knuth wasn't a chemist
as well. The chemists would desperately need something similar for
chemistry what TeX offers for mathematics.)
> \newbox\chemlowbox
> \def\chemlow#1%
> {\setbox\chemlowbox\hbox{{\switchtobodyfont[small]#1}}}
>
> \def\chemhigh#1%
> {\ifvoid\chemlowbox \high{{\switchtobodyfont[small]#1}}%
> \else \/\lohi{\box\chemlowbox}{{\switchtobodyfont[small]#1}}\fi }
>
> \def\finishchem%
> {\ifvoid\chemlowbox \else
> \iffluor \fluorfalse \kern-.1em \fi\low{\box\chemlowbox}\fi}
>
> \newif\iffluor
>
> \unexpanded\def\molecule%
> {\bgroup
> \catcode`\_=\active \uccode`\~=`\_ \uppercase{\let~\chemlow}%
> \catcode`\^=\active \uccode`\~=`\^ \uppercase{\let~\chemhigh}%
> \dostepwiserecurse {65}{90}{1}
> {\catcode \recurselevel = \active
> \uccode`\~=\recurselevel
> \uppercase{\edef~{\noexpand\finishchem
> \rawcharacter{\recurselevel}}}}%
> \uccode `\~=`\F \uppercase{\def~{\finishchem F\fluortrue}}%
> \catcode`\-=\active \uccode`\~=`\- \uppercase{\def~{--}}%
> \loggingall
> \domolecule }%
I didn't really understand the \iffluor-part of the code ... but don't
bother too much.
Thanks a lot for the trickery again (I'm still impressed by the
\uppercase part),
Mojca
next prev parent reply other threads:[~2006-07-01 19:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-28 17:44 Mojca Miklavec
2006-06-28 18:33 ` Aditya Mahajan
2006-06-28 18:56 ` Taco Hoekwater
2006-06-29 2:11 ` Mojca Miklavec
2006-06-29 5:13 ` Aditya Mahajan
2006-06-29 7:27 ` Taco Hoekwater
2006-06-29 7:24 ` Taco Hoekwater
2006-06-29 7:30 ` Taco Hoekwater
2006-06-29 9:11 ` Hans Hagen
2006-06-29 9:15 ` Taco Hoekwater
2006-07-01 3:50 ` Mojca Miklavec
2006-07-01 6:52 ` Taco Hoekwater
2006-07-01 19:24 ` Mojca Miklavec [this message]
2006-07-02 8:44 ` Taco Hoekwater
2006-07-02 11:59 ` Mojca Miklavec
2006-07-02 14:16 ` Taco Hoekwater
2006-07-03 11:25 ` Vit Zyka
2006-06-28 18:54 ` Thomas A. Schmitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6faad9f00607011224l12156860we1f64cdbaa81e25b@mail.gmail.com \
--to=mojca.miklavec.lists@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).