4

Apparently a counter can store up to 2^31-1 (e-TeX). But if I want to typeset that counter using \Roman, what's the maximum I can display?

Chris H
  • 8,705

2 Answers2

7
\documentclass{article}

\newcounter{zz}

\begin{document}

\setcounter{zz}{2147483647}
 \Roman{zz}



\end{document}

Roman works for the full range, but you need a very wide page.

Overfull \hbox (24217.02405pt too wide) in paragraph at lines 8--9
[]\OT1/cmr/m/n/10 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMDCXLVII 
David Carlisle
  • 757,742
5

Try it out:

\documentclass{article}
\newcounter{maxroman}
\begin{document}
\setcounter{maxroman}{0}% use the initial value you like (e.g. 2147483640)
\makeatletter
\@whilenum \value{maxroman}<\maxdimen\do{%
  \stepcounter{maxroman}%
  \typeout{Trying \themaxroman}%
  \themaxroman=\Roman{maxroman}\par
}
\end{document}

;-)

Nevertheless large Roman numbers with aphostrophus (e.g. IↃↃↃↃ for 500.000), vinculum or multiplication (e.g. D•M) as usually used are not supported by (La)TeX.

Schweinebacke
  • 26,336
  • 1
    I am sorry. You posted your answer to the wrong question. I think you meant to post it here: https://tex.stackexchange.com/questions/122116/how-to-prolong-compilation-time-while-engaging-in-leisure-activities. ;^) By the way, you hung my computer! – Steven B. Segletes May 31 '17 at 10:03
  • 1
    Counting to 2^31-1 could take a while...a very long while. How many years do you still have before you? – Steven B. Segletes May 31 '17 at 10:26
  • 1
    @StevenB.Segletes Hopefully several more than my computer. – Schweinebacke May 31 '17 at 10:30
  • I considered this experiment, but with the level of expertise here thought there would be a documented value somewhere. – Chris H May 31 '17 at 11:02
  • 3
    @ChrisH For a documented value see David's answer or simply start the experiment with a higher value (e.g. \maxdimen-1) or turn it (start with \maxdimen and loop down to 1). – Schweinebacke May 31 '17 at 12:09