Bug Tracker

ID 102 Closed (Can Not Implement) glossaries 4.18 \printglossary outputs extra empty pages when there is no glossary file yet

Report

Hello, when glossary files are not ready yet, there are extra empty pages due to use of \null in
  \IfFileExists{\jobname.\csname @glotype@\@glo@type @in\endcsname}%
{}%
{\null}%

Is there some reason to use \null instead of \relax? It seems to work correctly with \relax instead of \null as far as I tried. Regards,

Andrzej Giniewicz

MWE

\documentclass{book}
\usepackage{glossaries}
\makeglossary
\begin{document}
\printglossary
\cleardoublepage
\end{document}


Evaluation

The reason for this is given in the documented code (section 1.16):
If the glossary file doesn't exist, do \null. (This ensures that the page is shipped out and all write commands are done.) This might produce an empty page, but at this point the document isn't complete, so it shouldn't matter.
I think this is a feature rather than a bug. It's more important that the external files are completed and closed in the event that the glossary occurs right at the end of the document otherwise the glossary may not be properly generated by makeindex/xindy.

Comment from anonymous
Date: 2015-12-01 04:21:27 CST

Would it then be possible to make the behaviour consistent with table of contents (output chapter or section text in that case, so the page is not empty)?

Comment from Nicola Talbot
Date: 2015-12-03 15:55:00 GMT

I can't do this without breaking backward-compatibility. There are users who will do something like:

\documentclass{article}

\usepackage[acronym]{glossaries-extra}

\makeglossaries

\newacronym{laser}{laser}{light amplification by stimulated

\begin{document}

\gls{laser}

\printglossaries

\end{document}

and then just run makeindex on the acronym file. The proposed modification would insert an empty section for the "main" glossary. (Of course, the simple fix is to add the "nomain" option to the package list, but people tend to get upset if the default behaviour suddenly changes.)

However, I have added it as the default (along with explanatory text) to the glossaries-extra package, which is currently still under development.

Comment from Nicola Talbot
Date: 2016-04-30 16:40:00 BST

The glosssaries-extra package is now on CTAN, so I'm closing this as "Can Not Implement" as it can't be implemented in glossaries, but you can use glossaries-extra instead.

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.)

Comment

You can append a comment to the report using the form below. Comments are checked first before being added. Any spam or offensive content will be removed first according to this site's Terms of Website Use. Please bear in mind that I develop and maintain free software in my spare time. If you want commerical level support then you can hire a TeX consultant.

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. If provided, it will be shown with the comment.) Message: You can use the following markup: [pre]Displayed verbatim[/pre] [tt]monospace text[/tt] [em]emphasized text[/em] [b]bold text[/b] [url]web address[/url] Ordered list: [ol] [li]first item[/li] [li]second item[/li] [/ol] Unordered list: [ul] [li]first item[/li] [li]second item[/li] [/ul]

Click on the Preview button to preview the message.