Text FormattingGlossary - description italic

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
billlima
Posts: 2
Joined: Fri Jul 17, 2020 1:15 am

Glossary - description italic

Post by billlima »

Hi, how I set the description of glossary items to italic on glossary and in first use on text, only description, not abbreviation? And how i set individually?

Example:

Code: Select all

\documentclass{article}
\usepackage[acronym]{glossaries}
 
\makeglossaries

\newacronym{sa}{SA}{Sample Acronym}
\newacronym{dof}{DOF}{Degrees of Freedom}

\printglossary[type=acronym,style=super]

\vspace{20}
\begin{document}
 
This is a \gls{sa} while another one will be \gls{dof}.
Recurrences are \gls{sa} and \gls{dof}.

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Glossary - description italic

Post by Bartman »

The desired change can be set using the glossaries-extra package.

The following example shows one possible approach.

Code: Select all

\documentclass{article}
\usepackage[automake, acronym]{glossaries-extra}
     
\makeglossaries

\setabbreviationstyle[acronym]{long-short}
    
\glssetcategoryattribute{acronym}{glossdescfont}{emph}

\renewcommand*{\glsfirstlongdefaultfont}[1]{\emph{#1}}
     
\newacronym{sa}{SA}{Sample Acronym}
\newacronym{dof}{DOF}{Degrees of Freedom}
     
\begin{document}
\printacronyms[style=super]
    
\section{Heading}
This is a \gls{sa} while another one will be \gls{dof}.
Recurrences are \gls{sa} and \gls{dof}.
\end{document}
billlima
Posts: 2
Joined: Fri Jul 17, 2020 1:15 am

Glossary - description italic

Post by billlima »

thanks man, worked perfectly!
Post Reply