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?
Asked
Active
Viewed 299 times
2 Answers
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
-
1
-
1So after
MMMCMXCIX(orMMMMCMXCIXif you like) this takes the simple approach rather than any of the alternatives such as using$\bar\mathrm{X}$or\=Xfor 10 000 (maths/text modes) or the multiplicative version in @Schweinebacke's answer. This is universal and simple I suppose. – Chris H May 31 '17 at 11:11 -
1@ChrisH yes it just adds
m(which is used as a useful loop generator in certain trick constructs) see https://tex.stackexchange.com/a/199162/1090 – David Carlisle May 31 '17 at 11:52
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
-
1I 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 -
1Counting to
2^31-1could 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
-
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\maxdimenand loop down to 1). – Schweinebacke May 31 '17 at 12:09
Mis wider thanL, in most cases,Dis narrower thanM, so there might be an optimum for the\textwidth– May 31 '17 at 09:58