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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As mentioned in How can I get Roman numerals in text?, there are several ways in which one can add Roman numerals to text in TeX. However, these solutions all seem to use three I's to make a roman numeral 3, rather than combining using the "Number forms" symbols found in many fonts such as "Ⅲ".

Is there a way to get XeTeX to render all of the Roman numerals in a document using the special Roman numeral symbols found in many fonts?

share|improve this question
Please note the Roman numerals in Unicode are compatibility characters, and using ordinary Latin characters to denote Roman numerals is preferred. – Khaled Hosny Dec 18 '11 at 16:22
@KhaledHosny Can you show a reference? – egreg Dec 18 '11 at 17:28
Check section 15.3, p. 486 of The Unicode Standard, Version 6.0 book; For most purposes, it is preferable to compose the Roman numerals from sequences of the appropriate Latin letters. However, the uppercase and lowercase variants of the Roman numerals through 12, plus L, C, D, and M, have been encoded for compatibility with East Asian standards. – Khaled Hosny Dec 18 '11 at 17:43
I'm quite surprised to see that you think that my answer deals only with small numbers; probably you haven't tried it with larger ones. – egreg Dec 21 '11 at 7:58
@BrunoLeFloch The decomposition of Ⅸ is <compat> 0049 0058 [ ‌I ‌X ], so I don't see a point here; however, writing ⅮⅨ (D-IX) instead of ⅮⅠⅩ (D-I-X) might give spacing problems. – egreg Dec 22 '11 at 10:44
up vote 11 down vote accepted

\uromannumeral{12} \uRomannumeral{7}

\uroman{page} \uRoman{page}

\item foo
\item foo
\item foo
\item foo
\item foo



share|improve this answer
up vote 11 down vote
\def\UniRoman#1{\expandafter\@UniRoman\csname c@#1\endcsname}
\def\uniroman#1{\expandafter\@uniroman\csname c@#1\endcsname}

  Ⅰ\or Ⅱ\or Ⅲ\or Ⅳ\or Ⅴ\or Ⅵ\or Ⅶ\or Ⅷ\or Ⅸ\or Ⅹ\or Ⅺ\or Ⅻ\else
  \expandafter\@slowUniRoman\romannumeral #1@\fi}
\def\@slowUniRoman#1{\ifx @#1% then terminate
       \if i#1Ⅰ\else\if v#1Ⅴ\else\if x#1Ⅹ\else\if
       l#1Ⅼ\else\if c#1Ⅽ\else\if d#1Ⅾ\else \if
  ⅰ\or ⅱ\or ⅲ\or ⅳ\or ⅴ\or ⅵ\or ⅶ\or ⅷ\or ⅸ\or ⅹ\or ⅺ\or ⅻ\else
  \expandafter\@slowuniroman\romannumeral #1@\fi}
\def\@slowuniroman#1{\ifx @#1% then terminate
       \if i#1ⅰ\else\if v#1ⅴ\else\if x#1ⅹ\else\if
       l#1ⅼ\else\if c#1ⅽ\else\if d#1ⅾ\else \if

\renewcommand{\thecnta}{\uniroman{cnta}} % lowercase Roman numerals
\renewcommand{\thecnta}{\UniRoman{cntb}} % uppercase Roman numerals

It's up to you to decide that \roman and \@roman become, respectively, \uniroman and \@uniroman (similarly for the uppercase variant).

These macros allow for representing any positive integer with the Roman number system. If one wants to use also "ↁ", "ↂ", "ↇ", and "ↈ", then some more work is needed.


Support for the extended numerals can be obtained in a quite straigthforward way:

\def\extUniRoman#1{\expandafter\@extUniRoman\csname c@#1\endcsname}

\def\@slowhighUniRoman#1{\ifx @#1% then terminate
       \if i#1ↀ\else\if v#1ↁ\else\if x#1ↂ\else\if
       l#1ↇ\else\if c#1ↈ\else\if d#1ↈↈↈↈↈ\else \if

Just to make an example, with


we get

enter image description here

share|improve this answer
Oh, I've never seen roman numerals like ↁ – Leo Liu Dec 21 '11 at 14:12
Neither have I, but it seems that they were used in some cases. The ↀ form for 1000 was rather common, actually. – egreg Dec 21 '11 at 14:16
That's funny. Now the solution is suitable for generic usage, maybe it can be exported as a package or merge into some package? – Leo Liu Dec 21 '11 at 14:33
Probably with some options to decide which kind of roman numeral is used. – Bruno Le Floch Dec 22 '11 at 6:34

The free (Open Font License) font Junicode automatically turns "spelled out" Roman numerals from I to XII (both uppercase and lowercase) into their Unicode counterparts if you activate discretionary ligatures (dlig). It works just like f and l are combined to the fl ligature in the output.


  • no additional code necessary when you're writing
  • awesome free font, not only, but especially for Medievalists


  • numbers like XIII look strange because they're rendered as XII+I
    This really is a problem on Unicode's side though, because Unicode only has Roman numbers up to 12. Then again, I guess Junicode could've kept going and added more numerals as ligatures in the private area usage area of Unicode.

  • you may not want all the ligatures in your document that are included in dlig
    For the latter problem, Mico's upcoming selnolig package might be useful, which allows you to globally disable a specific ligature with a single macro, all using LuaTeX. Stay tuned.

Here's a document showing some of Junicode's discretionary ligatures:

% compile with XeLaTeX or LuaLaTeX

    % Naturally, I'd also enable "TeX" and "Common" ligatures
    % when using discretionary ligatures
    % I dare you to check out Junicode's historical ligatures!
    % http://junicode.sourceforge.net/Junicode.pdf#page=13

\textwidth=4cm % These two lines are just
\parindent=0cm % to keep my example compact


i, ii, iii, iv, v, vi, vii, viii, ix, x, xi, xii


{\Huge XIII} % That ain't pretty

Ⅼ, Ⅽ, Ⅾ, Ⅿ, ↀ, ↁ, ↂ % These are (all?) other Unicode Roman numerals Junicode has
                         % (which have nothing to do with dlig though)

tt, tr, tty % These are some presumably acceptable discretionary ligatures of Junicode

ct, hv, st % These are the weird ligatures in dlig

[7], [[4]], <13>, [g], [W] % These are also part of dlig, but probably not bothersome



share|improve this answer

Your Answer


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.