0

I use \setmainfont{CMU Serif} to change the font. But CMU Serif doesn’t support small caps emphasis font as you can see with the following MWE:

\documentclass[a5paper,10pt,twoside,french]{book}
\usepackage{fontenc}
\usepackage{fontspec}

\setmainfont{CMU Serif}

\begin{document}

\textsl{\textsc{gnu}'s not Unix} (\verb|\textsl{}|)   \par
\textit{\textsc{gnu}'s not Unix} (\verb|\textit{}|)   \par
\emph{GNU: \textsc{gnu}'s not Unix}   (\verb|\emph{}|)

\end{document}

Witch produce the following rendering:

Rendering of the MWE

But the default font (witch seems to be European Computer Modern) produce a well render according to this tread.

So is theire a way to set European Computer Modern just for small caps inside emphasis context (or reverse)?

1
  • the default font in lualatex is Latin Modern Commented Sep 24, 2022 at 10:26

3 Answers 3

2

You can slant the upright small caps

enter image description here

\documentclass[a5paper,10pt,twoside,french]{book}
%%%\usepackage{fontenc}
\usepackage{fontspec}


\setmainfont{CMU Serif}[ItalicFeatures= {
SmallCapsFont={CMU Serif},
SmallCapsFeatures={Letters=SmallCaps,FakeSlant=0.2} }]



\begin{document}

\textsl{\textsc{gnu}'s not Unix} (\verb|\textsl{}|)   \par
\textit{\textsc{gnu}'s not Unix} (\verb|\textit{}|)   \par
\emph{GNU: \textsc{gnu}'s not Unix}   (\verb|\emph{}|)

\end{document}

Or use Latin Modern small caps enter image description here

\documentclass[a5paper,10pt,twoside,french]{book}
%%%\usepackage{fontenc}
\usepackage{fontspec}


\setmainfont{CMU Serif}[ItalicFeatures= {
SmallCapsFont=LMRomanCaps10-Oblique}]



\begin{document}

\textsl{\textsc{gnu}'s not Unix} (\verb|\textsl{}|)   \par
\textit{\textsc{gnu}'s not Unix} (\verb|\textit{}|)   \par
\emph{GNU: \textsc{gnu}'s not Unix}   (\verb|\emph{}|)

\end{document}
4
  • Hmm… The slanting still ugly. It’s not a real emphasis. But we could use European Compuuter Modern for all small caps.
    – fauve
    Commented Sep 24, 2022 at 12:48
  • ec fonts are not Unicode encoded opentype so would take some more setup and some lack of warning about incorrect character if you used non ascii letters Commented Sep 24, 2022 at 12:52
  • 1
    I found a solution working with Latin Modern as described here tex.stackexchange.com/questions/79086/… with LMRomanCaps10-Oblique instead of ec.
    – fauve
    Commented Sep 24, 2022 at 13:25
  • @fauve ah I tried LM but fontspec didn't find the right font automatically: specifying that variant explicitly works as you say, I added it above Commented Sep 24, 2022 at 15:08
1

If you just need slanted/italic small caps for Latin letters, you can substitute with Latin Modern:

\documentclass[a5paper,10pt,twoside]{book}

\usepackage{fontspec}

\setmainfont{CMU Serif}[
  SlantedFont=CMU Serif Roman Slanted,
  UprightFeatures={SmallCapsFont=LMRomanCaps10-Regular},
  ItalicFeatures={SmallCapsFont=LMRomanCaps10-Oblique},
  SlantedFeatures={SmallCapsFont=LMRomanCaps10-Oblique},
]

\begin{document}

\textsl{\textsc{gnu}'s not Unix} (\verb|\textsl{}|)

\textit{\textsc{gnu}'s not Unix} (\verb|\textit{}|)

\emph{GNU: \textsc{gnu}'s not Unix}   (\verb|\emph{}|)

\end{document}

enter image description here

-1

Maybe we can fake \textsc.

\documentclass{book}

\usepackage{fontspec}

\setmainfont{CMU Serif}

\begin{document}

\textsl{\textsc{gnu}'s not Unix} (\verb|\textsl{}|) \par
\textit{\textsc{gnu}'s not Unix} (\verb|\textit{}|) \par
\emph{\textsc{gnu}'s not Unix} (\verb|\emph{}|)

\textsl{\textup{G{\scriptsize NU}}'s not Unix} (\verb|\textsl{}|) \par
\textit{\textup{G{\scriptsize NU}}'s not Unix} (\verb|\textit{}|) \par
\emph{\textup{G{\scriptsize NU}}'s not Unix} (\verb|\emph{}|)

\textsl{G{\scriptsize NU}'s not Unix} (\verb|\textsl{}|) \par
\textit{G{\scriptsize NU}'s not Unix} (\verb|\textit{}|) \par
\emph{G{\scriptsize NU}'s not Unix} (\verb|\emph{}|)

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .