pgf icon indicating copy to clipboard operation
pgf copied to clipboard

pgfsyspdfmark is undefined when used in aux file

Open user202729 opened this issue 9 months ago • 1 comments

Brief outline of the bug

As in the title. When \usepackage{tikz} is deleted, the error surface.

Suggestion: include appropriate \providecommand if the command appear in aux file.

(Once reported in https://tex.stackexchange.com/questions/550704/pgfsyspdfmarkpgfid1889951814980839 but neglected.)

Minimal working example (MWE)

To reproduce:

\documentclass{article}
\usepackage{tikz}
\begin{document}
123
\begin{tikzpicture}[remember picture]
\end{tikzpicture}
\end{document}

Compile, delete \usepackage{tikz}, then compile again.

Error: Undefined control sequence. \pgfsyspdfmark

user202729 avatar May 07 '24 21:05 user202729

Wouldn't this still break since \begin{tikzpicture} is then undefined?

But I think your argument is focused on remaining commands in the aux file: Isn't this a general problem? Is this even addressed in a consistent manner in different packages? I don't think so.

If, to take another package as example, I have the following code

\documentclass{article}

\begin{filecontents}[overwrite]{mybib.bib}
	@article{test,
		title={title}
	}
\end{filecontents}

\usepackage{biblatex}
\addbibresource{mybib.bib}

\begin{document}
	Citing \cite{test}.
	\printbibliography
\end{document}

and compile this using pdflatex and run biber, then delete \usepackage{biblatex}, \addbibresource{mybib.bib}, \cite{test} and \printbibliography and compile then again using pdflatex, I get a similar error, since \abx@aux@refcontext is undefined.

Thus, I would argue that this is normal behaviour of LaTeX and the user should recompile from scratch after having used packages that write to the aux file. So, I do understand your point, but I think that this is not a bug really.

jasperhabicht avatar May 08 '24 06:05 jasperhabicht