2

An issue occurs when one wants, on one hand, to have more than five "local" glossaries and a main glossary (glossaries packages) and, on the other hand, to use also biblatex and tcolorbox with its minted option (LuaLaTeX with --shell-escape option for minted and the remainder contents of a class).

The error appears in the sixth "glo file" (here .local06-glo), stipulating in its fist line:

[Loading MPS to PDF converter (version 2006.09.02).]

The following test have been done (for up to five local glossaries, all works fine) and give:

  1. minted + glossaries + biblatex --> works (6 local glossaries + main)

  2. tcolorbox (without minted option but solely or with all the other options) + glossaries + biblatex --> works (6 local glossaries + main)

  3. tcolorbox with only the minted option + glossaries --> works (6 local glossaries + main)

  4. tcolorbox with only the minted option + glossaries + biblatex --> fails (5 local glossaries + main works)

Obviously, if the error line is deleted, the xindy application or makeglossaries script are running fine.

Thus, is the insolent package is tcolorbox with its minted option or the responsibility belongs to a linear combination of these three packages which leads to an inconsistency?

A bit tricky for me, firstly because it's the first time I encounter such an error but, mostly because I don't know where to search a solution: these three, or four packages with minted, are essential.

MWE

\begin{filecontents*}{glossary-main.def}
\newglossaryentry{one-main}{
  name={main first},
  description={main first explanation},
}
\newglossaryentry{two-main}{
  name={main second},
  description={main second explanation},
}
\end{filecontents*}

\begin{filecontents*}{glossary-local01.def}
\newglossaryentry{one-local01}{
  type=local01,
  name={local01 first},
  description={local01 first explanation},
}
\newglossaryentry{two-local01}{
  type=local01,
  name={local01 second},
  description={local01 second explanation},
}
\end{filecontents*}

\begin{filecontents*}{glossary-local02.def}
\newglossaryentry{one-local02}{
  type=local02,
  name={local02 first},
  description={local02 first explanation},
}
\newglossaryentry{two-local02}{
  type=local02,
  name={local02 second},
  description={local02 second explanation},
}
\end{filecontents*}

\begin{filecontents*}{glossary-local03.def}
\newglossaryentry{one-local03}{
  type=local03,
  name={local03 first},
  description={local03 first explanation},
}
\newglossaryentry{two-local03}{
  type=local03,
  name={local03 second},
  description={local03 second explanation},
}
\end{filecontents*}

\begin{filecontents*}{glossary-local04.def}
\newglossaryentry{one-local04}{
  type=local04,
  name={local04 first},
  description={local04 first explanation},
}
\newglossaryentry{two-local04}{
  type=local04,
  name={local04 second},
  description={local04 second explanation},
}
\end{filecontents*}

\begin{filecontents*}{glossary-local05.def}
\newglossaryentry{one-local05}{
  type=local05,
  name={local05 first},
  description={local05 first explanation},
}
\newglossaryentry{two-local05}{
  type=local05,
  name={local05 second},
  description={local05 second explanation},
}
\end{filecontents*}

\begin{filecontents*}{glossary-local06.def}
\newglossaryentry{one-local06}{
  type=local06,
  name={local06 first},
  description={local01 first explanation},
}
\newglossaryentry{two-local06}{
  type=local06,
  name={local06 second},
  description={local06 second explanation},
}
\end{filecontents*}


\documentclass{book}

% OK with biblatex + glossaries (6 local + main)
%\usepackage{minted}

% OK with biblatex + glossaries (6 local + main)
\usepackage{tcolorbox}

% OK with biblatex + glossaries (5 local + main)
% FAILED with biblatex + glossaries (6 local + main)
\tcbuselibrary{minted}% loads also the `minted' package

\usepackage{biblatex}

\usepackage{hyperref}% Before `glossaries`

\usepackage[xindy,section=subsection]{glossaries}
\usepackage{glossaries-extra}

\newcommand{\glsmain}[1]{\gls{#1-main}}% For main glossary references

\usepackage{lipsum}

\newglossary*{local01}{Contextual glossary}
\newglossary*{local02}{Contextual glossary}
\newglossary*{local03}{Contextual glossary}
\newglossary*{local04}{Contextual glossary}
\newglossary*{local05}{Contextual glossary}
\newglossary*{local06}{Contextual glossary}

\makeglossaries

\loadglsentries{glossary-main.def}%
\loadglsentries{glossary-local01.def}%
\loadglsentries{glossary-local02.def}%
\loadglsentries{glossary-local03.def}%
\loadglsentries{glossary-local04.def}%
\loadglsentries{glossary-local05.def}%
\loadglsentries{glossary-local06.def}%

\parindent=0pt


\begin{document}


\chapter{First chapter}

\section{Test glossaries}

\lipsum[2]

Main glossary: \glsmain{one}, \glsmain{two}

First local glossary: \gls{one-local01}, \gls{two-local01}.

Second local glossary: \gls{one-local01}, \gls{two-local01}.

Third local glossary: \gls{one-local01}, \gls{two-local01}.

Fourth local glossary: \gls{one-local01}, \gls{two-local01}.

Fifth local glossary: \gls{one-local01}, \gls{two-local01}.

Sixth local glossary: \gls{one-local01}, \gls{two-local01}.


\section{Display local glossaries}

\glsaddallunused[local01]
\printunsrtglossary[type=local01]

\glsaddallunused[local02]
\printunsrtglossary[type=local02]

\glsaddallunused[local03]
\printunsrtglossary[type=local03]

\glsaddallunused[local04]
\printunsrtglossary[type=local04]

\glsaddallunused[local05]
\printunsrtglossary[type=local05]

\glsaddallunused[local06]
\printunsrtglossary[type=local06]


\chapter*{Main glossary}

\glsaddallunused[main]
\printglossary[type=main]

\end{document}
ejazz
  • 1,047
  • 3
    well it is this problem. https://tex.stackexchange.com/a/435226/2388. But I don't know yet where the code is that writes to stream 16. – Ulrike Fischer Apr 28 '20 at 18:45
  • 3
    The culprit is supp-pdf.mkii, it contains a \immediate\write16. – Ulrike Fischer Apr 28 '20 at 19:01
  • 2
    Try as a workaround \newcommand\writestatus[2]{} at the begin of your document (e.g before the \documentclass.) – Ulrike Fischer Apr 28 '20 at 19:13
  • @Ulrike Fischer Many thanks for your prompt replies and efficient workaround. Is this workaround more or less "stable", in the sense that it allows sufficient room for other writes? A couple of days ago, I had a similar issue with many verbatim writes (a bug from my code to store exercises/solutions). If my understanding is correct, by using LuaLaTeX, I thought that there were no limitation (from its documentation, morewrites is of no help with LuaTeX). – ejazz Apr 29 '20 at 08:08
  • 1
    The workaround doesn't creates more writes. That is not your problem, luatex has enough writes. The problem is that supp-pdf.mkii writes into your glossary file as it is using a hard coded stream number. We are just discussing how to solve this permantly, but the file is under another copyright so it will need a bit time. The workaround should be unproblematic even if we change something. – Ulrike Fischer Apr 29 '20 at 08:18
  • @Ulrike Fischer Thanks again. I was just trying to see what the supp-pdf.mkii file was supposed to do and I noticed that it belongs to the Context environment with another copyright. – ejazz Apr 29 '20 at 08:30

0 Answers0