2

Since filecontents is usable into document (LaTeX2e <2019-10-01> patch level 3), the etex package breaks the filecontents new \write...

With TeXLive 2018, the following code is ok:

\documentclass{article}
\usepackage{etex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname-0.vrb}
content
\end{filecontents*}
\begin{document}
A
\end{document}

With TeXLive 2019 and LaTeX2e <2019-10-01>, the following (equivalent) code is broken:

\documentclass{article}
\usepackage{etex}
%\usepackage{filecontents}
\begin{filecontents*}[force]{\jobname-0.vrb}
content
\end{filecontents*}
\begin{document}
A
\end{document}

The error message is:

! No room for a new \write .
\ch@ck ...\else \errmessage {No room for a new #3}
                                                  \fi 
l.4 \begin{filecontents*}[force]{\jobname-0.vrb}
Paul Gaborit
  • 70,770
  • 10
  • 176
  • 283
  • IIRC, since 2015 the LaTeX kernel incorporates most of etex. Is there a particular reason for using it nowadays? – campa Dec 16 '19 at 10:23
  • Don't use etex. – Ulrike Fischer Dec 16 '19 at 10:23
  • @UlrikeFischer But some old documents (or maybe some packages) use it... – Paul Gaborit Dec 16 '19 at 10:53
  • But old documents shouldn't use the new filecontents syntax. If you can change this why can't you also remove etex? Beside this the problem is known: https://github.com/davidcarlisle/dpctex/issues/23 – Ulrike Fischer Dec 16 '19 at 10:55
  • https://github.com/latex3/latex2e/issues/238 – David Carlisle Dec 16 '19 at 11:42
  • @DavidCarlisle Thanks! – Paul Gaborit Dec 16 '19 at 15:05
  • while this error condition could be avoided (and I guess we will do that) not loading etex.sty is vastly prefereable, its only purpose is to force the allocation system back to the version implemented in the original etex.sty so undoing most of the format changes in that area over the last 5 years and making the document quite likely incompatible with any code written in that time. It might possibly be needed for compatibility with old documents that used the etex.sty features, and don't use any new packages but.... – David Carlisle Dec 16 '19 at 15:13
  • @DavidCarlisle My old documents uses etex and the filecontents package (which overwrites files by default). With the new version of LaTeX, the default behavior of filecontents is reversed and, if I add the [overwrite] option, is not compatible with etex... These documents have been working fine for at least 10 years. – Paul Gaborit Dec 16 '19 at 16:12
  • yes but removing etex is the simplest fix. I could just make etex.sty do nothing (which would fix your case) but then documents using etex.sty commands like \globcount fail. As I say we can tweak things to avoid this error in your case but full compatibility is hard and keeping the old allocator so not allowing more than 256 count registers by default, when there are 32 thousand available can't really be justified, so something had to give. – David Carlisle Dec 16 '19 at 16:23

0 Answers0