2

Suppose in my .tex document I invoke for the first time \gls{ip}, which based on my definition results in the text:

Internet Protocol (IP)

Is there any way to quote (or italicize) just the long form of the term, to achieve a result like:

"Internet Protocol" (IP)

I know using something like ''\gls{ip}'' I can achieve a result like:

"Internet Protocol (IP)"

...but in this case both the the long form of the term and the acronym end up inside of the quotation marks.

0
2

Since there is not much information on the setup of the glossary, I used some standard command to enquote the long term description.

\documentclass{article}


\usepackage[english]{babel}
\usepackage[babel,style=english]{csquotes}
\usepackage{glossaries}

\newcommand{\doquotes}[1]{\enquote{#1}}

\makeglossaries


\newglossaryentry{IP}{%
  name={IP},
  description={\doquotes{Internet Protocol}}
}%


\begin{document}
 \glsaddall

\printglossaries
\end{document}

Compile with

pdflatex foo.tex ; makeglossaries -o foo.gls foo.glo

4

You can simply use LaTeX quotes, e.g.

\newacronym{ip}{IP}{``Internet Protocol''}

MWE:

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

\makeglossaries

\newacronym{ip}{IP}{``Internet Protocol''}

\begin{document}
First use \gls{ip} 

Second use \gls{ip}

\printglossaries
\end{document} 

Output:

enter image description here

4

I suggest you create a new acronym style. You can do so by writing something like the following:

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

\newacronymstyle{enquote-long-short}
{%
  \GlsUseAcrEntryDispStyle{long-short}%
}
{%
  \GlsUseAcrStyleDefs{long-short}%
  \renewcommand*{\genacrfullformat}[2]{%
   \enquote{\glsentrylong{##1}##2}\space
   (\glsentryshort{##1})%
  }%
  \renewcommand*{\Genacrfullformat}[2]{%
   \enquote{\Glsentrylong{##1}##2}\space
   (\glsentryshort{##1})%
  }%
  \renewcommand*{\genplacrfullformat}[2]{%
   \enquote{\glsentrylongpl{##1}##2}\space
   (\glsentryshortpl{##1})%
  }%
  \renewcommand*{\Genplacrfullformat}[2]{%
   \enquote{\Glsentrylongpl{##1}##2}\space
   (\glsentryshortpl{##1})%
  }%
}

\setacronymstyle{enquote-long-short}
\makeglossaries

\newacronym{ip}{IP}{Internet Protocol}

\begin{document}
First use of \gls{ip}, second use of \gls{ip}.
\end{document}

This produces the following result:

First use of "Internet Protocol" (IP), second use of IP.

1
  • 1
    I think this is the best answer since it separates the style from the entry definitions. It will make it a lot easier if you decide to change the style at a later date. (Assuming you want this style for all abbreviations rather than one specific entry.) – Nicola Talbot Nov 7 '15 at 22:01

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.