Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
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 at 13:32

4 Answers 4

up vote 23 down vote accepted

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}
share|improve this answer
    
Thanx. This is very helpful. :) –  smiley06 Jul 28 at 12:32

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
share|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 at 11:53
\documentclass{article}
\usepackage{mathtools}
\begin{document}

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

\end{document}
share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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