Article View: comp.text.tex
Article #10325Re: Followup: how to format -1.23e-4 ?
From: Andy Golding
Date: Tue, 18 Jun 1991 00:04
Date: Tue, 18 Jun 1991 00:04
33 lines
1255 bytes
1255 bytes
First I wrote:
> I was wondering what is the preferred way of formatting
> numbers in exponential notation, e.g., -1.23e-4
Then I wrote:
> ... the most esthetically pleasing choice is
>
> $-1.23 \times 10^{-4}$
>
> implemented by:
>
> \newcommand\expnum[2]{\mbox{$#1 \times 10^{#2}$}}
> \expnum{-1.23}{-4}
>
> The only drawback is readability of the source file --
> it's awkward having \expnum macros sprinkled in it --
> but I can certainly live with that.
Now I write:
The readability is easily fixed in Plain TeX with:
\def\enum#1{\enumparse#1!}
\def\enumparse#1e#2!{\mbox{$#1 \times 10^{#2}$}}
\enum{-1.23e-4}
Now I am truly happy. Thanks to Raymond Chen for this fine solution.
Andy
Technical Details
Message-ID:
<1991Jun18.000445.15014@neon.Stanford.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!carbon!stanford.edu!neon.Stanford.EDU!goldingReferences:
<1991Jun17.163146.19921@midway.uchicago.edu> <1991Jun17.173625.24274@neon.Stanford.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!carbon!stanford.edu!neon.Stanford.EDU!golding From: golding@neon.Stanford.EDU (Andy Golding) Newsgroups: comp.text.tex Subject: Re: Followup: how to format -1.23e-4 ? Message-ID: <1991Jun18.000445.15014@neon.Stanford.EDU> Date: 18 Jun 91 00:04:45 GMT References: <1991Jun17.163146.19921@midway.uchicago.edu> <1991Jun17.173625.24274@neon.Stanford.EDU> Organization: Computer Science Department, Stanford University, Ca , USA Lines: 33