I am working on a document, which uses the fontspec
package to ensure the usage of company fonts for main font, sans-serif font and monospaced font. That is working fine.
\usepackage{fontspec}
\setmainfont[
ItalicFont={Hoefler Text Regular Italic},
SmallCapsFont={Hoefler Text Roman SC},
BoldFeatures={
SmallCapsFont={Hoefler Text Bold SC}
},
ItalicFeatures={
SmallCapsFont={Hoefler Text Regular Italic SC}
},
BoldItalicFeatures={
SmallCapsFont={Hoefler Text Bold Italic SC}
},
]{Hoefler Text}
\usepackage{biolinum}
\setsansfont[
Numbers=OldStyle,
BoldFont={LinBiolinumOB},
ItalicFont={LinBiolinumOI},
BoldItalicFont={LinBiolinumOBO},
]{LinBiolinumO}
\usepackage{sourcecodepro}
The problem is, I also need passages being set in "Computer Modern" font. Therefore I added the following to my preamble:
\newcommand*{\computermodern}{\fontfamily{cmr}\selectfont}
\newenvironment{cmfont}{\fontfamily{cmr}\selectfont}{\par}
\DeclareTextFontCommand{\textcm}{\computermodern}
The passages, put between \begin{cmfont}
and \end{cmfont}
are set in Computer Modern font, but additional format information like italic, slanted, bold, etc. is ignored. How can I also achieve this?
Thanks in advance.