4

Using the package enumitem I can edit my enumerations to use roman numerals, so that

\begin{enumerate}[label=\textsc{\textsc(\roman*)}]
\item A
\item B
\item C
\item D
\end{enumerate}

yields the expected

(I) A
(II) B
(III) C
(IV) D

but in computer modern with nice formatting bits. How can I change this so that (IV) becomes (IIII) instead?

  • 2
    Interesting to know would also be what you would like to do with a.o. V, VI, VII, VIII, IX, X – albert Oct 01 '18 at 16:36
  • 1
    Might be valid for some clocks (I don't see a reference to a clock in the question though), but this looks like a more general question to me. – albert Oct 01 '18 at 17:33
  • @Phelype Oleinik, Not quite. Some clocks also use VIIII in lieu of IX – ikegami Oct 01 '18 at 22:43
  • The point is that even if your assumption is true about this being about clocks, your suggestion that we don't ask for further info should not be considered. – ikegami Oct 01 '18 at 22:55

2 Answers2

7

If you want to change \roman everywhere to that style then

\makeatletter
\def\@roman#1{\ifnum#1=4 iiii\else\romannumeral #1\fi}
\makeatother

should work.

David Carlisle
  • 757,742
2

Based on https://tex.stackexchange.com/a/300215/36296, you could something like this:

\documentclass{article}
\usepackage{enumitem}

\makeatletter
\newcount\my@repeat@count
\newcommand{\myrepeat}[2]{%
  \begingroup
  \my@repeat@count=\z@
  \@whilenum\my@repeat@count<#1\do{#2\advance\my@repeat@count\@ne}%
  \endgroup
}
\makeatother

\begin{document}


\begin{enumerate}[label={(\textsc{\protect\myrepeat{\value*}{I}})}]
\item A
\item B
\item C
\item D
\end{enumerate}


\end{document}

enter image description here