I'm using the glossaries package to define a glossary. However, I would like all \gls{} references to appear in italic. Is there any way to do this without adding \it everywhere?
1 Answer
Redefine \glstextformat
:
\documentclass{article}
\usepackage{glossaries}
\newglossaryentry{sample}{name={sample},description={an example}}
\renewcommand{\glstextformat}[1]{\textit{#1}}
\begin{document}
\gls{sample}.
\end{document}
-
1This creates an unusual look, where italicized parentheses may surround a non-italicized acronym. Can anyone recommend a way to either italicize the acronym too, or de-italicize the parentheses? Apr 28, 2016 at 9:30
-
@barnhillec Try redefining
\acronymfont
to make the acronym italicized. It depends on whether you're using one of the acronym styles (using\setacronymstyle
). It might be worth asking a separate question if you want regular entries formatted differently to acronyms. Apr 28, 2016 at 13:44 -
Actually, it looks as though the linked question Different formatting for acronyms and glossary entries might be appropriate. Apr 28, 2016 at 13:47
\documentclass...
and ending with...\end{document}
to the post? It would help solvers tremendously when they try to solve it.