I am preparing a document, which facilitates package fontspec
to define the main- and the sans-font. In that document, I'd like to compare that main font with Computer Modern or—to be precise—it successor Latin Modern.
I was convinced, that writing
\newfontfamily\lmfont{Latin Modern Roman}
would enable the complete family with all its 70+ font files. But that is not correct.
For example, when I say
{\lmfont\scshape{}abcd} {\scshape{}abcd}
I get this:
On the left side the Latin modern font, but without the small caps :-(, on the right hand side, the default ("mainfont") font of the document as it should look like.
For my comparison, I'd like to present a great selection/combination of fonts in this family, i.e. the roman, sans and mono fonts added with shapes and faces like -italic, -italic-bold, -slanted, -slanted-bold, -bold, -smallcaps.
Unfortunately, my solution only loads the LMRoman10-Regular
and LMSans10-Regular
fonts, but not LMRomanCaps10-Regular
. Thats why \lmfont\scshape
(or \lmfont\ttfamily
) didn't work.
So, is there a possibility, to define the \newfamily
that it contains the complete Latin Modern fonts?
Any solution, which enables me, to have a simple macro to compare the two font families side by side would be fine.
Here is a MWE:
\documentclass{scrbook}
\usepackage{fontspec}
\setmainfont{Times New Roman} % and other definitions
\newfontfamily\lmfont{Latin Modern Roman} % this is not complete!!
%% New command to compare.
%% #1 defines the family/shape/series
\newcommand{\compare}[1]{%
{#1%
ABCD \dots{} XYZ, abcd \dots{} xyz\\
\lmfont{}ABCD \dots{} XYZ, abcd \dots{} xyz\par
}
}
\begin{document}
\compare{\upshape}
\compare{\itshape}
\compare{\itshape\bfseries}
\compare{\scshape}
\end{document}