[Tex/LaTex] What does \renewcommand*{\rmdefault}{fxlj} exactly do

boldfontsformattinglibertineroman

I'm writing a document with multiple hundred of pages and noticed some glitches with the selected font I use. I'm using a template provided by the institute I'm working at. The font I have chosen is libertine.

This is – what I could break down – a minimal working example of Libertine in action:

\documentclass{article}
  \usepackage{libertine}
\begin{document}
   \noindent This text is \textbf{bold}.
   \section{Minimal working example}
   This text \textit{isn't}.
\end{document}

Now, however, does the class definition file of my template include another statement that I can not comprehend, and – breaks everything font related:

  \renewcommand*{\rmdefault}{fxlj}

This causes the default font to be reset to Roman, which I do not want. And sometimes the font is not default Roman, but Libertine. However, bold and italic Libertine is not working anymore.

This is the most basic minimal not working example I could come up with:

\documentclass{article}
  \usepackage{libertine}
  \renewcommand*{\rmdefault}{fxlj}
\begin{document}
   \noindent This text is \textbf{bold}.
   \section{Minimal not working example}
   This text \textit{isn't}.
\end{document}

Now, I want to understand what the \renewcommand*{\rmdefault}{fxlj} command exactly does, and – important – what the intention is. Simply removing it seems to fix my issue, but I can't do this unless I understand the implications.

Best Answer

This is a consequence of using low level commands in documents instead of packages.

When you compile your document, you get the warnings

LaTeX Font Warning: Font shape `OT1/fxlj/m/n' undefined
(Font)              using `OT1/cmr/m/n' instead on input line 4.


LaTeX Font Warning: Font shape `OT1/fxlj/b/n' undefined
(Font)              using `OT1/fxlj/m/n' instead on input line 5.


LaTeX Font Warning: Font shape `OT1/fxlj/m/it' undefined
(Font)              using `OT1/fxlj/m/n' instead on input line 7.

The first warning tells you that the family fxlj corresponds to no .fd file for the OT1 encoding, so a default substitution is made, with the standard cmr family. The other two might be misleading if one doesn't take into consideration the fact that LaTeX has already decided that fxlj becomes cmr.

The naming scheme suggests that fxlj should point to Linux Libertine with oldstyle digits (the trailing j), but the family name has changed over time. Nowadays the font family for Linux Libertine is called

LinuxLibertineT-<suffix>

The suffix can be

TLF
TOsF
LF
OsF

where LF stands for “lining figures” and OsF for “oldstyle figures”; the T means “tabular figures”, if absent it means that proportional figures are used.

Thus with Linux Libertine it's a bad idea to set directly the family name: better use the higher level calls:

\usepackage[
  %tabular,
  %proportional,
  %lining,
  %oldstyle,
]{libertine}

Uncomment the keys you need.