I currently print my integers in math mode. I believe they look the
same in non-math mode. If so, I suppose I could put a discretionary
hyphen every three digits.
Another alternative is to write $123456789012345678901234567890 \cdot
10^50 + 12345678901234567890123456789012345678901234567890$, but that
strikes me as unaesthetic.
Any suggestions would be appreciated.
> I have some integers that
> have too many digits to print on one line.
if you look in ctan in contrib/supported/carlisle you'll find comma.sty
which gives you a \commaform which is a new counter format, like
\roman or \alph it puts a comma every three digits by default, but
can be customised to put something else there, eg a space, which would
then allow line breaks.
David
Err.... Does that mean he has to find a TeX implementation with
counters that run up to 10^100?
Seems excessive: presumably comma.sty's technique can be employed to
process a text string just as well as the output of printing a
counter?
--
Robin (Campaign for Real Radio 3) Fairbairns r...@cl.cam.ac.uk
U of Cambridge Computer Lab, Pembroke St, Cambridge CB2 3QG, UK
Home page: http://www.cl.cam.ac.uk/users/rf/robin.html
> if you look in ctan in contrib/supported/carlisle you'll find comma.sty
> which gives you a \commaform which is a new counter format, like
> \roman or \alph it puts a comma every three digits by default, but
> can be customised to put something else there, eg a space, which would
> then allow line breaks.
Hmmmmmm. Some countries use commas to separate digits and full stops
for decimal markers, others do it the other way around. That's why
the current recommendations for scientific work are to use a space to
group digits and then whether a comma or period is used for the decimal
marker it doesn't cause confusion. If possible, though, a thin space is
better than an ordinary space as the digit separator.
--Paul
> > if you look in ctan in contrib/supported/carlisle you'll find comma.sty
> > which gives you a \commaform which is a new counter format, like
> > \roman or \alph it puts a comma every three digits by default, but
> > can be customised to put something else there, eg a space, which would
> > then allow line breaks.
>
> Hmmmmmm. Some countries use commas to separate digits and full stops
> for decimal markers, others do it the other way around. That's why
> the current recommendations for scientific work are to use a space to
> group digits and then whether a comma or period is used for the decimal
> marker it doesn't cause confusion. If possible, though, a thin space is
> better than an ordinary space as the digit separator.
Note that the above-mentioned comma.sty allows you to change the digit
separator. To do a thin space,
\renewcommand\commaformtoaken{\,}
--
Richard W Kaszeta Graduate Student/Sysadmin
bo...@me.umn.edu University of MN, ME Dept
http://www.menet.umn.edu/~kaszeta
> "Paul L. Allen" <p...@sktb.demon.co.uk> writes:
>
> > > if you look in ctan in contrib/supported/carlisle you'll find comma.sty
> > > which gives you a \commaform which is a new counter format, like
> > > \roman or \alph it puts a comma every three digits by default, but
> > > can be customised to put something else there, eg a space, which would
> > > then allow line breaks.
> >
> > Hmmmmmm. Some countries use commas to separate digits and full stops
> > for decimal markers, others do it the other way around. That's why
> > the current recommendations for scientific work are to use a space to
> > group digits and then whether a comma or period is used for the decimal
> > marker it doesn't cause confusion. If possible, though, a thin space is
> > better than an ordinary space as the digit separator.
>
> Note that the above-mentioned comma.sty allows you to change the digit
> separator. To do a thin space,
>
> \renewcommand\commaformtoaken{\,}
I've not checked, but won't that result in a thin space where the line
cannot be broken, which was the point of the original question?
--Paul
> I've not checked, but won't that result in a thin space where the line
> cannot be broken, which was the point of the original question?
True, but you could do either of these:
\documentclass{article}
\setlength\textwidth{8cm}
\setlength\parindent{0pt}
\setlength\parskip{10pt}
\usepackage{comma}
\makeatletter
\newcommand\xxx[1]{{\let\number\@empty\@commaform{#1 }}}
\makeatother
\begin{document}
\renewcommand\commaformtoken{\linebreak[0]\,}
\xxx{123456789012345678901234567890123456789012345678901234567890}
\renewcommand\commaformtoken{%
\discretionary
{\hbox{ Continued on the next line\ldots}}%
{\hbox{\ldots\ }}
{\,}}
\xxx{123456789012345678901234567890123456789012345678901234567890}
\end{document}
David
PS to Robin.
Er you were right about the upper limit, but not quite for the reason
you said, see the \let above:-)
> > I've not checked, but won't that result in a thin space where the line
> > cannot be broken, which was the point of the original question?
>
> True, but you could do either of these:
[...]
> \renewcommand\commaformtoken{\linebreak[0]\,}
That was the point I was getting at. Sometimes it's not at all easy
to do something like this when the package author wasn't expecting anyone
to want something out of the ordinary.
--Paul