Latest news 2020-07-03: SmashWords sale (ends 31st July 2020): 50% off crime/SF novel The Private Enemy and 100% off (free!) I’ve Heard the Mermaid Sing.

# Bug Tracker

ID: 69 🔗 Closed (Fixed) glossaries 4.11 Eelco de Groot 2014-10-03 15:13:38 \glsadd cancels effect of \nobreak

## Report

\glsadd doesn't add any text at that point in the document as advertised, but it can add a possible page break, still altering the output. This happens whenever I use vertical space that cannot be broken across pages, followed by \glsadd (which is still in vertical mode), followed by the start of the next paragraph. Somehow \glsadd in vertical mode must add either an empty box followed by glue or a penalty larger than -10000.

### MWE

 % This is a minimal file for testing and debugging
% the glossaries package. Change the class file as
% desired, and add the relevant package options to
% both the class file and the glossaries package.
% Change the sample glossary entry and acronym if
% required. If the problem occurs with an additional
% glossary, add in the relevant \newglossary command
% and a sample entry.
%
% Only add extra packages or commands if they
% contribute to whatever problem you are trying to
% test.
%
% Remember that the document will not be complete
% until you have successfully completed all of the
% following steps:
% 1. latex minimalgls
% 2. makeglossaries minimalgls (note no extension)
% 3. latex minimalgls
% A further run through LaTeX will be required to ensure that
% is used.
\documentclass{article}
\listfiles
\usepackage[T1]{fontenc}
\usepackage[xindy]{glossaries}

\makeglossaries

\newglossaryentry{brod}{name={br\o d},sort={brod},description={Bread like one eats it in Denmark}}

\begin{document}
People eat \gls{bread}. Danish peaple are like ordinary people, so they eat danish bread.
Danish bread is also called \gls{brod}.

\vspace{8cm plus 1cm minus 1cm}

We need some glue on this page. It's rather stretchable glue, to demonstrate what is going wrong. The
goal is to fill the page to the end, where we will quote a letter.

\vspace{7cm plus 1cm minus 1cm}

We have come close to the bottom of the page now, so it's time to quote the letter.

\vspace{2cm plus 1cm minus 0.8cm}

\noindent Dear Mr\@. Baker,\par
\nobreak%
\vspace{1cm plus 0.4cm minus 0.3cm}%
%Remove both \glsadd commands and a page break here will be properly prevented
%What also works is putting \indent or \noindent in front of \glsadd to move it into the horizontal
%material of the paragraph, instead of in the vertical material just before it.
The bread delivered today was again old and moldy. This has happened on previous occasions zeven times
in the past month. Therefore I wish to terminate my contract for daily deliveries of bread. I hope to

\nobreak\vspace{1cm plus 0.4cm minus 0.3cm}
\noindent Sincerely, Mr\@. Smith\\
Bletchley\\
XY1-234

\vspace{2cm plus 1cm minus 0.8cm}
\printglossaries
\end{document}


## Evaluation

Fixed in version 4.12

## Watch This Report

If you supply your name, it will be used in the email greeting, which provides a more personal message, otherwise you'll just get a generic greeting. If you have previously supplied your name when signing up for notifications, you don't need to resupply it unless you want to change it.

If you have previously subscribed to notifications for this report, you can unsubscribe by clicking on the "Stop Notification" button.

The "Confirm Bug ID" field helps to protect against spambots. Please enter the bug ID (which you can find at the top of this page).

Name: (Optional.)