home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!usc!news.service.uci.edu!unogate!mvb.saic.com!info-tex
- From: Peter Schmitt <A8131DAL%AWIUNI11.BITNET@SHSU.edu>
- Newsgroups: comp.text.tex
- Subject: Re: Two questions
- Message-ID: <10245606@MVB.SAIC.COM>
- Date: Thu, 21 Jan 93 18:33:23 MEZ
- Organization: Info-Tex<==>Comp.Text.Tex Gateway
- X-Gateway-Source-Info: Mailing List
- Lines: 34
-
- On Thu, 21 Jan 93 11:31:58 EST you said:
- >I have two questions. The first is answered regularly on this net, but
- >I never needed it before, so I haven't kept the solutions. I don't
- >think I've seen the second answered and, while I think I can do it, I am
- >kind of pressed right now and don't want to reinvent wheels. First, how
- >to redefine \raggedright so that hyphenation is allowed and even
- >encouraged? This is for very narrow columns. Second, how to output
- >formatted numbers, so that with input either the actual number 1000 or
- >a counter containing that number, the output will be 1,000. The numbers
- >I have are all four or five digits, but there is no reason it shouldn't
- >be perfectly general.
- >
- >Michael Barr
- (1) I do not remember the recommended settings, but the trick is to
- define \rightskip 0pt plus30pt
- for some suitable dimension (and not use fil)
- (2) I habe not tested it, but try the following:
- \newcount\a \newcount\b
- \def\fnumber#1{\a=#1 \b=\a
- \divide\a by 1000 \the\a,\multiply\a by 1000 \advance\b by -\a \the\b}
- \fnumber {12345}
-
- Obviously this should be refined for 7-digit numbers, and for numbers under
- 1000 (\ifnum\a<1000) to avoid a leading zero
-
- Peter
-
-
- Peter Schmitt a8131dal@awiuni11.edvz.univie.ac.at
- schmitt@awirap.bitnet
- -----------------------------------------------------------------------------
- Institute of Mathematics Strudlhofgasse 4
- University of Vienna A-1090 Wien
- Austria
-