1

Why does not the plural form work in glossaries? Sorry for bad indentation

Preamble:

\documentclass[a4paper,11pt]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{scrhack}
\usepackage{lmodern}
\usepackage{chscite2}
\usepackage{listings}
\usepackage[intlimits]{amsmath}
\usepackage{amssymb}
\usepackage{isomath}
\renewcommand{\vec}{\vectorsym}
\newcommand{\mat}{\matrixsym}
\newcommand{\ten}{\tensorsym}
\usepackage{braket}
\usepackage{lmodern}
\usepackage[per-mode=fraction]{siunitx}
\usepackage{icomma}
\usepackage{color}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{caption}
\usepackage{bbm}
\usepackage{mleftright}
\usepackage{tikz}
\usepackage{pstricks}
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{titling}
\usepackage[toc,xindy]{glossaries}
\newcommand*{\glossfirstformat}[1]{\textit{#1}}
\renewcommand*{\glsseeformat}[3][\seename]{\textit{See}: \glsseelist{#2}} 
\newacronymstyle{myacro}{%
    \GlsUseAcrEntryDispStyle{long-short}%
}%
{%
\GlsUseAcrStyleDefs{long-short}%
\renewcommand*{\genacrfullformat}[1]{%
\glossfirstformat{\glsentrylong{##1}}\space(\glsentryshort{##1})%}
\renewcommand*{\Genacrfullformat}[2]{%
\glossfirstformat{\Glsentrylong{##1}}\space(\glsentryshort{##1})%
}%
\renewcommand*{\genplacrfullformat}[2]{%
 \glossfirstformat{\glsentrylongpl{##1}}\space(\glsentryshortpl{##1})%
}%
\renewcommand*{\Genplacrfullformat}[2]{%
\glossfirstformat{\Glsentrylongpl{##1}}\space
  (\glsentryshortpl{##1})%
}%
}
\setacronymstyle{myacro}
\defglsentryfmt{%
\ifglshaslong{\glslabel}{%
\glsgenacfmt%
}{%
 \ifglsused{\glslabel}{%
  \glsgenentryfmt%
 }{%
  \glossfirstformat{\glsgenentryfmt}%
  }%
 }%6
}
\renewcommand*{\glsnamefont}{\sffamily}
\usepackage{xparse}
\DeclareDocumentCommand{\newdualentry}{ O{} O{} m m m m } {
\newglossaryentry{gls-#3}{name={#5},text={#5\glsadd{#3}},
 description={#6},#1
 }
\newacronym[see={[See:]{gls-#3}},#2]{#3}{#4}{#5\glsadd{gls-#3}}
}

\usepackage{import}
\addto\captionsenglish{\renewcommand{\figurename}  
{\sffamily{\textbf{Figure}}}}
\renewcommand*{\figureformat}{%
  \figurename~\thefigure%
%  \autodot% DELETED
}

\usetikzlibrary{arrows,shapes}
\newcommand{\N}{\ensuremath{\mathbbm{N}}}
\newcommand{\Z}{\ensuremath{\mathbbm{Z}}}
\newcommand{\Q}{\ensuremath{\mathbbm{Q}}}
\newcommand{\R}{\ensuremath{\mathbbm{R}}}
\newcommand{\C}{\ensuremath{\mathbbm{C}}}
\newcommand{\rd}{\ensuremath{\mathrm{d}}}
\newcommand{\id}{\ensuremath{\,\rd}}
\definecolor{boxcolor}{rgb}{0.9,0.9,0.9}
\mleftright
\newcommand{\umltitle}[1]{\footnotesize{\textbf{#1}}}
\newcommand{\umlentry}[1]{\footnotesize{#1}}
\newcommand{\umlabstract}[1]{\footnotesize{\textit{#1}}}
\newcommand{\figuretext}[1]{\footnotesize{#1}}
\newcommand{\textclassname}[1]{\mbox{\texttt{#1}}}
\newcommand{\bigo}[1]{\mathcal{O}\left(#1 \right)}

In the document

\makeglossaries
\begin{document}
\newglossaryentry{polymesh}{name={polygon mesh},plural={polygon meshes},description={A storage model that is frequently used in 3D computer graphics to represent 3D objects}}\glspl{polymesh}
\printglossary
\end{document}

Output from \glspl{polymesh}

polygon meshs

pdflatex --version

pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)

kpathsea version 6.1.1

Copyright 2013 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). There is NO warranty. Redistribution of this software is covered by the terms of both the pdfTeX copyright and the Lesser GNU General Public License. For more information about these matters, see the file named COPYING and the pdfTeX source.

Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).

Compiled with libpng 1.2.49; using libpng 1.2.50 Compiled with zlib 1.2.8; using zlib 1.2.8 Compiled with poppler version 0.24.5

xindy --version

xindy release: unknown

xindy script version: 1.16

xindy kernel version: 3.0

CLISP version 2.49 (2010-07-07) (built on brownie.buildd [127.0.1.1]) architecture: X86_64

Glossaries version:

Package: glossaries 2014/01/20 v4.03 (NLCT)

Build commands:

rm -f output/report.*
pdflatex -interaction=batchmode -halt-on-error -output-directory output report.tex
xindy -q -L english -C utf8 -I xindy -M "output/report" -t "output/report.glg" -o "output/report.gls" "output/report.glo"
bibtex output/report.aux
pdflatex -interaction=batchmode -halt-on-error -output-directory output report.tex
pdflatex -interaction=batchmode -halt-on-error -output-directory output report.tex
pdflatex -interaction=batchmode -halt-on-error -output-directory output report.tex

Minimal example provided by Nicola:

\documentclass[a4paper,11pt]{scrreprt}
\usepackage{xparse}
\usepackage[toc,xindy]{glossaries}

\makeglossaries

\newcommand*{\glossfirstformat}[1]{\textit{#1}}
\renewcommand*{\glsseeformat}[3][\seename]{\textit{See}:
\glsseelist{#2}} 
\newacronymstyle{myacro}{%
    \GlsUseAcrEntryDispStyle{long-short}%
}%
{%
\GlsUseAcrStyleDefs{long-short}%
\renewcommand*{\genacrfullformat}[1]{%
\glossfirstformat{\glsentrylong{##1}}\space(\glsentryshort{##1})%
}
\renewcommand*{\Genacrfullformat}[2]{%
\glossfirstformat{\Glsentrylong{##1}}\space(\glsentryshort{##1})%
}%
\renewcommand*{\genplacrfullformat}[2]{%
 \glossfirstformat{\glsentrylongpl{##1}}\space(\glsentryshortpl{##1})%
}%
\renewcommand*{\Genplacrfullformat}[2]{%
\glossfirstformat{\Glsentrylongpl{##1}}\space
  (\glsentryshortpl{##1})%
}%
}
\setacronymstyle{myacro}
\defglsentryfmt{%
\ifglshaslong{\glslabel}{%
\glsgenacfmt%
}{%
 \ifglsused{\glslabel}{%
  \glsgenentryfmt%
 }{%
  \glossfirstformat{\glsgenentryfmt}%
  }%
 }%6
}
\renewcommand*{\glsnamefont}{\sffamily}
\DeclareDocumentCommand{\newdualentry}{ O{} O{} m m m m } {%
\newglossaryentry{gls-#3}{name={#5},text={#5\glsadd{#3}},
 description={#6},#1
 }
\newacronym[see={[See:]{gls-#3}},#2]{#3}{#4}{#5\glsadd{gls-#3}}
}

\newglossaryentry{polymesh}{name={polygon mesh},plural={polygon
meshes},description={A storage model that is frequently used in 3D
computer graphics to represent 3D objects}}

\begin{document}

\glspl{polymesh}

\printglossary
\end{document}
  • Can you turn the code into a full compilable document showing the issue? – egreg Jun 13 '15 at 21:08
  • 1
    I get the expected output using glossaries v4.15, so either you have some extra code you haven't told us about (which is why a complete minimal working example is required) or you may be using an old version that has some bug that's been fixed. – Nicola Talbot Jun 22 '15 at 19:12
  • That is all that fiddles with the glossaries package. I thought the custom acronym stuff could make it bail out. BTW, how do I figure out what version of glossaries I have? [texlive-latex-extra version 2013.20140215-2] – user877329 Jun 23 '15 at 7:57
  • 1
    You can find the version number from the log file. (Search for glossaries.sty, or add \listfiles to your document and it will add all the version information at the end of the transcript.) It would help if you could add \documentclass, \makeglossaries and \begin{document}\glspl{polymesh}\end{document} to the code you posted to make it a minimal working example that illustrates the problem. That way we know we're both working with the same code. – Nicola Talbot Jun 23 '15 at 8:24
  • You have an old version of glossaries. It may be related to Acronyms defined in document body result in wrong firstplural. Move \newglossaryentry to the preamble (before \begin{document}) and try again. (And possibly also update your version of glossaries.sty.) – Nicola Talbot Jun 23 '15 at 18:51
1

The following works fine for me:

\documentclass[a4paper,11pt]{scrreprt}
\usepackage{xparse}
\usepackage[toc,xindy]{glossaries}

\makeglossaries

\newcommand*{\glossfirstformat}[1]{\textit{#1}}
\renewcommand*{\glsseeformat}[3][\seename]{\textit{See}:
\glsseelist{#2}} 
\newacronymstyle{myacro}{%
    \GlsUseAcrEntryDispStyle{long-short}%
}%
{%
\GlsUseAcrStyleDefs{long-short}%
\renewcommand*{\genacrfullformat}[1]{%
\glossfirstformat{\glsentrylong{##1}}\space(\glsentryshort{##1})%
}
\renewcommand*{\Genacrfullformat}[2]{%
\glossfirstformat{\Glsentrylong{##1}}\space(\glsentryshort{##1})%
}%
\renewcommand*{\genplacrfullformat}[2]{%
 \glossfirstformat{\glsentrylongpl{##1}}\space(\glsentryshortpl{##1})%
}%
\renewcommand*{\Genplacrfullformat}[2]{%
\glossfirstformat{\Glsentrylongpl{##1}}\space
  (\glsentryshortpl{##1})%
}%
}
\setacronymstyle{myacro}
\defglsentryfmt{%
\ifglshaslong{\glslabel}{%
\glsgenacfmt%
}{%
 \ifglsused{\glslabel}{%
  \glsgenentryfmt%
 }{%
  \glossfirstformat{\glsgenentryfmt}%
  }%
 }%6
}
\renewcommand*{\glsnamefont}{\sffamily}

\newglossaryentry{polymesh}{name={polygon mesh},plural={polygon
meshes},description={A storage model that is frequently used in 3D
computer graphics to represent 3D objects}}

\begin{document}

\glspl{polymesh}

\printglossary
\end{document}

Things to check:

  • make sure you have an up-to-date version of the glossaries package;
  • make sure your definitions are in the preamble;
  • if you are using \newacronym instead of \newglossaryentry, then use \setacronymstyle (as in the example) and the longplural or shortplural keys, as appropriate, to override the default long or short plural forms.

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.