7

I'm using the Alegreya font in XeLaTeX and, after scouring the fontspec documentation, I can't figure out how to specify the bold small caps font (not to mention the italic small caps). I feel like the answer is right under my nose, I just can't quite find it. The font definitely has bold small caps, as shown on page three here.

%XeLaTeX
\documentclass{report}
\usepackage{fontspec}
\setmainfont[   
    SmallCapsFont={AlegreyaSC-Regular},
    SmallCapsFeatures={Letters=SmallCaps},
    Ligatures=TeX]{Alegreya}

\begin{document}
\textsc{Small Capitals!}

\textbf{\textsc{Bold Small Capitals?}}
\end{document}

And while we're at it, what's the purpose of

SmallCapsFeatures={Letters=SmallCaps}

It seems to make no difference in my larger file.

0

2 Answers 2

11

In this case, Letters=SmallCaps is irrelevant as Alegreya SC only has small caps. In other cases, when a “normal” font is used, this option will enable the +smcp feature when choosing the font.

You have to add suitable declarations also for bold, italic and bold italic.

\documentclass{report}
\usepackage{fontspec}
\setmainfont[
  UprightFeatures={SmallCapsFont=AlegreyaSC-Regular},
  ItalicFeatures={SmallCapsFont=AlegreyaSC-Italic},
  BoldFeatures={SmallCapsFont=AlegreyaSC-Bold},
  BoldItalicFeatures={SmallCapsFont=AlegreyaSC-BoldItalic},
  Ligatures=TeX,
]{Alegreya}

\begin{document}
\textbf{Normal boldface}

\textsc{Small Capitals}

\textsc{\textit{Italic Small Capitals}}

\textbf{\textsc{Bold Small Capitals}}

\textbf{\textsc{\textit{Bold Italic Small Capitals}}}

\end{document}

enter image description here

Of course, this doesn't mean I endorse usage of boldface small capitals.

3
  • With this real example, it becomes very evident what was meant in section 5.1.2 in the fontspec manual. I'd wish they wrote it a bit more clearly like you did here.
    – Sverre
    Mar 31, 2015 at 19:37
  • I'm glad I'm not the only one confused with the fontspec documentation, but this is perfect! It also works smoothly with the titlesec changes I've made. Thanks so much! And I too do not endorse the use of bold small caps, I just wanted to cover all of my bases now so I didn't have to worry about it if it ever came up. Mar 31, 2015 at 19:42
  • If I could upvote your last comment separately, I would :D
    – thymaro
    Jul 20, 2017 at 1:07
2

The fontspec manual addresses this in section 5.1.2, but I don't fully understand what they're writing there. One way to accomplish what you want is done below, where I've redefined \textsc to a new font family that picks out the Alegreya Small Caps font.

\documentclass{article}
\usepackage{fontspec}
    \setmainfont{Alegreya}
    \newfontfamily\AlegreyaSC{Alegreya SC}
    \renewcommand{\textsc}[1]{{\AlegreyaSC#1}}
\begin{document}
Alegreya
\textsc{Alegreya}
\textbf{\textsc{Alegreya}}
Alegreya
\end{document}

enter image description here

1
  • This worked, but it did cause some errors with some titlesec adjustments I made. But thanks for the help! Mar 31, 2015 at 19:43

You must log in to answer this question.

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