12

What is the command for writing roman numerals like I, II, IV etc. in an equation ? To be noted that my requirement is to write them within $$ ...$$ and not as counters or page numbers. Any light on this would be extremely helpful.

  • 1
    will you insert these numerals already as the "letter" forms, or are you expecting to get the roman equivalent of a counter? – barbara beeton Jul 24 '14 at 13:32
30

If you don't want to do the conversion,

\documentclass{article}
\usepackage{amsmath}

\newcommand{\RN}[1]{%
  \textup{\uppercase\expandafter{\romannumeral#1}}%
}

\begin{document}
\[
\RN{4}+\RN{12}=\RN{16}
\]
\end{document}

enter image description here

If you also don't want to do the arithmetic

\documentclass{article}
\usepackage{amsmath}
\usepackage{xparse}

\ExplSyntaxOn
\NewDocumentCommand{\RN}{m}
 {
  \textup{ \int_to_Roman:n { #1 } }
 }
\ExplSyntaxOff

\begin{document}
\[
\RN{4}+\RN{12}=\RN{4+12}
\]
\end{document}
| improve this answer | |
  • Thanx. This is very helpful. :) – smiley06 Jul 28 '14 at 12:32
5

I understand, that you are expecting a plain TeX solution, as it is suggested by tex-core tag, hence

$$
1+1=2
\eqno{\rm IV}
$$

\bye
| improve this answer | |
  • Perhaps even \eqno\hbox{\tenrm IV} to ensure that a) the number is from the text font, and b) doesn't inherit the style of the surrounding text. – morbusg Jul 24 '14 at 11:53
  • 1
    @morbusg The \hbox is irrelevant, the style isn't inherited. Moreover, the {...} in the answer is irrelevant too. – wipet Apr 10 '16 at 18:51
  • @wipet Huh, weird. Yes, thank you for correcting. – morbusg Apr 18 '16 at 17:12
3

For the sake of completeness. The conversion to roman numeral will be done automatically.

\documentclass[varwidth,math]{standalone}% change it back to your own document class

\newcounter{x}
\def\ToRomanEmpire#1{\setcounter{x}{#1}\Roman{x}}


\begin{document}
\[
    \ToRomanEmpire{1999} + \ToRomanEmpire{15} = \ToRomanEmpire{2014}
\]
\end{document}

enter image description here

| improve this answer | |
2
\documentclass{article}
\usepackage{mathtools}
\begin{document}

\[ \text{IV}\times\text{V}=\text{XX} \]

\end{document}
| improve this answer | |
0

If you want to enter roman numbers within your text, please follow these instructions.

  1. in the first step you have to install the package of "romannum".
  2. in this step you have to use this package in your text,therefore type this:

    \usepackage{romannum}
    
  3. Now you can write roman numbers in your text in lowercase or uppercase by this command.

    • \romannum{1} for Lowercase roman numbers or
    • \Romannum{1} for Uppercase roman numbers.

For example suppose that we want to write this sentence.

ten million people died between WWI and WWII.

We write in Latex:

ten million people died between WW\Romannum{1} and WW\Romannum{2}.
| improve this answer | |
  • It would be best to provide a sample document and also to the address the specific issue of roman numerals in display math mode raised in the question. – Andrew Swann Apr 10 '16 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.