4

If i have a acronym that it self has a glossary entry AND the acronymstyle set to long-short then the abbreviation is not shown.

MWE

\documentclass{scrreprt}

\usepackage[acronyms,nogroupskip,nonumberlist,toc,nopostdot]{glossaries}
\setacronymstyle{long-short} 

\makeglossaries

\newacronym{OBS}{OBS}{\gls{glsOBS}}

\newglossaryentry{glsOBS}{
    name={Organizational Breakdown Structure},
    description={test}
}

\begin{document}
    \gls{OBS}

    \printacronyms
    \printglossary
\end{document}

Result

Result without abbreviation

Expected Result

enter image description here

If i remove the \setacronymstyle or the \gls{glsOBS} it works as expected.

Is this a bug? Or is there a solution?

Log output from \listfiles:

This is LuaTeX, Version beta-0.80.0 (TeX Live 2015/W32TeX) (rev 5238)  (format=lualatex 2016.2.22)  27 JUL 2016 14:28
 restricted \write18 enabled.
**dokumentation.tex
(./dokumentation.tex
LaTeX2e <2016/02/01>
Babel <3.9n> and hyphenation patterns for 80 languages loaded.

("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/koma-script/scrreprt
.cls"
Document Class: scrreprt 2015/10/03 v3.19a KOMA-Script document class (report)

("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/koma-script/scrkbase
.sty"
Package: scrkbase 2015/10/03 v3.19a KOMA-Script package (KOMA-Script-dependent b
asics and keyval usage)

("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/koma-script/scrbase.
sty"
Package: scrbase 2015/10/03 v3.19a KOMA-Script package (KOMA-Script-independent 
basics and keyval usage)

("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/graphics/keyval.sty"
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks14
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/koma-script/scrlfile
.sty"
Package: scrlfile 2015/10/03 v3.19a KOMA-Script package (loading files)

Package scrlfile, 2015/10/03 v3.19a KOMA-Script package (loading files)
                  Copyright (C) Markus Kohm

)))
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/koma-script/tocbasic
.sty"
Package: tocbasic 2015/10/03 v3.19a KOMA-Script package (handling toc-files)
)
Package tocbasic Info: omitting babel extension for `toc'
(tocbasic)             because of feature `nobabel' available
(tocbasic)             for `toc' on input line 125.
Package tocbasic Info: omitting babel extension for `lof'
(tocbasic)             because of feature `nobabel' available
(tocbasic)             for `lof' on input line 126.
Package tocbasic Info: omitting babel extension for `lot'
(tocbasic)             because of feature `nobabel' available
(tocbasic)             for `lot' on input line 127.
Package tocbasic Info: defining new hook before heading of `' on input line 1588
.
Class scrreprt Info: File `scrsize11pt.clo' used instead of
(scrreprt)           file `scrsize11.clo' to setup font sizes on input line 2248
.

("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/koma-script/scrsize1
1pt.clo"
File: scrsize11pt.clo 2015/10/03 v3.19a KOMA-Script font size class option (11pt
)
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/koma-script/typearea
.sty"
Package: typearea 2015/10/03 v3.19a KOMA-Script package (type area)

Package typearea, 2015/10/03 v3.19a KOMA-Script package (type area)
                  Copyright (C) Frank Neukam, 1992-1994
                  Copyright (C) Markus Kohm, 1994-

\ta@bcor=\skip41
\ta@div=\count79
\ta@hblk=\skip42
\ta@vblk=\skip43
\ta@temp=\skip44
\footheight=\skip45
Package typearea Info: These are the values describing the layout:
(typearea)             DIV  = 10
(typearea)             BCOR = 0.0pt
(typearea)             \paperwidth      = 597.50793pt
(typearea)              \textwidth      = 418.25555pt
(typearea)              DIV departure   = -6%
(typearea)              \evensidemargin = 17.3562pt
(typearea)              \oddsidemargin  = 17.3562pt
(typearea)             \paperheight     = 845.04694pt
(typearea)              \textheight     = 595.80026pt
(typearea)              \topmargin      = -25.16531pt
(typearea)              \headheight     = 17.0pt
(typearea)              \headsep        = 20.40001pt
(typearea)              \topskip        = 11.0pt
(typearea)              \footskip       = 47.6pt
(typearea)              \baselineskip   = 13.6pt
(typearea)              on input line 1509.
)
\c@part=\count80
\c@chapter=\count81
\c@section=\count82
\c@subsection=\count83
\c@subsubsection=\count84
\c@paragraph=\count85
\c@subparagraph=\count86
LaTeX Info: Redefining \textsubscript on input line 4652.
\abovecaptionskip=\skip46
\belowcaptionskip=\skip47
\c@pti@nb@sid@b@x=\box26
\c@figure=\count87
\c@table=\count88
\bibindent=\dimen102
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/glossaries/base/glos
saries.sty"
Package: glossaries 2016/01/24 v4.21 (NLCT)

("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/base/ifthen.sty"
Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/xkeyval/xkeyval.sty"
Package: xkeyval 2014/12/03 v2.7a package option processing (HA)

("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/generic/xkeyval/xkeyval.te
x"
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/generic/xkeyval/xkvutils.t
ex"
\XKV@toks=\toks15
\XKV@tempa@toks=\toks16
)
\XKV@depth=\count89
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
))
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/mfirstuc/mfirstuc.st
y"
Package: mfirstuc 2015/12/17 v2.02 (NLCT)

