How can I redefine the standard font size commands (\small
, \normalsize
, \large
, etc.) when using LuaLaTeX and fontspec?
From what I read after searching online, I did the following:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Calibri}
\renewcommand{\footnotesize}{\fontsize{9bp}{11bp}\selectfont}
\renewcommand{\small}{\fontsize{10bp}{12bp}\selectfont}
\renewcommand{\normalsize}{\fontsize{11bp}{13bp}\selectfont}
\renewcommand{\large}{\fontsize{13bp}{15bp}\selectfont}
\usepackage{soul}
\begin{document}
% HEADING
\begin{flushleft}\small
Keywords: some, relevant, words, here.
\end{flushleft}
\begin{center}\large
\textbf{The title is very important}\\[1ex]
\ul{A. U. Thor}\footnote{An address, Country}
\end{center}
% MAIN TEXT
filler filler filler filler filler filler filler filler
filler filler filler filler filler filler filler filler filler
filler filler
\end{document}
It does compile quite well, using the Calibri font I have installed. However, I then get the following warnings (absent if the redefinitions are not present):
LaTeX Font Warning: Font shape `TU/Calibri(1)/m/n' undefined
(Font) using `TU/lmr/m/n' instead on input line 13.
(load luc: /home/equaeghe/.texlive/texmf-var/luatex-cache/generic/font/otl/lmroman12-regular.luc)
LaTeX Font Warning: Font shape `OML/cmm/m/it' in size <13.04874> not available
(Font) size <12> substituted on input line 20.
LaTeX Font Warning: Font shape `OML/cmm/m/it' in size <6.52437> not available
(Font) size <7> substituted on input line 20.
LaTeX Font Warning: Font shape `OMS/cmsy/m/n' in size <13.04874> not available
(Font) size <12> substituted on input line 20.
LaTeX Font Warning: Font shape `OMS/cmsy/m/n' in size <6.52437> not available
(Font) size <7> substituted on input line 20.
LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <13.04874> not available
(Font) size <12> substituted on input line 20.
LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <6.52437> not available
(Font) size <7> substituted on input line 20.
LaTeX Font Warning: Font shape `OML/cmm/m/it' in size <4.51686> not available
(Font) size <5> substituted on input line 20.
LaTeX Font Warning: Font shape `OMS/cmsy/m/n' in size <4.51686> not available
(Font) size <5> substituted on input line 20.
LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <4.51686> not available
(Font) size <5> substituted on input line 20.
LaTeX Font Warning: Size substitutions with differences
(Font) up to 1.04874pt have occurred.
LaTeX Font Warning: Some font shapes were not available, defaults substituted.
I think
- that no reference to
lmr
andcm
should be there, and - that there should be a way to get (closer to) the actual sizes I request.
\usepackage{fix-cm}
. Anyway, the reference toCalibri(1)
seems to point to something you have not shown in the example.\footnotesize
and friends are too simplistic.\usepackage{fix-cm}
fixed the warnings. Can you add an answer with that and (pointer to) information about properly redefining\small
and friends? I can then accept that answer.