2

I have a weird issue with the following table:

\begin{table}[h]
    \begin{tabular}{c | ccccccc }
        \toprule
        n & A2 & A3 & d2 & D3 & D4 & B3 & B4 \\
        \midrule
        2 & 1.880 & 2.659 & 1.128 & 0 & 3.267 & 0 & 3.267 \\
        3 & 1.023 & 1.954 & 1.693 & 0 & 2.574 & 0 & 2.568 \\
        4 & 0.729 & 1.628 & 2.059 & 0 & 2.282 & 0 & 2.266 \\
        5 & 0.577 & 1.427 & 2.326 & 0 & 2.114 & 0 & 2.089 \\
        % OTHER LINES UP TO 25
        \bottomrule
    \end{tabular}
    %caption{}
    \label{tab:controlchartsparamenter}
\end{table}

Up to 10 lines (maybe more) everything is fine, but with more lines I get the following error, which doesn't concern the table, and many warnings.

FILE: forest.sty (line 168)

ERROR: Package glossaries Error: Glossary entry `SPC' has not been defined.

LINE in forest.sty:

\RequirePackage[#1]{forest-lib-#2}%

The acronym SPC is only used here:

\section{\acrlong{spc}}
\acrfull{spc} is ...

It's defined in the preamble as:

\newacronym{spc}{SPC}{Statistical Process Control}

The warnings in the main file are like this one:

WARNING: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\acrlong'

LINE:

\subsection{\acrfull{pvm}}

WARNING: Composite letter \textasciimacron+X'(hyperref) not defined in PD1 encoding,(hyperref) removing\textasciimacron'

LINE:

\subsection{\={X}-R and \={X}-s charts}

Then I have this warning in forest.sty

WARNING: No file thesis.acr.

and warnings like this one in my preamble.sty file:

WARINING: name{glo:mpc} has been referenced but does not exist, replaced by a fixed one


I'm using texlive 2017 on Linux Mint, book class, and many packages defined in my preamble.sty file, including:

\RequirePackage{booktabs}
\RequirePackage{threeparttable}
\RequirePackage{hyperref}
\RequirePackage[toc,acronym]{glossaries}
\RequirePackage[edges]{forest}

Everything worked fine before I created the table, then I got the errors, then errors disappeared if I delete most of the lines (it does not matter which ones). I really can't understand how a long table could create errors with acronyms and forest package. Does anyone have any idea?

Thank you!

EXAMPLE

The only example I've been able to create from my big document, with many files, is the following one. The acronym gives an error with forest, independently from the length and the presence of the table. Anyway \section{\acrlong{acr}} worked fine in my document before adding that long table.

\documentclass[11pt,a4paper,twoside,openright,draft]{book}

\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{hyperref}
\usepackage[toc,acronym]{glossaries}
\usepackage[edges]{forest}

\newacronym{acr}{ACR}{Acronym}

\begin{document}

\section{\acrlong{acr}}

\end{document}

This minimal example gives the following error in line 50 of forest.sty (which is not even used in the example):

Package glossaries Error: Glossary entry `ACR' has not been defined. \end{document}

\usetikzlibrary{shapes} % line 50
  • 1
    Could you please provide a minimal working example (MWE) which demonstrates this error. As you say it seems strange that the actions described would produce the stated error so it seems likely that something more is going on, but that's impossible to see without a minimal working example (MWE). – Dai Bowen Apr 7 '18 at 17:06
  • The hyperref warnings won't be causing the problem. They're just warning about content that can't be included in PDF bookmarks. The "No file thesis.acr" warning means that you haven't generated the list of acronyms (using makeindex or xindy, typically via the makeglossaries script) or the indexing failed. Similarly "name{glo:mpc} has been referenced but does not exist" means the list of acronyms is incomplete or missing. – Nicola Talbot Apr 7 '18 at 17:20
  • 2
    "Glossary entry 'ACR' has not been defined" is caused by using \aclong{acr} in a context that converts the label to upper case. (See Why shouldn't I use commands like \gls in \section, \chapter, \caption etc?). – Nicola Talbot Apr 7 '18 at 17:22
  • @DaiBowen unfortunately I have a quite big document with many includes and I wasn't able to create a good MWE. The one I just added gives the errors with forest independently from the presence of the table. – Taekwondavide Apr 7 '18 at 17:23
  • @NicolaTalbot I forgot to add those commans in my example, but acronyms work fine in my document: \acrl***{} is correctly replaced, even inside \section{}, and the acronym list is correcly displayed. I have that problem only when that table has more than 10 lines – Taekwondavide Apr 7 '18 at 17:28
2

The problem can be demonstrated with an even shorter MWE:

\documentclass{book}

\usepackage[acronym]{glossaries}

\newacronym{acr}{ACR}{Acronym}

\begin{document}

\section{\acrlong{acr}}

\end{document}

This causes the error:

! Package glossaries Error: Glossary entry `ACR' has not been defined.

The error doesn't occur in the following:

\documentclass{book}

\usepackage[acronym]{glossaries}

\newacronym{acr}{ACR}{Acronym}

\begin{document}

\chapter{Sample}
\section{\acrlong{acr}}

\end{document}

and everything looks fine:

Chapter 1 Sample 1.1 Acronym

The problem isn't the actual section heading but the page header. The book class defaults to the headings page style but \chapter uses \thispagestyle{plain} for the first page of the chapter. If I add some dummy filler text the error comes back again on page 3:

\documentclass{book}

\usepackage{lipsum}% dummy text
\usepackage[acronym]{glossaries}

\newacronym{acr}{ACR}{Acronym}

\begin{document}

\chapter{Sample}
\section{\acrlong{acr}}

\lipsum[1-15]% dummy text

\end{document}

On page 1 the page header is empty (because the plain page style is in effect). On page 2 the page header has the chapter title. On page 3 the page header has the section title, which in this case is \acrlong{acr} but the page style encapsulates this with \MakeUppercase, which converts the label acr to upper case, so now you have \acrlong{ACR} but there's no entry defined with the label ACR, which is what causes the error.

I suspect that what happened was that you had the table on page 2 but when you added extra rows it didn't have enough room on the page so it was moved to page 3, at which point the error occurred because \acrlong{acr} is now in the page header.

The simplest fix is to use \glsentrylong instead of \acrlong:

\documentclass{book}

\usepackage{lipsum}% dummy text
\usepackage[acronym]{glossaries}

\newacronym{acr}{ACR}{Acronym}

\begin{document}

\chapter{Sample}
\section{\glsentrylong{acr}}

\lipsum[1-15]

\end{document}

There are other options available with the glossaries-extra extension package, described in Entries in Sectioning Titles, Headers, Captions and Contents. For example:

\documentclass{book}

\usepackage{lipsum}% dummy text
\usepackage[acronym]{glossaries-extra}

\glssetcategoryattribute{acronym}{headuc}{true}
\setabbreviationstyle[acronym]{long-short}

\newacronym{acr}{ACR}{Acronym}

\begin{document}

\chapter{Sample}
\section{\glsfmtlong{acr}}

\lipsum[1-15]

\end{document}
  • Thank you, I already removed all the acronyms and solved the problem, but later I'll try your solution too! – Taekwondavide Apr 7 '18 at 18:30

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.