("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/etoolbox/etoolbox.st
y"
Package: etoolbox 2015/08/02 v2.2a e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count90
)
\@glsmfirst=\toks17
\@glsmrest=\toks18
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/textcase/textcase.st
y"
Package: textcase 2004/10/07 v0.07 Text only upper/lower case changing (DPC)
) ("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/xfor/xfor.sty"
Package: xfor 2009/02/05 v1.05 (NLCT)
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/datatool/datatool-ba
se.sty"
Package: datatool-base 2016/01/18 v2.25 (NLCT)

("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/amsmath/amsmath.sty"
Package: amsmath 2013/01/14 v2.14 AMS math features
\@mathmargin=\skip48
For additional information on amsmath, use the `?' option.
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/amsmath/amstext.sty"
Package: amstext 2000/06/29 v2.01
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/amsmath/amsgen.sty"
File: amsgen.sty 1999/11/30 v2.0
\@emptytoks=\toks19
\ex@=\dimen103
)) ("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/amsmath/amsbsy.st
y"
Package: amsbsy 1999/11/29 v1.2d
\pmbraise@=\dimen104
) ("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/amsmath/amsopn.sty
"
Package: amsopn 1999/12/14 v2.01 operator names
)
\inf@bad=\count91
LaTeX Info: Redefining \frac on input line 210.
\uproot@=\count92
\leftroot@=\count93
LaTeX Info: Redefining \overline on input line 306.
\classnum@=\count94
\DOTSCASE@=\count95
LaTeX Info: Redefining \ldots on input line 378.
LaTeX Info: Redefining \dots on input line 381.
LaTeX Info: Redefining \cdots on input line 466.
\Mathstrutbox@=\box27
\strutbox@=\box28
\big@size=\dimen105
LaTeX Font Info:    Redeclaring font encoding OML on input line 566.
LaTeX Font Info:    Redeclaring font encoding OMS on input line 567.
\macc@depth=\count96
\c@MaxMatrixCols=\count97
\dotsspace@=\muskip10
\c@parentequation=\count98
\dspbrk@lvl=\count99
\tag@help=\toks20
\row@=\count100
\column@=\count101
\maxfields@=\count102
\andhelp@=\toks21
\eqnshift@=\dimen106
\alignsep@=\dimen107
\tagshift@=\dimen108
\tagwidth@=\dimen109
\totwidth@=\dimen110
\lineht@=\dimen111
\@envbody=\toks22
\multlinegap=\skip49
\multlinetaggap=\skip50
\mathdisplay@stack=\toks23
LaTeX Info: Redefining \[ on input line 2665.
LaTeX Info: Redefining \] on input line 2666.
) ("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/substr/substr.sty"
Package: substr 2009/10/20 v1.2 Handle substrings
\c@su@anzahl=\count103
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/datatool/datatool-fp
.sty"
Package: datatool-fp 2016/01/18 v2.25 (NLCT)
 ("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/fp/fp.sty"
Package: fp 1995/04/02

`Fixed Point Package', Version 0.8, April 2, 1995 (C) Michael Mehlich
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/fp/defpattern.sty"
Package: defpattern 1994/10/12
\actioncount=\count104
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/fp/fp-basic.sty"
Package: fp-basic 1996/05/13
\FP@xs=\count105
\FP@xia=\count106
\FP@xib=\count107
\FP@xfa=\count108
\FP@xfb=\count109
\FP@rega=\count110
\FP@regb=\count111
\FP@regs=\count112
\FP@times=\count113
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/fp/fp-addons.sty"
Package: fp-addons 1995/03/15
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/fp/fp-snap.sty"
Package: fp-snap 1995/04/05
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/fp/fp-exp.sty"
Package: fp-exp 1995/04/03
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/fp/fp-trigo.sty"
Package: fp-trigo 1995/04/14
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/fp/fp-pas.sty"
Package: fp-pas 1994/08/29
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/fp/fp-random.sty"
Package: fp-random 1995/02/23
\FPseed=\count114
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/fp/fp-eqn.sty"
Package: fp-eqn 1995/04/03
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/fp/fp-upn.sty"
Package: fp-upn 1996/10/21
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/fp/fp-eval.sty"
Package: fp-eval 1995/04/03
)))
\@dtl@toks=\toks24
\@dtl@tmpcount=\count115
\dtl@tmplength=\skip51
\dtl@sortresult=\count116
\@dtl@numgrpsepcount=\count117
\@dtl@datatype=\count118
\dtl@codeA=\count119
\dtl@codeB=\count120
\@dtl@foreach@level=\count121
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/glossaries/base/glos
saries-compatible-307.sty"
Package: glossaries-compatible-307 2016/01/24 v4.21 (NLCT)
)
\gls@level=\count122
\@gls@tmpb=\toks25
\gls@tmplen=\skip52
\glskeylisttok=\toks26
\glslabeltok=\toks27
\glsshorttok=\toks28
\glslongtok=\toks29

("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/glossaries/styles/gl
ossary-hypernav.sty"
Package: glossary-hypernav 2016/01/24 v4.21 (NLCT)
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/glossaries/styles/gl
ossary-list.sty"
Package: glossary-list 2016/01/24 v4.21 (NLCT)
\glslistdottedwidth=\skip53
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/glossaries/styles/gl
ossary-long.sty"
Package: glossary-long 2016/01/24 v4.21 (NLCT)

("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/tools/longtable.sty"
Package: longtable 2014/10/28 v4.11 Multi-page Table package (DPC)
\LTleft=\skip54
\LTright=\skip55
\LTpre=\skip56
\LTpost=\skip57
\LTchunksize=\count123
\LTcapwidth=\dimen112
\LT@head=\box29
\LT@firsthead=\box30
\LT@foot=\box31
\LT@lastfoot=\box32
\LT@cols=\count124
\LT@rows=\count125
\c@LT@tables=\count126
\c@LT@chunks=\count127
\LT@p@ftn=\toks30
)
Class scrreprt Info: longtable captions redefined on input line 43.
\glsdescwidth=\skip58
\glspagelistwidth=\skip59
)
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/glossaries/styles/gl
ossary-super.sty"
Package: glossary-super 2016/01/24 v4.21 (NLCT)

