长短格式(首字母缩略词和词汇表)无法正确显示缩写

长短格式(首字母缩略词和词汇表)无法正确显示缩写

如果我有一个首字母缩略词,它本身有一个词汇表条目并且缩写样式设置为,long-short那么就不会显示该缩写。

平均能量损失

\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}

结果

无缩写的结果

预期结果

在此处输入图片描述

如果我删除\setacronymstyle或,它\gls{glsOBS}会按预期工作。

这是一个错误吗?或者有解决方案吗?

日志输出自\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
 ***********

)

答案1

这是一个错误吗?

不,这是一个有文档记录的功能。来自定义词汇表条目

避免在 、、或键(或它们的复数形式)或您计划通过这些命令访问的任何其他键中使用任何\gls-like 或-like 命令。 (例如,如果您打算使用 ,则为 键。)否则,您最终会得到嵌套链接,这会导致复杂情况,并且它们无法与大小写更改命令一起使用。 您可以在不会通过这些命令访问的键的值中使用它们。 例如,如果您不使用 ,则为 键。 此外,它们会混淆条目格式化命令,例如。\glstexttextfirstshortlongsymbol\glssymboldescription\glsdesc\glslabel

首字母缩略词和其他缩写

回想一下§4 定义词汇表条目应避免在和等键的值中使用\gls-like 和-like 命令,因为嵌套链接会引起复杂情况。这同样适用于使用定义的缩写 。\glstexttextfirst\newacronym

例如,假设您已定义:

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

你可能会想这样做:

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

不要!这会破坏大小写转换命令,例如\Gls,这将导致首次使用时出现不一致,并且如果启用了超链接,将导致嵌套超链接。它还会混淆条目格式使用的命令(例如\glslabel)。

相反,考虑这样做:

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

或者

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

删除后问题不明显的原因\setacronymstyle与此有关:

此外,他们会混淆条目格式化命令,例如\glslabel

较新的使用方法\setacronymstyle使用依赖于 的新式条目格式\glslabel,它无法限定范围,因为后链接钩子需要能够向前看(例如,discardperiod属性需要这个)并有效地向后看,以了解刚刚引用的条目的信息。您可以自己明确添加范围。例如:

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

然而,这实际上只是掩盖了最明显的症状,同时忽略了嵌套链接

最好的解决办法是:

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

下一个最佳解决方案是:

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

但不要使用\Gls{OBS}此方法。

或者,使用glossaries-extra

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

但是,再说一次,不要使用\Gls{OBS}

相关内容