[Tex/LaTex] Typesetting Roman numerals within LaTeX text

roman numerals

I want to typeset real Roman numerals (both uppercase and lowercase) in LaTeX text. I've checked out a previous thread but found no satisfactory solution. (In fact, several solutions mentioned in that thread doesn't work for me. I don't know why.)

I personally use the straightforward approach of

    \newcounter{counter}       
    \newcommand{\upperRomannumeral}[1]{\setcounter{counter}{#1}\Roman{counter}}
    \newcommand{\lowerromannumeral}[1]{\setcounter{counter}{#1}\roman{counter}}

but it is still not satisfactory. Is there any better way to perform the task?

Best Answer

If I understand you right, it seems like you are after in-line lists that are numbered in Roman numerals. I think the enumitem package is up to the job for this kind of thing.

Code

\documentclass[preview,border=5]{standalone}

\usepackage{enumitem}

\newlist{inlineroman}{enumerate*}{1}
\setlist[inlineroman]{itemjoin*={{, and }},afterlabel=~,label=\roman*.}

\newcommand{\inlinerom}[1]{
\begin{inlineroman}
#1
\end{inlineroman}
}

\newlist{Inlineroman}{enumerate*}{1}
\setlist[Inlineroman]{itemjoin*={{, and }},afterlabel=~,label=\Roman*.}

\newcommand{\InlineRom}[1]{
\begin{Inlineroman}
#1
\end{Inlineroman}
}

\begin{document}
I would like to cite some properties. Here are the properties listed in-line using small Roman numerals: \inlinerom{\item first, \item second \item third.}

Here are other properties listed as capital Roman numerals: \InlineRom{\item First property \item Second property \item Third property.}
\end{document}

Output

enter image description here