("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/supertabular/superta
bular.sty"
Package: supertabular 2004/02/20 v4.1e the supertabular environment
\c@tracingst=\count128
\ST@wd=\dimen113
\ST@rightskip=\skip60
\ST@leftskip=\skip61
\ST@parfillskip=\skip62
\ST@pageleft=\dimen114
\ST@headht=\dimen115
\ST@tailht=\dimen116
\ST@pagesofar=\dimen117
\ST@pboxht=\dimen118
\ST@lineht=\dimen119
\ST@stretchht=\dimen120
\ST@prevht=\dimen121
\ST@toadd=\dimen122
\ST@dimen=\dimen123
\ST@pbox=\box33
))
("c:/Program Files (x86)/texlive/2015/texmf-dist/tex/latex/glossaries/styles/gl
ossary-tree.sty"
Package: glossary-tree 2016/01/24 v4.21 (NLCT)
\glstreeindent=\skip63
))
\glswrite=\write3
\glo@main@file=\write4

\openout4 = dokumentation.glo
Package glossaries Info: Writing glossary file dokumentation.glo on input line 8
.
\glo@acronym@file=\write5

\openout5 = dokumentation.acn
Package glossaries Info: Writing glossary file dokumentation.acn on input line 8
.
 (./dokumentation.aux)
\openout1 = dokumentation.aux

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 17.
LaTeX Font Info:    ... okay on input line 17.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 17.
LaTeX Font Info:    ... okay on input line 17.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 17.
LaTeX Font Info:    ... okay on input line 17.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 17.
LaTeX Font Info:    ... okay on input line 17.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 17.
LaTeX Font Info:    ... okay on input line 17.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 17.
LaTeX Font Info:    ... okay on input line 17.
 (./dokumentation.acr [1


\openout3 = dokumentation.ist
{c:/Program Files (x86)/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.ma
p}])
(./dokumentation.gls [2

]) [3

] (./dokumentation.aux)

 *File List*
scrreprt.cls    2015/10/03 v3.19a KOMA-Script document class (report)
scrkbase.sty    2015/10/03 v3.19a KOMA-Script package (KOMA-Script-dependent bas
ics and keyval usage)
 scrbase.sty    2015/10/03 v3.19a KOMA-Script package (KOMA-Script-independent b
asics and keyval usage)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
scrlfile.sty    2015/10/03 v3.19a KOMA-Script package (loading files)
tocbasic.sty    2015/10/03 v3.19a KOMA-Script package (handling toc-files)
scrsize11pt.clo    2015/10/03 v3.19a KOMA-Script font size class option (11pt)
typearea.sty    2015/10/03 v3.19a KOMA-Script package (type area)
glossaries.sty    2016/01/24 v4.21 (NLCT)
  ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
 xkeyval.sty    2014/12/03 v2.7a package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
mfirstuc.sty    2015/12/17 v2.02 (NLCT)
etoolbox.sty    2015/08/02 v2.2a e-TeX tools for LaTeX (JAW)
textcase.sty    2004/10/07 v0.07 Text only upper/lower case changing (DPC)
    xfor.sty    2009/02/05 v1.05 (NLCT)
datatool-base.sty    2016/01/18 v2.25 (NLCT)
 amsmath.sty    2013/01/14 v2.14 AMS math features
 amstext.sty    2000/06/29 v2.01
  amsgen.sty    1999/11/30 v2.0
  amsbsy.sty    1999/11/29 v1.2d
  amsopn.sty    1999/12/14 v2.01 operator names
  substr.sty    2009/10/20 v1.2 Handle substrings
datatool-fp.sty    2016/01/18 v2.25 (NLCT)
      fp.sty    1995/04/02
defpattern.sty    1994/10/12
fp-basic.sty    1996/05/13
fp-addons.sty    1995/03/15
 fp-snap.sty    1995/04/05
  fp-exp.sty    1995/04/03
fp-trigo.sty    1995/04/14
  fp-pas.sty    1994/08/29
fp-random.sty    1995/02/23
  fp-eqn.sty    1995/04/03
  fp-upn.sty    1996/10/21
 fp-eval.sty    1995/04/03
