3

When I use \acrshort or alike, my text does not have the acronym in it but only ().

This is my test code:

\RequirePackage{filecontents}

\begin{filecontents*}{glossaries-generic.tex}
\newglossaryentry{label-glossary-realnumber}{
  name={real number},
  description={
    include both rational numbers, such as $42$ and $\frac{-23}{129}$, and
    irrational numbers, such as $\pi$ and the square root of two; or, a real
    number can be given by an infinite decimal representation, such as
    $2.4871773339\ldots$ where the digits continue in some way; or, the real
    numbers may be thought of as points on an infinitely long number line
  },
  symbol={\ensuremath{\mathbb{R}}}
}
\end{filecontents*}

\begin{filecontents*}{acronyms-generic.tex}
\newglossaryentry{label-acronym-hbci}{
  type=\acronymtype,
  name={HBCI},
  description={Cascading Style Sheets},
  first={Home Banking Computer Interfaces (HBCI)}
}
\end{filecontents*}

\documentclass[
   final,
   12pt,
   a4paper,
   oneside
]{book}

\usepackage[acronym, nopostdot, toc, xindy]{glossaries}
\makeglossaries %% Add \makeglossaries to your preamble (before you start defining your entries)
\input{glossaries-generic}
\input{acronyms-generic}
%% Glossaries End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
If you just want to print the abbreviation use : \acrshort{label-acronym-hbci}
For glossaries use {\textbackslash}gls like so: \gls{label-glossary-realnumber}

\backmatter
%% debug for http://comments.gmane.org/gmane.comp.tex.live/33611 BEGIN
%% INFO IN /help/bugfix/printglossaries-bug/*
\def\findrootlanguage{%
   \def\rootlanguagename{\languagename}%
}
%% debug for http://comments.gmane.org/gmane.comp.tex.live/33611 END

\printglossary[type=\acronymtype, title=Acronyms\, Terms and Abbreviations, toctitle=Acronyms\, Terms and Abbreviations]
\printglossary[style=altlist, title=Glossary, toctitle=Glossary]

\end{document}
1
  • Does my answer solve your issue? Mar 30, 2015 at 19:00

1 Answer 1

4

\acrshort is meant to be used with acronyms (those defined with \newacronym), and not with normal glossary entries (those defined with \newglossaryentry).

So you should define

\newacronym[first={Home Banking Computer Interfaces (HBCI)}]
    {label-acronym-hbci}{HBCI}{Cascading Style Sheets}

instead of

\newglossaryentry{label-acronym-hbci}{
  type=\acronymtype,
  name={HBCI},
  description={Cascading Style Sheets},
  first={Home Banking Computer Interfaces (HBCI)}
}

MWE:

\RequirePackage{filecontents}

\begin{filecontents*}{glossaries-generic.tex}
\newglossaryentry{label-glossary-realnumber}{
  name={real number},
  description={
    include both rational numbers, such as $42$ and $\frac{-23}{129}$, and
    irrational numbers, such as $\pi$ and the square root of two; or, a real
    number can be given by an infinite decimal representation, such as
    $2.4871773339\ldots$ where the digits continue in some way; or, the real
    numbers may be thought of as points on an infinitely long number line
  },
  symbol={\ensuremath{\mathbb{R}}}
}
\end{filecontents*}

\begin{filecontents*}{acronyms-generic.tex}
\newacronym[first={Home Banking Computer Interfaces (HBCI)}]
    {label-acronym-hbci}{HBCI}{Cascading Style Sheets}
\end{filecontents*}

\documentclass[
   final,
   12pt,
   a4paper,
   oneside
]{book}

\usepackage[acronym, nopostdot, toc, xindy]{glossaries}
\makeglossaries %% Add \makeglossaries to your preamble (before you start defining your entries)
\input{glossaries-generic}
\input{acronyms-generic}
%% Glossaries End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
If you just want to print the abbreviation use : \acrshort{label-acronym-hbci}
For glossaries use {\textbackslash}gls like so: \gls{label-glossary-realnumber}

\backmatter
%% debug for http://comments.gmane.org/gmane.comp.tex.live/33611 BEGIN
%% INFO IN /help/bugfix/printglossaries-bug/*
\def\findrootlanguage{%
   \def\rootlanguagename{\languagename}%
}
%% debug for http://comments.gmane.org/gmane.comp.tex.live/33611 END

\printglossary[type=\acronymtype, title=Acronyms\, Terms and Abbreviations, toctitle=Acronyms\, Terms and Abbreviations]
\printglossary[style=altlist, title=Glossary, toctitle=Glossary]

\end{document} 

Output:

enter image description here


If you don't want to change your acronyms definition (through \newglossaryentry), use \glsname instead of \acrshort to print the acronym name.

MWE:

\RequirePackage{filecontents}

\begin{filecontents*}{glossaries-generic.tex}
\newglossaryentry{label-glossary-realnumber}{
  name={real number},
  description={
    include both rational numbers, such as $42$ and $\frac{-23}{129}$, and
    irrational numbers, such as $\pi$ and the square root of two; or, a real
    number can be given by an infinite decimal representation, such as
    $2.4871773339\ldots$ where the digits continue in some way; or, the real
    numbers may be thought of as points on an infinitely long number line
  },
  symbol={\ensuremath{\mathbb{R}}}
}
\end{filecontents*}

\begin{filecontents*}{acronyms-generic.tex}
\newglossaryentry{label-acronym-hbci}{
  type=\acronymtype,
  name={HBCI},
  description={Cascading Style Sheets},
  first={Home Banking Computer Interfaces (HBCI)}
}
\end{filecontents*}

\documentclass[
   final,
   12pt,
   a4paper,
   oneside
]{book}

\usepackage[acronym, nopostdot, toc, xindy]{glossaries}
\makeglossaries %% Add \makeglossaries to your preamble (before you start defining your entries)
\input{glossaries-generic}
\input{acronyms-generic}
%% Glossaries End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
If you just want to print the abbreviation use : \glsname{label-acronym-hbci}
For glossaries use {\textbackslash}gls like so: \gls{label-glossary-realnumber}

\backmatter
%% debug for http://comments.gmane.org/gmane.comp.tex.live/33611 BEGIN
%% INFO IN /help/bugfix/printglossaries-bug/*
\def\findrootlanguage{%
   \def\rootlanguagename{\languagename}%
}
%% debug for http://comments.gmane.org/gmane.comp.tex.live/33611 END

\printglossary[type=\acronymtype, title=Acronyms\, Terms and Abbreviations, toctitle=Acronyms\, Terms and Abbreviations]
\printglossary[style=altlist, title=Glossary, toctitle=Glossary]

\end{document} 

The output is the same as above.


As a side note, you probably wanted to write

title={Acronyms, Terms and Abbreviations}

instead of

title=Acronyms\, Terms and Abbreviations

to get

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .