In the preamble, i.e. before \begin{document}, define
\makeatletter
\newcommand{\rmnum}[1]{\romannumeral #1}
\newcommand{\Rmnum}[1]{\expandafter\@slowromancap\romannumeral #1@}
\makeatother
Then in the document part, \rmnum{num} is used to input the roman numeral of num, \Rmnum is for the uppercase. If you prefer to use other commands, just change the red part in the definition part.
If only lowercase roman numerals are occasionally used, \romannumeralnum can do it. In this approach, definition is not necessary.
Someone anonymous commented that "Nice, but it fails for N=4000 and above." However, in my system, it is working for 4000 and above.
Update: again, someone anonymous pointed out that MMMM is not allowed. Based on the information I found on the Internet, it is OK. But once the number goes bigger again, the convert is not correct.
gracias
ReplyDeleteThumbs up!
ReplyDeleteThank you!
ReplyDeletethanks a bunch
ReplyDeleteThanks very much. It worked well. There are two ways to represent 1500 in Roman numerals. The one most familiar today is MD, while many manuscripts and early-printed books have (|)|) . It actually looks like a letter c followed by a line followed by a reversed letter c, which represents M. Is there any way to get style Roman numeral in LaTex?
ReplyDeleteThanks! I still have a sorting problem, because \Rmnum{10} is sorted before \Rmnum{1}... Any idea?
ReplyDeleteNice, but it fails for N=4000 and above.
ReplyDeletewow... thats really awesome dude... i could not find anything this useful elsewhere....
ReplyDeleteDanke
ReplyDeleteThank you!!
ReplyDeleteThanks a lot, very useful! I would never have thought of that myself.
ReplyDeleteThanks a lot
ReplyDeletethanks! … to just let you know that your tip is still helpful, after posting it 2.5 years ago :)
ReplyDeleteThanks!
ReplyDeleteWell, this is almost April, 2010 - and your post continues to help people. Thanks a lot!
ReplyDeleteYour technique worked perfectly for me. Thanks a million!
ReplyDeletePaul
I got a Roman 2 (II) with the serifs of the two capital Is joined together, by doing this:
ReplyDeleteI\kern -0.2ex I
It would be nice if TeX could do that in the general case, rather than just printing out the letters separately.
Thanks, man.
ReplyDeleteOf course it fails for N=4000 and above! It uses MMMM which is not allowed, try asking it for the number 50000 and see 50 M letters, it's funny :)
ReplyDeleteStill working, still great.
ReplyDeleteThanks a lot for this
Cheers m8
ReplyDeletegood stuff, thanks
ReplyDeletethanks a lot
ReplyDeleteThanks!!
ReplyDeleteThanks you so much!!!!
ReplyDeletehow to get romans in latex software witout use usepackege command
ReplyDelete