Roman number

3,973 views
Skip to first unread message

Anglea

unread,
Jun 30, 2010, 2:30:28 PM6/30/10
to LaTeX Users Group
Hi everyone,

I need to use the Roman numbers like this, Sec. IV, Sec. II

so here what I wrote Sec.\roman{1}

the waring message syas "/paper1.tex:79:Missing number, treated as
zero. ...}"

ANY IDEAS?
best

Peter Flynn

unread,
Jun 30, 2010, 2:59:17 PM6/30/10
to latexus...@googlegroups.com

\roman is a function that needs a counter as an argument, eg \roman{page}.
To create a roman numeral from an arbitrary integer, I think you have to use \romannumeral{n}

///Peter

Anglea

unread,
Jun 30, 2010, 3:19:59 PM6/30/10
to LaTeX Users Group
THANKS Peter,

I used \romannumeral{1}, it gives me 1, do I need to download a
certain package??

I found on the web this command

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

but it is strange it is only work for lower case Roman number and it
does nor work for \Rmnum{1}

On Jun 30, 7:59 pm, Peter Flynn <anglebrac...@gmail.com> wrote:

Peter Flynn

unread,
Jun 30, 2010, 3:56:39 PM6/30/10
to latexus...@googlegroups.com
On Wed, Jun 30, 2010 at 8:19 PM, Anglea <hanyah...@yahoo.com> wrote:
THANKS Peter,

I used \romannumeral{1}, it gives me 1, do I need to download a
certain package??

Sorry, I was wrong. Omit the curly braces. It's \romannumeral 1, not \romannumeral{1}.

Unusually (mainly because it's a plain TeX macro, not LateX), \romannumeral will keep on reading digits until it reaches a non-digit, so it does not need (and cannot use) surly braces.

I found on the web this command

\makeatletter
\newcommand{\rmnum}[1]{\romannumeral #1}

Yes, exactly that. No curly braces around the argument.
 
\newcommand{\Rmnum}[1]{\expandafter\@slowromancap\Romannumeral #1@}
\makeatletter

but it is strange it is only work for lower case Roman number and it
does nor work for \Rmnum{1}

Much easier,  \MakeUppercase{\romannumeral 15} gives XV.

///Peter
Reply all
Reply to author
Forward
0 new messages