[Tugindia] Wrapping long numbers

David Kastrup dak at gnu.org
Thu Mar 15 16:00:18 CET 2007


"Alok G. Singh" <alokgs at yahoo.co.uk> writes:

> Hello,
>
> How could I 'wrap' a long number (> 120 digits) into multiple lines
> without having to insert spaces manually ? I have to typeset a lot of
> numbers like this.

In the preamble:

\newenvironment{wrappednumbers}
{\count0=`\9 \loop \ifnum\count0>`\0
  \uccode`\~=\count0\uccode`\!=\count0
  \lowercase{\def~{!\penalty0}}
  \catcode\count0=\active
  \repeat
  \uccode`\~=0 \uccode`\!=0}{}

and then 

\begin{wrappednumbers}
3.141592653589793238462643383279502884197169399375105820974944592307816%
40628620899862803482534211706798214808651328230664709384460955058223172%
5359408128481117450284102701938521105559644622948954930382
\end{wrappednumbers}

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
UKTUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>


More information about the tugindia mailing list