glossaries-compatible-307.sty    2016/01/24 v4.21 (NLCT)
glossary-hypernav.sty    2016/01/24 v4.21 (NLCT)
glossary-list.sty    2016/01/24 v4.21 (NLCT)
glossary-long.sty    2016/01/24 v4.21 (NLCT)
longtable.sty    2014/10/28 v4.11 Multi-page Table package (DPC)
glossary-super.sty    2016/01/24 v4.21 (NLCT)
supertabular.sty    2004/02/20 v4.1e the supertabular environment
glossary-tree.sty    2016/01/24 v4.21 (NLCT)
dokumentation.acr
dokumentation.gls
 ***********

)
2
  • It's a documented feature. It's mentioned in the glossaries user manual, but explained more fully in the section "nested links" glossaries-extra manual. Jul 27, 2016 at 18:22
  • @NicolaTalbot: Thank you for the link. I did read this chapter but there is nothing that explains my problem.
    – Spenhouet
    Jul 28, 2016 at 7:03

1 Answer 1

4

Is this a bug?

No, it's a documented feature. From Defining Glossary Entries:

Avoid using any of the \gls-like or \glstext-like commands within the text, first, short or long keys (or their plural equivalent) or any other key that you plan to access through those commands. (For example, the symbol key if you intend to use \glssymbol.) Otherwise you end up with nested links, which can cause complications and they won’t work with the case-changing commands. You can use them within the value of keys that won’t be accessed through those commands. For example, the description key if you don’t use \glsdesc. Additionally, they’ll confuse the entry formatting commands, such as \glslabel.

From Acronyms and Other Abbreviations:

Recall from the warning in §4 Defining Glossary Entries that you should avoid using the \gls-like and \glstext-like commands within the value of keys like text and first due to complications arising from nested links. The same applies to abbreviations defined using \newacronym.

For example, suppose you have defined:

\newacronym{ssi}{SSI}{server side includes}
\newacronym{html}{HTML}{hypertext markup language}

you may be tempted to do:

\newacronym{shtml}{S\gls{html}}{\gls{ssi} enabled \gls{html}}

Don’t! This will break the case-changing commands, such as \Gls, it will cause inconsistencies on first use, and, if hyperlinks are enabled, will cause nested hyperlinks. It will also confuse the commands used by the entry formatting (such as \glslabel).

Instead, consider doing:

\newacronym
[description={\gls{ssi} enabled \gls{html}}]
{shtml}{SHTML}{SSI enabled HTML}

or

\newacronym
[description={\gls{ssi} enabled \gls{html}}]   
{shtml}{SHTML}
{server side includes enabled hypertext markup language}

The reason why the problem isn't noticeable if you remove \setacronymstyle is related to this bit:

Additionally, they’ll confuse the entry formatting commands, such as \glslabel.

The newer method of using \setacronymstyle uses the new style of entry formatting that relies on \glslabel, which can't be scoped as the post-link hook needs to be able to both look forwards (for example, the discardperiod attribute requires this) and effectively look backwards, to know the information about the entry that has just been referenced. You can explicitly add the scoping yourself. For example:

\newacronym{OBS}{OBS}{{\gls{glsOBS}}}

However, this essentially just papers over the most noticeable symptom, whilst ignoring all the other associated problems that are listed in Nested Links.

The best solution is:

\newacronym
[description={\gls{glsOBS}}]
{OBS}{OBS}{Organizational Breakdown Structure}

The next best solution is:

\newacronym
[description={\gls{glsOBS}}]
{OBS}{OBS}{\glsentrytext{glsOBS}}

but don't use \Gls{OBS} with this method.

Alternatively, with glossaries-extra:

    \newacronym{OBS}{OBS}{\glsxtrtext{glsOBS}}

but, again, don't use \Gls{OBS}.

1
  • Thank you for the insight into the \setacronymstyle command. I didn't know that. Your suggested best solution does work fine for me, so i will go with that.
    – Spenhouet
    Jul 28, 2016 at 12:27

You must log in to answer this question.

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