I have a sort of kludge which works fine for symbols in the body of
the text viz.
\newcommand{\isotope}[2]{\raise.75ex\hbox{\scriptsize{$#1$}}#2}
but a \scriptsize number is not appropriate in say footnotes.
Not that I need to use this in a footnote yet, but it would be nice
to have something that automatically resized in a sensible fashion.
Any ideas anyone?
Andrew McLean e-mail: a...@soton.ac.uk
Department of Physics, phone: +44 (0)703 593084
University of Southampton, fax: +44 (0)703 585813
Southampton, S09 5NH, UK.
Is there something wrong with using math superscripts?
Anyway, here is what I have. Maybe I should go over it again (because I
am sooo much smarter now :-) and send it to ctan.
% isotope.sty --- DJA
% Features:
% o works in both math mode and text mode
% o `kerns' the weight with A or J (yes, I know no elements start with J)
% o the pre-superscript knows the height of the "element" text
% o the chemical symbol is printed in roman, even in math mode
% o can define commands with \newisotope
% Syntax:
% - in the document preamble \newisotope{He} \newisotope{H} \newisotope{Au}
% - in the body:
% \He gives He
% \He4 gives ^{4}He
% \He[3,4] gives ^{3,4}He
% Note the *square* brackets to surround complex isotopic weights.
% I did that because empty braces (\Au{} ) are commonly used to preserve
% spaces after command words.
\def\newisotope#1{%
\def\@tempa##1##2\relax{##1}%
\if A\@tempa#1.\relax \Newisotope{\!}{#1}\else
\if J\@tempa#1.\relax \Newisotope{\!}{#1}\else
\Newisotope{}{#1}\fi\fi
}
\def\Newisotope#1#2{\expandafter\def \csname #2\endcsname
{\protect\Isotope {#1}{#2}}}
\def\Isotope#1#2{\ifmmode \begingroup \else $\begingroup\aftergroup$\fi
\def\@isotempa{#1}\def\@isotempb{\fam\z@ #2\endgroup}%
\@ifnextchar[{\IsotopE}{\afterassignment\IsotoPE \count@=0}}
\def\IsotoPE{\ifnum\count@=0 \@isotempb \else \IsotopE[\number\count@]\fi}
\def\IsotopE[#1]{\vphantom{\begingroup\@isotempb}^{#1\@isotempa}\@isotempb}
...
I use things like this:
$\mathrm{^{3}He}$ and $\mathrm{^{12}C}$
or in 2.09 language
$\rm ^{3}He$ and $\rm ^{12}C$
Mike
--
__ ___ __
/ / / / | /| / / Michael A. Miller -- mil...@uwnuc1.physics.wisc.edu
/ /_/ /| |/ |/ / University of Wisconsin-Madison, Nuclear Physics
\__,_/ |__/|__/ 1150 Univ. Ave., Madison, WI USA 53706 608-262-3091
In article <8WZT...@math.fu-berlin.de> a...@conmat.phys.soton.ac.uk writes:
>I need to use the standard symbols for different isotopes of chemical
>elements, by which I mean the standard abbreviation for the element
>with a superscript atomic mass to the \emph{left} of the symbol.
>
>I have a sort of kludge which works fine for symbols in the body of
>the text viz.
>
>\newcommand{\isotope}[2]{\raise.75ex\hbox{\scriptsize{$#1$}}#2}
>
>but a \scriptsize number is not appropriate in say footnotes.
>
>Not that I need to use this in a footnote yet, but it would be nice
>to have something that automatically resized in a sensible fashion.
>
>Any ideas anyone?
The simple-minded approach is often the best.
\newcommand{\isotope}[2]{${}^{#1}$#2}
works quite happily both in text and footnotes.
It should not, of course, be the first item in your footnote text, to
avoid the isotope number getting pushed next to the footnote number,
so that we get unknown elements!
>
>Andrew McLean e-mail: a...@soton.ac.uk
>Department of Physics, phone: +44 (0)703 593084
>University of Southampton, fax: +44 (0)703 585813
>Southampton, S09 5NH, UK.
Ken Smith
--
Dr. Ken Smith | snailmail: Department of Mathematics,
email: k...@maths.uq.oz.au | The University of Queensland,
"Let justice flow like a | St Lucia, Qld. 4072.
river!" Amos, c. 750 BC. | Australia.