17

I am using the glossaries package to generate the glossary in my report.

However, I am using the entries first time in a Table where it is expanding in the form (Description).

I would like to suppress the expansion where I do not find it necessary for the expansion even though it is the first occurance.

I am using \gls{<label>}. Any idea how to do it ?

Currently, as a solution, I am just using the abbreviations in the table without the reference to glossary.

Thanks

17

Simply use \glsunset{<label>} or \glsunsetall before you reference an acronym the first time. Furthermore, use \glsreset{<label>} or \glsresetall to re-enable full acronym expansion afterwards. For example:

\documentclass{article}

\usepackage{glossaries}

\makeglossaries

\newacronym{OA}{OA}{One Acronym}
\newacronym{TA}{TA}{Two Acronyms}

\begin{document}

\noindent
\glsunsetall
\gls{OA}, \gls{TA}\\
\glsresetall
\gls{OA}, \gls{TA}\\
\gls{OA}, \gls{TA}

\printglossaries

\end{document}
|improve this answer|||||
11

I would recommend \acrshort{label} which will only print the abbreviation of the acronym, even if it is the first occurrence.

Example:

\documentclass[letterpaper]{article}  
\usepackage{hyperref}
\usepackage{glossaries} 
\makeglossaries

\newacronym{NFL}{NFL}{National Football League}

\begin{document}

First use: \acrshort{NFL}

Second use: \gls{NFL}

\printglossaries

\end{document}

Result:

enter image description here

|improve this answer|||||
  • 2
    This is the perfect solution for use in captions and tables as it expands the acronym when used later on in the main text. – t.animal Aug 10 '17 at 20:38
7

Instead of using \gls{<label>} you could use \glsdisp{<label>}{<text>} to display <text>. A little example:

\documentclass[letterpaper]{article}  
\usepackage{hyperref}
\usepackage{glossaries} 
\makeglossaries

\newacronym{am}{A.M.}{Ante Meridiem}
\newacronym{pm}{P.M.}{Post Meridiem}

\begin{document}

First use: \glsdisp{am}{A.M.} \gls{pm}

Second use: \gls{am} \gls{pm}

\printglossaries

\end{document}

enter image description here

|improve this answer|||||
3

The glossaries package offers several options for this directly. See the User manual for v3.01, Section 13. For example, if you pass the package option footnote, the expansion will occur in a footnote rather than (between braces).

For more advanced options, look into Section 13.3, "Defining A Custom Acronym Style".

To get nothing at all, I added to my preamble:

\renewcommand*{\CustomAcronymFields}{%
name={\the\glsshorttok},%
description={\the\glslongtok},%
text={\the\glsshorttok},%
plural={\the\glsshorttok}\noexpand\acrpluralsuffix%
}
\renewcommand*{\SetCustomDisplayStyle}[1]{%
\defglsdisplayfirst[#1]{##1##4}
\defglsdisplay[#1]{##1##4}}
\SetCustomStyle

A full working example:

\documentclass[12pt,a4paper]{article}
\author{Gerrit Holl}
\usepackage[acronym]{glossaries}
\makeglossaries
\renewcommand*{\CustomAcronymFields}{%
name={\the\glsshorttok},%
description={\the\glslongtok},%
text={\the\glsshorttok},%
plural={\the\glsshorttok}\noexpand\acrpluralsuffix%
}
\renewcommand*{\SetCustomDisplayStyle}[1]{%
\defglsdisplayfirst[#1]{##1##4}
\defglsdisplay[#1]{##1##4}}
\SetCustomStyle
\newacronym{NPP}{NPP}{National Partnership Program}
\newacronym{EOS}{EOS}{Earth Observing System}
\newacronym{POES}{POES}{Polar Orbiting Environmental Satellites}
\newacronym{NASA}{NASA}{National Aeronautics and Space Administration}
\begin{document}
\gls{NPP} is a bridge from \gls{EOS}, \gls{POES} to the next generation of
\gls{NASA} satellites.
\printglossaries
\end{document}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.