96

For example:

Charles's sister Bona, married the eldest son of Philip VI of France, the future John II of France, in 1335.

How can I get Roman numerals?

4
  • 21
    Simply write "Charles's sister Bona, married the eldest son of Philip VI of France, the future John II of France, in 1335." Jul 19, 2011 at 13:03
  • 1
    Indeed, simply write it as you did. Doesn't this work for you? If so please add a minimal working example (MWE) that illustrates your problem. Maybe it's a font issue or similar. Jul 19, 2011 at 13:09
  • 5
    If you want over- and underlined roman numerals, please see the answer to this question: Roman numerals formatting
    – Stephen
    Oct 14, 2011 at 18:16
  • 4
    Not all fonts make distinguishable Roman numerals, or nice letters 'I', 'V', 'X'. For that reason, I usually use \textrm{XXIV}.
    – Vladimir
    Sep 25, 2013 at 10:09

6 Answers 6

75

Here's an example how you could use the TeX primitive (mentioned by Martin) for defining your own macro for conversion to big Roman numbers:

\documentclass{article}
\makeatletter
\newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral #1@}
\makeatother
\begin{document}
Charles's sister Bona, married the eldest son of Philip \rom{6} of France,
the future John \rom{2} of France, in 1335.

Today is the year \rom{2011}.
\end{document}

roman numbers

It's done similar to the definition of the LaTeX macro \Roman.

14
  • 3
    Any idea why the LaTeX kernel doesn't use \uppercase here? Jul 19, 2011 at 13:11
  • 3
    \uppercase doesn't expand the argument, so it would not have an effect here. However, \MakeUppercase would do it.
    – Stefan Kottwitz
    Jul 19, 2011 at 13:20
  • 6
    I know but this can be fixed with \expandafter: \uppercase\expandafter{\romannumeral<number>\relax}. Works fine in my quick tests. Jul 19, 2011 at 13:22
  • 1
    @Martin: Try the different approaches inside an \edef, and see why \uppercase is not going to work. (I think the actual application was in \csname, but the same idea applies.)
    – Joseph Wright
    Jul 19, 2011 at 13:51
  • 1
    @Stephan: how did your \rom{6} render as XXV (and was there ever a Philip XXV of France)?
    – raphink
    Jul 19, 2011 at 15:40
49

The \romannumeral kernel primitive is your friend:

\newcommand{\RNum}[1]{\uppercase\expandafter{\romannumeral #1\relax}}

Charles's sister Bona, married the eldest son of Philip \RNum{4} of France, the future John \RNum{2} of France, in 1335.
2
  • 5
    As usual, Martin was 2 minutes earlier :-)
    – Daniel
    Jul 19, 2011 at 13:09
  • at first glance (and naive), \uppercase should be preceded (and not succeed) by \expandafter. Why this inversion? Oct 11, 2021 at 11:28
30

biblatex offers the macros \RN and \Rn for upper- resp. lowercase roman numerals, plus \RNfont and \Rnfont for formatting those numerals.

\documentclass{article}

\usepackage{biblatex}
\renewcommand*{\Rnfont}{\scshape}

% The following is only included to prevent BibTeX/biber errors!
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

Philip~\RN{6} (or, if you prefer, Philip~\Rn{6})~\dots

\end{document}
26

You can convert a number to a lowercase roman numeral using the TeX primitive \romannumeral<number>\relaxor in uppercase using \uppercase\expandafter{\romannumeral<number>\relax}. Counter values can be printed in as Roman numerals using \roman{<counter>} (lowercase) and \Roman{<counter>} (uppercase).

However for simple Roman numerals in text I would simple write it as you already did.

24

Simply write

Charles's sister Bona, married the eldest son of Philip VI of France, the future John II of France, in 1335.

11
  • 1
    It might require calculation for bigger Roman numbers.
    – Stefan Kottwitz
    Jul 19, 2011 at 13:16
  • 26
    @Stefan: I don't think there were this many Philips and Johns of France :-) Jul 19, 2011 at 13:24
  • 7
    Using a macro has the advantage that there's semantics - for example, roman numerals could be changed regarding font or shape later on. That would be hard if common alphabetic letters are used.
    – Stefan Kottwitz
    Jul 19, 2011 at 13:55
  • 3
    @Stefan: I agree, but Roman numerals (at least in regular text) normally use the same font as the normal text, so I don't see (at least in regular text) any significant advantage. Jul 19, 2011 at 14:08
  • 2
    @Gonzalo: Just ideas and thoughts. I like macros :-) btw. the OP desired tighter kerning for the Roman numbers I see now.
    – Stefan Kottwitz
    Jul 19, 2011 at 15:11
23

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}.

Also, the package changes the page numbering, so to keep it arabic you need to add this line in the preamble:

\AtBeginDocument{\pagenumbering{arabic}}
2
  • 6
    You should add that the package changes the presentation of all counters to roman. -- From the documentation: "LaTeX generates numbers for things like chapters and sections, figure and table captions, and page numbers. Normally these are printed using arabic digits. The romannum package modifies the typesetting of such generated numbers so that they are printed as roman numerals."
    – Ruben
    Feb 11, 2018 at 18:39
  • 1
    When using \usepackage{romannum}, the page numbering automatically changed to roman numbers(additional to required places). How to keep that normal numbers
    – sabeelmsk
    Feb 3, 2020 at 9:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .