0

I am using the glossaries package for acronyms. When first using an acronym using \gls{}, the entry is written as long form and the short form follows in parentheses. Sometimes, these are followed by parentheses already occuring in the sentence. Is there a way to merge the parentheses created by glossaries and the following one in the sentence? (For the acro package, this was apparently solved here.)

\documentclass[12pt]{article}
\usepackage{glossaries}
\newacronym{SX}{SX}{Stack Exchange}
\makeglossaries
\begin{document}
Hello \gls{SX} (tex.stackexchange.com)!
\end{document}

Actual result: Hello Stack Exchange (SX) (tex.stackexchange.com)!
Desired result: Hello Stack Exchange (SX, tex.stackexchange.com)!

The goal is to eliminate back-to-back parentheses caused by glossaries.

drat
  • 1
  • I suggest rewriting the „Hello“ sentence, e.g. by putting the URL into a footnote, expanding its parentheses into a sentence or similar. – MS-SPO Oct 05 '23 at 03:39
  • Thanks, but not appropriate in my use case. I have edited to include the desired result. – drat Oct 05 '23 at 08:16
  • Thanks, that edit helps. However, it's still not clear enough: 1) what shall happen at the 2nd and more calls to \gls{SX}? 2) You wrote "sometimes" ... So what are the use cases all together? Can you please expand your desired result(s) with all variations in mind? Thank you – MS-SPO Oct 05 '23 at 08:54
  • There are no more variations. The goal is to eliminate back-to-back parentheses caused by glossaries. – drat Oct 05 '23 at 09:02

0 Answers0