In the example below I provided a small test package mytestpackage.sty
which uses the syntax of expl3
.
If I use the command \usetikzlibrary
inside the package I will get the error:
Runaway argument?
v\pgfversion ]$Header:/cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz\ETC.
! File ended while scanning use of \next.
<inserted text>
\par
The MWE:
\documentclass{report}
\usepackage{filecontents}
\begin{filecontents}{mytestpackage.sty}
\RequirePackage{expl3}
\ProvidesExplPackage{mytestpackage}{2012/05/26} {0.1}{mytestpackage}
\RequirePackage{tikz}
\usetikzlibrary{calc,backgrounds,arrows,matrix}
\end{filecontents}
\usepackage{mytestpackage}
\begin{document}
foo bar
\end{document}
The first quick fix is:
\ExplSyntaxOff
\usetikzlibrary{calc,backgrounds,arrows,matrix}
\ExplSyntaxOn
How can I patch TikZ (\usetikzlibrary
) to use it inside my package?
Based on this solution we can send a bug report.
expl3
context is quite hard, because it relies on the space being a space and probably also on:
and_
having their normal category code.tikz
and the tikzlibraries before\ProvidesExplPackage