1

I am trying to have a mix of small caps and lower case italic abbreviations/acronyms in thesis. I am using glossaries-extra and trying to create a new abbreviation category 'acronymLC', however when I change the style for one category it seems to override the style in the text. I have provided a MWE:

\documentclass{article}
\usepackage[automake,acronym,nomain,shortcuts=other]{glossaries-extra}
\makeglossaries
\setabbreviationstyle[acronym]{short-sc-desc}
\setabbreviationstyle[acronymLC]{short-em-desc}
\renewcommand*{\glsxtrscfont}[1]{\normalfont\textsc{\MakeLowercase{#1}}}
\newcommand*{\glsxtremfont}[1]{\normalfont\textit{\normalfont #1}}
\newacronym[description={I want this to be small caps but \gls{def} should be lower case italics}]{abc}{abc}{Alpha Bravo Charlie}
\newabbreviation[category=acronymLC,description={I want this to be lower case italics but \gls{abc} should be small caps.}]{def}{def}{delta echo foxtrot}
\begin{document}
I have two acronyms \gls{abc} and \gls{def}. I would like the first to be small caps and the second to be lower case italics.
\printglossaries
\end{document}

Also I want to get rid of the bold font in the glossary, this has been answered before but I think I am making a mistake in implementing it.

enter image description here

1

I think there's a combination of problems here. The first may be a bug in the short-sc-desc style which can be fixed with:

\renewabbreviationstyle{short-sc-desc}
{%
  \renewcommand*{\CustomAbbreviationFields}{%
    name={\protect\glsxtrinlinefullformat{\the\glslabeltok}{}},
    sort={\the\glsshorttok},
    first={\protect\glsxtrfirstscfont{\the\glsshorttok}},
    firstplural={\protect\glsxtrfirstscfont{\the\glsshortpltok}},
    text={\protect\glsxtrscfont{\the\glsshorttok}},
    plural={\protect\glsxtrscfont{\the\glsshortpltok}},
    description={\the\glslongtok}}%
  \renewcommand*{\GlsXtrPostNewAbbreviation}{%
    \glssetattribute{\the\glslabeltok}{regular}{true}}%
}
{%
  \GlsXtrUseAbbrStyleFmts{short-desc}%
  \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}%
  \renewcommand*\glsabbrvfont[1]{\glsxtrscfont{##1}}%
  \renewcommand*\glsfirstabbrvfont[1]{\glsxtrfirstscfont{##1}}%
}

There's no command \glsxtremfont provided by glossaries-extra so your definition

\newcommand*{\glsxtremfont}[1]{\normalfont\textit{\normalfont #1}}

isn't used. (My fault for not using a more consistent naming scheme. I think it came from adding the em style later and not comparing it with the sc and sm styles.) It also counteracts the effect of \textit with \normalfont. I think you perhaps intended:

\renewcommand*{\glsabbrvemfont}[1]{\normalfont\textit{#1}}

The other problem is related to the \gls in the description. I'm not sure why it's occurring here. It's not exactly a nested link but seems to be exhibiting the same kind of behaviour. It can be fixed by changing \gls to \glsps (short form) or \glspt (text form). With this particular style there's no real difference between \glsps and \glspt.

Here's the complete example:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[automake,acronym,nomain,shortcuts=other]{glossaries-extra}
\makeglossaries

\renewabbreviationstyle{short-sc-desc}
{%
  \renewcommand*{\CustomAbbreviationFields}{%
    name={\protect\glsxtrinlinefullformat{\the\glslabeltok}{}},
    sort={\the\glsshorttok},
    first={\protect\glsxtrfirstscfont{\the\glsshorttok}},
    firstplural={\protect\glsxtrfirstscfont{\the\glsshortpltok}},
    text={\protect\glsxtrscfont{\the\glsshorttok}},
    plural={\protect\glsxtrscfont{\the\glsshortpltok}},
    description={\the\glslongtok}}%
  \renewcommand*{\GlsXtrPostNewAbbreviation}{%
    \glssetattribute{\the\glslabeltok}{regular}{true}}%
}
{%
  \GlsXtrUseAbbrStyleFmts{short-desc}%
  \renewcommand*{\abbrvpluralsuffix}{\protect\glsxtrscsuffix}%
  \renewcommand*\glsabbrvfont[1]{\glsxtrscfont{##1}}%
  \renewcommand*\glsfirstabbrvfont[1]{\glsxtrfirstscfont{##1}}%
}

\renewcommand*{\glsxtrscfont}[1]{\normalfont\textsc{\MakeLowercase{#1}}}
\renewcommand*{\glsabbrvemfont}[1]{\normalfont\textit{#1}}

\setabbreviationstyle[acronym]{short-sc-desc}
\setabbreviationstyle[acronymLC]{short-em-desc}

\newacronym[description={I want this to be small caps but \glsps{def}
should be lower case italics}]{abc}{abc}{Alpha Bravo Charlie}

\newabbreviation[category=acronymLC,description={I want this to be
lower case italics but \glsps{abc} should be small
caps.}]{def}{def}{delta echo foxtrot}

\begin{document}
I have two acronyms \gls{abc} and \gls{def}. I would like the first
to be small caps and the second to be lower case italics.
\printglossaries
\end{document}

This produces:

image of document

  • Thanks Nicola, this is fantastic. The glossaries-extra manual did mention glsxtremfont multiple times which is why I attempted to use it. – Jonathan Brodrick Jul 31 '17 at 15:24
  • 1
    @JonathanBrodrick Thanks for pointing it out. I'm sorry about the confusion. I'll get the manual fixed. – Nicola Talbot Jul 31 '17 at 15:28

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.