# Glossaries jump page in twocolumn document

I am getting a strange behavior with glossaries package. If a place a large number of entries while using a twocolumn document, sometimes I get underfull columns with the glossary jumping inexplicably to the next page. I know that I can avoid it using a different glossaries style, but the idea is having a fancy aligned list of entries. Following you can find a minimal working example:

\documentclass[twocolumn]{article}

\usepackage{lipsum}
\usepackage{pgffor}
\usepackage[nonumberlist,nogroupskip]{glossaries}
\makeglossary

\begin{document}
\title{Minimal working example of glossaries in twocolumn document using \texttt{super} style and a long list of entries spanning in more than one page and more than one column}
\author{Author}
\maketitle
\begin{abstract}
\lipsum[1-2]
\end{abstract}

\foreach \n in {1,...,30}{\newglossaryentry{x\n}{name=var, description=Dummy entry with a long description}}

\printglossary[title=Nomenclature,style=super]

\section{More text}
\lipsum[1-10]

\end{document}

• Any news here? Does the answer solves your question? If yes you could accept and vote ... – Bobyandbob May 18 '18 at 12:41

Unfortunately the problem stems from the supertabular environment determining that there isn't sufficient space in the column, which triggers a page break. The effect can be reproduced without the glossaries package. This is essentially what the glossaries package is doing behind the scenes:

\documentclass[twocolumn]{article}

\usepackage{lipsum}
\usepackage{pgffor}
\usepackage[debugshow]{supertabular}

\begin{document}
\title{Minimal working example of glossaries in twocolumn document using \texttt{super} style and a long list of entries spanning in more than one page and more than one column}
\author{Author}
\maketitle
\begin{abstract}
\lipsum[1-2]
\end{abstract}

\section*{Nomenclature}
\begin{supertabular}{lp{.6\hsize}}
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
\end{supertabular}

\section{More text}
\lipsum[1-10]

\end{document}


I've used the debugshow option, which makes supertabular write extra information to the log file. This information starts with:

Package supertabular: Starting a new supertabular on input line 16.

Package supertabular: Average line height: 13.0pt on input line 16.

Package supertabular: Stretched line height: 1.0pt on input line 16.

Package supertabular: Calculating height of tabular on first page on input line
16.

Package supertabular: Height of text = 388.97215pt;
(supertabular)        Height of page = 384.26657pt on input line 16.

Package supertabular: two column mode on input line 16.

Package supertabular: First column on input line 16.

Package supertabular: Second column on input line 16.

Package supertabular: Available height: -4.70558pt on input line 16.

LaTeX Font Info:    External font cmex10' loaded for size
(Font)              <7> on input line 16.
LaTeX Font Info:    External font cmex10' loaded for size
(Font)              <5> on input line 16.

Package supertabular: Height of head: 2.5pt on input line 16.

Package supertabular: Height of tail: 15.5pt on input line 16.

Package supertabular: Maximum height of tabular: -4.70558pt on input line 16.

Package supertabular: Minimum height of tabular: 31.0pt on input line 16.

Package supertabular: starting new page on input line 16.


It seems to be the section header that's throwing the calculations. However, if a page break is forced immediately before the section header, then the tabulated content fits:

\documentclass[twocolumn]{article}

\usepackage{lipsum}
\usepackage{pgffor}
\usepackage[debugshow]{supertabular}

\begin{document}
\title{Minimal working example of glossaries in twocolumn document using \texttt{super} style and a long list of entries spanning in more than one page and more than one column}
\author{Author}
\maketitle
\begin{abstract}
\lipsum[1-2]
\end{abstract}

\pagebreak
\section*{Nomenclature}

\begin{supertabular}{lp{.6\hsize}}
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
var & Dummy entry with a long description\\
\end{supertabular}

\section{More text}
\lipsum[1-10]

\end{document}


So it seems to be some kind of odd feature of supertabular. The same patch works with your MWE:

\documentclass[twocolumn]{article}

\usepackage{lipsum}
\usepackage{pgffor}
\usepackage[nonumberlist,nogroupskip]{glossaries}

\makeglossaries

\foreach \n in {1,...,30}{\newglossaryentry{x\n}{name=var, description=Dummy entry with a long description}}

\begin{document}
\title{Minimal working example of glossaries in twocolumn document using \texttt{super} style and a long list of entries spanning in more than one page and more than one column}
\author{Author}
\maketitle
\begin{abstract}
\lipsum[1-2]
\end{abstract}

\pagebreak
\printglossary[title=Nomenclature,style=super]

\section{More text}
\lipsum[1-10]

\end{document}


This is a bit of a kludge. I know you don't want to change style, but there is an alternative style that produces a tabular-like result without actually using a tabular-like environment, which you might want to consider. For example:

\documentclass[twocolumn]{article}

\usepackage{lipsum}
\usepackage{pgffor}
\usepackage[nonumberlist,nogroupskip]{glossaries}

\makeglossaries

\foreach \n in {1,...,30}{\newglossaryentry{x\n}{name=var, description={Dummy entry with a long description, and some more padding}}}

\glsfindwidesttoplevelname
\renewcommand*{\glstreenamefmt}[1]{#1}

\begin{document}
\title{Minimal working example of glossaries in twocolumn document using \texttt{super} style and a long list of entries spanning in more than one page and more than one column}
\author{Author}
\maketitle
\begin{abstract}
\lipsum[1-2]
\end{abstract}

\printglossary[title=Nomenclature,style=alttree]

\section{More text}
\lipsum[1-10]

\end{document}


The available width for the name is computed using \glsfindwidesttoplevelname. Alternatively, you can set the widest value using \glssetwidest:

\documentclass[twocolumn]{article}

\usepackage{lipsum}
\usepackage{pgffor}
\usepackage[nonumberlist,nogroupskip]{glossaries}

\makeglossaries

\foreach \n in {1,...,30}{\newglossaryentry{x\n}{name=var, description={Dummy entry with a long description, and some more padding}}}

\glssetwidest{XXXXXX}
\renewcommand*{\glstreenamefmt}[1]{#1}

\begin{document}
\title{Minimal working example of glossaries in twocolumn document using \texttt{super} style and a long list of entries spanning in more than one page and more than one column}
\author{Author}
\maketitle
\begin{abstract}
\lipsum[1-2]
\end{abstract}

\printglossary[title=Nomenclature,style=alttree]

\section{More text}
\lipsum[1-10]

\end{document}


The MWE only has the same short name. The style is demonstrated more clearly with the entries from the example-glossaries-long.tex test file (provided with the glossaries package).

\documentclass[twocolumn]{article}

\usepackage{lipsum}
\usepackage[nonumberlist,nogroupskip]{glossaries}

\makeglossaries

\glsfindwidesttoplevelname
\renewcommand*{\glstreenamefmt}[1]{#1}

\begin{document}
\title{Minimal working example of glossaries in twocolumn document using \texttt{super} style and a long list of entries spanning in more than one page and more than one column}
\author{Author}
\maketitle
\begin{abstract}
\lipsum[1-2]
\end{abstract}

\printglossary[title=Nomenclature,style=alttree]

\section{More text}
\lipsum[1-10]

\end{document}


Unlike the tabular styles, this allows a line break mid-description, which may or may not be appropriate for you.