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.
Pros:
- no additional code necessary when you're writing
- awesome free font, not only, but especially for Medievalists
Cons:
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
\documentclass{article}
\usepackage{fontspec}
\setmainfont[Ligatures={Discretionary}]{Junicode}
% 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
\begin{document}
i, ii, iii, iv, v, vi, vii, viii, ix, x, xi, xii
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
\end{document}
<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.