tags:

views:

179

answers:

2

Hi,

I want to get the Roman number of 2. So I use $\Roman{2}$ inside text. But then I got an error

! Missing number, treated as zero.

How can I fix it?

Thanks and regards!

+2  A: 

I would suggest to use that snippet:

\makeatletter
\newcommand{\rmnum}[1]{\romannumeral #1}
\newcommand{\Rmnum}[1]{\expandafter\@slowromancap\romannumeral #1@}
\makeatother

now you can call:

\Rmnum{2} % II
\rmnum{2} % ii
Olivier
+1  A: 

I think you mean \Roman not \Rome. Anyway, \Roman prints the value of a counter as a roman numeral, so you can't use it with "2".

Short answer - use \romannumeral 2.

Long answer - define commands as described here.

ptomato
Thanks! Why sometimes I saw some commands taking arg inside {}, sometimes not?
Tim
LaTeX commands always take arguments inside `{}` or `[]`. The reason is because `\romannumeral` isn't really a LaTeX command, it's a TeX command. Usually you don't want to mess around with those.
ptomato