The OT1
encoding has no slot for the braces, because the normally allocated ones are for different symbols (the en-dash and the closing double quotes respectively). Instead, the braces are in a T1
encoded font.
Jump to the end for a short summary; otherwise, read on.
TeXnical details
When the encoding is OT1, \{
and \}
choose a different font. Let's see; I assume that xpatch
is loaded for \xshowcmd
:
\show\{
> \{=macro:
->\x@protect \{\protect \{ .
\xshowcmd\{
> \{ =\long macro:
->\ifmmode \lbrace \else \textbraceleft \fi .
Since we are in text mode, \textbraceleft
is expanded:
\show\textbraceleft
> \textbraceleft=macro:
->\OMS-cmd \textbraceleft \OMS\textbraceleft .
This one is harder: one has to know what to show: here it is
\expandafter\show\csname OMS\string\textbraceleft\endcsname
> \OMS\textbraceleft=\char"66.
However first of all LaTeX tries to see if \?\textbraceleft
is defined, which it is:
\expandafter\show\csname ?\string\textbraceleft\endcsname
> \?\textbraceleft=\long macro:
->\UseTextSymbol {OMS}\textbraceleft .
OK. We're at it! LaTeX executes in a group
{\fontencoding{OMS}\selectfont\textbraceleft}
which will print character 0x66
from the selected font. But font substitutions are at the corner: indeed, the current family is LinuxLibertineT-TLF
and there's a message
LaTeX Font Warning: Font shape `OMS/LinuxLibertineT-TLF/m/n' undefined
(Font) using `OMS/ntxsy/m/n' instead
(Font) for symbol `textbraceleft' on input line 7.
because there's no external font corresponding to what's in the first line and so LaTeX uses the default font for the OMS
encoding, which happens to by ntxsy
(NewTXMath, because of your packages). You don't get a warning with the default Computer Modern fonts, because LaTeX knows an OMS/cmr/m/n
font, which is precisely the same as OMS/cmsy/m/n
(look in the file omscmr.fd
to see how this is done).
When the base encoding is T1
, you get a different answer from \show\textbraceleft
, namely
> \textbraceleft=macro:
->\T1-cmd \textbraceleft \T1\textbraceleft .
and now we can do
\expandafter\show\csname T1\string\textbraceleft\endcsname
to get
> \T1\textbraceleft=\char"7B.
so LaTeX prints the character in slot 0x7B
in the current font.
What does the above mean?
The difference is due to the fact that the braces in NewTXMath are slightly different from those in Linux Libertine. The former are used with the OT1 encoding, the latter with T1
.
If I understand your question correctly, then (as has been suggested in comments to the question) I think it is not a standard practice in English to write something like III^{rd}
, let alone using italicized font, and I would suggest you not to use this.
That being said, one way to achieve what you want is to define a command similar to \nth
, but converting the argument to (upper case) Roman numerals. Three options: one, using roman font for the complete expression; another one using slanted font for the numeral and roman font for the superscript, and the third one, using slanted font for the complete expression:
\documentclass{book}
\usepackage[super]{nth}
\def\Rnth#1{{% First print number:
\expandafter\nthM \MakeUppercase{\romannumeral\number#1}\relax
\nthscript{%
\ifnum#1\nthtest0 th\else % negatives are all ``th'' (depending on \nthtest)
\expandafter \nthSuff \expandafter 0\number\ifnum #1<0-\fi#1\delimiter
\fi
}}}
\def\RSnth#1{{% First print number:
\expandafter\nthM \slshape\MakeUppercase{\romannumeral\number#1}\kern1pt\relax
\nthscript{%
\ifnum#1\nthtest0 th\else % negatives are all ``th'' (depending on \nthtest)
\expandafter \nthSuff \expandafter 0\number\ifnum #1<0-\fi#1\delimiter
\fi
}}}
\def\Rsnth#1{{% First print number:
\expandafter\nthM \slshape\MakeUppercase{\romannumeral\number#1}\kern-1pt\relax}
\nthscript{%
\ifnum#1\nthtest0 th\else % negatives are all ``th'' (depending on \nthtest)
\expandafter \nthSuff \expandafter 0\number\ifnum #1<0-\fi#1\delimiter
\fi
}}
\begin{document}
\Rnth{3} is not the same as \nth{3}.
\Rnth{2} is not the same as \nth{2}.
\RSnth{3} is not the same as \nth{3}.
\RSnth{2} is not the same as \nth{2}.
\Rsnth{3} is not the same as \nth{3}.
\Rsnth{2} is not the same as \nth{2}.
\end{document}
If you want the numeral to be in italics shape, replace \slshape
with \itshape
in the corresponding definition(s).
In my opinion, the two options using slanted font look really ugly; please consider not using those.
Best Answer
From Ⅰ to Ⅻ
Libertine and
\libertineGlyph
In my example I use XeLaTeX and
libertineotf
which provides\libertineGlyph
and the glyphs. As stated in my comment, this should work withlibertine-legacy
, too. The newlibertine-type1
andbiolinum-type1
don't support this anymore.This provides two macros:
\libertineRoman{<countername>}
for majuscle, and\libertineroman{<countername>}
for minuscle Roman digits .This approach converts only numbers between 1 and 12 into the special roman digit glyphs.
Code
Output
Unicode (Xe-/LuaLaTeX only)
A solution that uses the whole range of Unicode's Roman digits is already available.