We have some LaTeX designed for Texlive 2013, but we're going to bump to Texlive 2017 (because of Ubuntu 14 EOL).
We use the gridset package to help us align our text to a grid, and (when debugging) we use tikz to draw the grid on the page to check grid alignment.
This works fine in Texlive 2013 & 2015, but breaks in Texlive 2017. Removing tikz compiles with gridset fine. And removing gridset compiles with tikz fine, but using them together causes compilation to fail.
A minimal example looks like:
\documentclass{article}
% Let gridset work with newer versions of LuaLaTeX
\usepackage{luatex85}
% We have to redefine \savepos because there's a name clash
% between a LuaLaTeX primitive and a gridset macro
\let\savepos=\relax
\usepackage{gridset}
\usepackage{tikz}
\usepackage{eso-pic}
% Draw the baseline grid
\AddToShipoutPicture{\AtTextLowerLeft{
\begin{tikzpicture}[overlay,remember picture]%
\draw[
red!50!white,
very thin,
ystep=\baselineskip,
xstep=\textwidth,
yshift=2pt, % manual adjustment to match baseline
]%
(0, 0) grid (\textwidth, \textheight);%
\end{tikzpicture}%
}}%
\begin{document}
\vskipnextgrid % start aligned to grid
Foo
\par\vspace{5pt} % force us off the grid
\vskipnextgrid % force us back onto the grid
Bar
\end{document}
This fails to compile with the following errors:
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Package gridset Error: position `\edef ' is not unique.
See the gridset package documentation for explanation.
Type H <return> for immediate help.
...
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
You have used the position name `\edef ' you are using on page `1'
already on page `\pos@ \edef @page\endcsname '.
You should stop processing, remove the aux-files and correct the names.
If you'd continue, this will result in grid position failures,
that won't be reported!
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Use of \pos@ doesn't match its definition.
<argument> pos@\edef @b
ase
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
If you say, e.g., `\def\a1{...}', then you must always
put `1' after `\a', since control sequence names are
made up of letters only. The macro here has not been
followed by the required stuff, so I'm ignoring it.
! Missing number, treated as zero.
<to be read again>
a
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! Extra \endcsname.
\@nameuse #1->\csname #1\endcsname
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
I'm ignoring this, since I wasn't doing a \csname.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Use of \pos@ doesn't match its definition.
<argument> pos@\edef @i
nterval
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
If you say, e.g., `\def\a1{...}', then you must always
put `1' after `\a', since control sequence names are
made up of letters only. The macro here has not been
followed by the required stuff, so I'm ignoring it.
! Missing number, treated as zero.
<to be read again>
n
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Extra \endcsname.
\@nameuse #1->\csname #1\endcsname
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
I'm ignoring this, since I wasn't doing a \csname.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Use of \pos@ doesn't match its definition.
<argument> pos@\edef @i
nterval
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
If you say, e.g., `\def\a1{...}', then you must always
put `1' after `\a', since control sequence names are
made up of letters only. The macro here has not been
followed by the required stuff, so I'm ignoring it.
! Missing number, treated as zero.
<to be read again>
n
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Arithmetic overflow.
<to be read again>
n
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
I can't carry out that multiplication or division,
since the result is out of range.
! Extra \endcsname.
\@nameuse #1->\csname #1\endcsname
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
I'm ignoring this, since I wasn't doing a \csname.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Use of \pos@ doesn't match its definition.
<argument> pos@\edef @i
nterval
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
If you say, e.g., `\def\a1{...}', then you must always
put `1' after `\a', since control sequence names are
made up of letters only. The macro here has not been
followed by the required stuff, so I'm ignoring it.
! Missing number, treated as zero.
<to be read again>
n
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Extra \endcsname.
\@nameuse #1->\csname #1\endcsname
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
I'm ignoring this, since I wasn't doing a \csname.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Use of \pos@ doesn't match its definition.
<argument> pos@\edef @y
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
If you say, e.g., `\def\a1{...}', then you must always
put `1' after `\a', since control sequence names are
made up of letters only. The macro here has not been
followed by the required stuff, so I'm ignoring it.
! Missing number, treated as zero.
<to be read again>
\endcsname
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Extra \endcsname.
<recently read> \endcsname
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
I'm ignoring this, since I wasn't doing a \csname.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Use of \pos@ doesn't match its definition.
<argument> pos@\edef @b
ase
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
If you say, e.g., `\def\a1{...}', then you must always
put `1' after `\a', since control sequence names are
made up of letters only. The macro here has not been
followed by the required stuff, so I'm ignoring it.
! Extra \endcsname.
\@nameuse #1->\csname #1\endcsname
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
I'm ignoring this, since I wasn't doing a \csname.
! Missing number, treated as zero.
<to be read again>
)
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
! Missing control sequence inserted.
<inserted text>
\inaccessible
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
Please don't say `\def cs{...}', say `\def\cs{...}'.
I've inserted an inaccessible control sequence so that your
definition will be completed without mixing me up too badly.
You can recover graciously from this error, if you're
careful; see exercise 27.2 in The TeXbook.
! Missing \endcsname inserted.
<to be read again>
\edef
l.2 ...edef }{1}{46515936}{786432}{9017753}{7844659}
The control sequence marked <to be read again> should
not appear between \csname and \endcsname.
Does anyone have any ideas on how to fix this?
tikzand\let\savepos=\relax, but nogridsetand it seemed to work). I'm pretty new to LaTeX hackery; is there any workaround? Or would I have to eg copy-paste thegridsetpackage and just renamesaveposmyself to something else to avoid clashing? – Alec Sep 14 '18 at 10:18