2

I want to insert a \gls acronym into \newthought.

\documentclass{tufte-book} 
\usepackage[acronym]{glossaries}
\newacronym{ds}{DS}{Directional Sensitivity} % define acronym label/short/long
\makeglossaries

\begin{document}

\newthought{The \gls{ds}} of hair cells

\printacronyms
\end{document}

This works as expected with pdfLaTeX. However, when rendered with XeLaTeX:

! Package glossaries Error: Glossary entry `{ds}' has not been defined.

\glossaries v4.37

No error is throw with:

\newthought{The \glsentrytext{ds}} of hair cells

\newthought{The \glsentryshort{ds}} of hair cells

\newthought{The \glsentrylong{ds}} of hair cells

\newthought{The \glsentryname{ds}} of hair cells

\newthought{The Directional Sensitivity} \gls{ds} of hair cells

However, no acronym is rendered from all examples except the last one (because it is outside \newthought.

But,

  • I need to use the \gls for the first time in \newthought, otherwise it mucks up later uses
  • I want to use \newthought to emphasise the new topic, e.g. Directional Sensitivity, which is best defined as an acronym
  • I want to use XeLaTeX for unicode support.

The output when using pdfLaTeX:

    *File List*
tufte-book.cls    2015/06/21 v3.5.2 Tufte-book class
tufte-common.def    2015/06/21 v3.5.2 Common code for the Tufte-LaTeX styles
 xkeyval.sty    2014/12/03 v2.7a package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
 xifthen.sty    2015/11/05 v1.4.0 Extended ifthen features
    calc.sty    2014/10/28 v4.3 Infix arithmetic (KKT,FJ)
  ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
 ifmtarg.sty    2009/09/02 v1.2a check for an empty argument
hardwrap.sty    2011/02/12 v0.2 Hard wrap messages
ifplatform.sty    2010/10/22 v0.4 Testing for the operating system
pdftexcmds.sty    2017/03/19 v0.25 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
 ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
   ifpdf.sty    2017/03/15 v3.2 Provides the ifpdf switch
catchfile.sty    2016/05/16 v1.7 Catch the contents of a file (HO)
etexcmds.sty    2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
    book.cls    2014/09/29 v1.4h Standard LaTeX document class
    bk10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
titlesec.sty    2016/03/21 v2.10.2 Sectioning titles
titletoc.sty    2011/12/15 v1.6 TOC entries
hyperref.sty    2017/03/14 v6.85a Hypertext links for LaTeX
hobsub-hyperref.sty    2016/05/16 v1.14 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty    2016/05/16 v1.14 Bundle oberdiek, subset generic (HO)
  hobsub.sty    2016/05/16 v1.14 Construct package bundles (HO)
  ifvtex.sty    2016/05/16 v1.6 Detect VTeX and its facilities (HO)
 intcalc.sty    2016/05/16 v1.2 Expandable calculations with integers (HO)
kvsetkeys.sty    2016/05/16 v1.17 Key value parser (HO)
kvdefinekeys.sty    2016/05/16 v1.4 Define keys (HO)
pdfescape.sty    2016/05/16 v1.14 Implements pdfTeX's escape features (HO)
bigintcalc.sty    2016/05/16 v1.4 Expandable calculations on big integers (HO)
  bitset.sty    2016/05/16 v1.2 Handle bit-vector datatype (HO)
uniquecounter.sty    2016/05/16 v1.3 Provide unlimited unique counter (HO)
letltxmacro.sty    2016/05/16 v1.5 Let assignment for LaTeX macros (HO)
 hopatch.sty    2016/05/16 v1.3 Wrapper for package hooks (HO)
xcolor-patch.sty    2016/05/16 xcolor patch
atveryend.sty    2016/05/16 v1.9 Hooks at the very end of document (HO)
atbegshi.sty    2016/06/09 v1.18 At begin shipout hook (HO)
refcount.sty    2016/05/16 v3.5 Data extraction from label references (HO)
 hycolor.sty    2016/05/16 v1.8 Color options for hyperref/bookmark (HO)
 auxhook.sty    2016/05/16 v1.4 Hooks for auxiliary files (HO)
kvoptions.sty    2016/05/16 v3.12 Key value format for package options (HO)
  pd1enc.def    2017/03/14 v6.85a Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive
   puenc.def    2017/03/14 v6.85a Hyperref: PDF Unicode definition (HO)
     url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
 hpdftex.def    2017/03/14 v6.85a Hyperref driver for pdfTeX
rerunfilecheck.sty    2016/05/16 v1.8 Rerun checks for auxiliary files (HO)
ragged2e.sty    2009/05/21 v2.1 ragged2e Package (MS)
everysel.sty    2011/10/28 v1.2 EverySelectfont Package (MS)
geometry.sty    2010/09/12 v5.6 Page Geometry
geometry.cfg
changepage.sty    2009/10/20 v1.0c check page and change page layout
paralist.sty    2017/01/22 v2.7 Extended list environments
textcase.sty    2004/10/07 v0.07 Text only upper/lower case changing (DPC)
letterspace.sty    2017/07/07 v2.7 Robust letterspacing (RS)
setspace.sty    2011/12/19 v6.7a set line spacing
  xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
   color.cfg    2016/01/02 v1.6 sample color configuration
  pdftex.def    2017/06/24 v1.0g Graphics/color driver for pdftex
dvipsnam.def    2016/06/17 v3.0m Driver-dependent file (DPC,SPQR)
  svgnam.def    2016/05/11 v2.12 Predefined colors according to SVG 1.1 (UK)
  natbib.sty    2010/09/13 8.31b (PWD, AO)
bibentry.sty    2007/10/30 1.5 (PWD)
optparams.sty    2004/08/14 v0.9 multiple optional parameters in macros
placeins.sty    2005/04/18  v 2.2
mathpazo.sty    2005/04/12 PSNFSS-v9.2a Palatino w/ Pazo Math (D.Puga, WaS) 
  helvet.sty    2005/04/12 PSNFSS-v9.2a (WaS) 
beramono.sty    2004/01/31 (WaS)
 fontenc.sty
   t1enc.def    2017/04/05 v2.0i Standard LaTeX file
textcomp.sty    2017/04/05 v2.0i Standard LaTeX package
  ts1enc.def    2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file
fancyhdr.sty    2017/06/30 v3.9a Extensive control of page headers and footers
multicol.sty    2017/04/11 v1.8q multicolumn formatting (FMi)
glossaries.sty    2018/04/07 v4.37 (NLCT)
mfirstuc.sty    2017/11/14 v2.06 (NLCT)
etoolbox.sty    2017/01/02 v2.4 e-TeX tools for LaTeX (JAW)
    xfor.sty    2009/02/05 v1.05 (NLCT)
datatool-base.sty    2018/04/16 v2.30 (NLCT)
 amsmath.sty    2016/11/05 v2.16a AMS math features
 amstext.sty    2000/06/29 v2.01 AMS text
  amsgen.sty    1999/11/30 v2.0 generic functions
  amsbsy.sty    1999/11/29 v1.2d Bold Symbols
  amsopn.sty    2016/03/08 v2.02 operator names
  substr.sty    2009/10/20 v1.2 Handle substrings
datatool-fp.sty    2018/04/16 v2.30 (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    2018/04/07 v4.37 (NLCT)
glossary-hypernav.sty    2018/04/07 v4.37 (NLCT)
glossary-list.sty    2018/04/07 v4.37 (NLCT)
glossary-long.sty    2018/04/07 v4.37 (NLCT)
longtable.sty    2014/10/28 v4.11 Multi-page Table package (DPC)
glossary-super.sty    2018/04/07 v4.37 (NLCT)
supertabular.sty    2004/02/20 v4.1e the supertabular environment
glossary-tree.sty    2018/04/07 v4.37 (NLCT)
  ts1cmr.fd    2014/09/29 v2.5h Standard LaTeX font definitions
  t1pplj.fd    2004/09/06 font definitions for T1/pplj.
 nameref.sty    2016/05/21 v2.44 Cross-referencing by name of section
gettitlestring.sty    2016/05/16 v1.5 Cleanup title references (HO)
untitled-1.out
untitled-1.out
supp-pdf.mkii
5
  • 1
    Welcome to TeX.SX! I don't seem to get the error message. Can you please show what version of glossaries you're using?
    – egreg
    Commented Apr 20, 2018 at 10:57
  • It works fine for me with tufte-book v3.5.2 and glossaries v4.37. Can you add \listfiles to the start of the file and show the complete file list that appears at the end of the transcript. (Unrelated but \makeglossaries is best put before \newacronym.) Commented Apr 20, 2018 at 22:28
  • It seems the problem is caused with switching to small caps. The same error can be reproduced with XeLaTeX and just \textsc{\gls{ds}}. There's a similar problem with \documentclass{tufte-book} \begin{document} \chapter{Sample}\label{sample} \textsc{\ref{sample}} \end{document} (but not if tufte-book is replaced with book). Commented Apr 20, 2018 at 23:31
  • Ahh, thank you for the diagnosis. Do you have suggestions for a method around this, besides simply not using \gls and \newthoughttogether? I don't care if it doesn't link, just the text is fine. Commented Apr 23, 2018 at 1:31
  • It seems that tufte-book redefines \textsc to \sotextsc which seems to be using the soul package's letterspacing commands. This interferes with commands like \gls and \ref. So it's essentially the same problem as in tex.stackexchange.com/questions/425432 Commented Apr 24, 2018 at 23:12

0

You must log in to answer this question.

Browse other questions tagged .