# Glossaries and fake small caps using fontspec

I want to use faked small caps when doing a list of abbreviations using the glossaries package. I am using another font but for reproducibility purposes in this example I have used Linux Libertine O. To make things clearer I have also exaggerated the scaling factor in this example. For some reason it seems sometimes my \smallCaps command works fine but in this case it doesn't go back again. What am I doing wrong?

\documentclass{memoir}

\usepackage{glossaries}
\usepackage{fontspec}

\newcommand{\smallCaps}[1]{%
{\fontspec[Scale=0.5]{Linux Libertine O} #1}%
}

\setacronymstyle{long-short}
\begin{document}

%ABBREVIATIONS

\setmainfont{Linux Libertine O}
Works \smallCaps{FOO} does not work: \gls{ADR}). A more specific definition
for the term \gls{ADR} is

\end{document}


• Feb 18 '15 at 15:31

You should never use \fontspec inside the document; it's a generic command used by the user level commands \setmainfont, \newfontfamily and similar. Also \setmainfont should only be used in the preamble.

I removed the \setmainfont declaration just to show how the font is chosen independently of the main font. The key is to use the short key in \newacronym.

\documentclass{memoir}

\usepackage{glossaries}
\usepackage{fontspec}

\newcommand{\smallCaps}[1]{%
{\fontspec[Scale=0.5]{Linux Libertine O} #1}%
}

\setacronymstyle{long-short}
\begin{document}

%ABBREVIATIONS

\setmainfont{Linux Libertine O}
Works \smallCaps{FOO} does not work: \gls{ADR}). A more specific definition
for the term \gls{ADR} is

\end{document}


On the other hand, a better strategy (assuming you have no other way to produce small caps) is to add it in the font definition:

\documentclass{memoir}

\usepackage{fontspec}
\usepackage{glossaries}

\makeglossaries

\setmainfont{Latin Modern Roman}[
SmallCapsFont={Linux Libertine O},
SmallCapsFeatures={Scale=0.5},
]

\setacronymstyle{long-short}
\begin{document}

%ABBREVIATIONS
\newacronym[

Works \textsc{FOO} does not work: \gls{ADR}). A more specific definition
for the term \gls{ADR} is

\printglossaries

\end{document}


Finally, the best strategy if you don't have real small caps is to avoid them altogether.

• Sadly it doesn't seem to play nice together with fakeslant though... :( Feb 18 '15 at 15:59
• @jonalv Don't fake. ;-) Above all, don't use slanted type. Feb 18 '15 at 15:59
• I use them to mark strange commercial names on things which I want to mark somewhat in the text to make it clear that "Yes it's actually called that, don't blame me" :) Feb 18 '15 at 16:02
• @jonalv Please, open a new question with a detailed example. Feb 18 '15 at 16:04