The libertine
package documentation says
It is recommended that the font encoding be set to T1 or LY1 but the default OT1 encoding is also supported.
\documentclass{article}
% \usepackage[T1]{fontenc}
\usepackage[lining, tabular]{libertine}
\usepackage[libertine, cmintegrals]{newtxmath}
\begin{document}
\Huge The \{ stuffing \} 123 $f(x) = \int \sqrt{x}\,dx$
\end{document}
(Using pdflatex
.)
With \usepackage[T1]{fontenc}
:
Without T1:
LaTeX Font Warning: Font shape `OMS/LinuxLibertineT-TLF/m/n' undefined
LaTeX Font Warning: Some font shapes were not available, defaults substituted.
The "Th" ligature is desirable, but the {
and }
characters are wrong without T1. What can I do about this?
(If using XeLaTeX is the only solution, what is the simplest set of packages and settings commands that I need?)
Best Answer
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 aT1
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 thatxpatch
is loaded for\xshowcmd
:Since we are in text mode,
\textbraceleft
is expanded:This one is harder: one has to know what to show: here it is
However first of all LaTeX tries to see if
\?\textbraceleft
is defined, which it is:OK. We're at it! LaTeX executes in a group
which will print character
0x66
from the selected font. But font substitutions are at the corner: indeed, the current family isLinuxLibertineT-TLF
and there's a messagebecause 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 byntxsy
(NewTXMath, because of your packages). You don't get a warning with the default Computer Modern fonts, because LaTeX knows anOMS/cmr/m/n
font, which is precisely the same asOMS/cmsy/m/n
(look in the fileomscmr.fd
to see how this is done).When the base encoding is
T1
, you get a different answer from\show\textbraceleft
, namelyand now we can do
to get
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
.