How to use TikZ external library in combination with the nicematrix package?
I tried to use the external library in combination with the nicematrix package (version August 12, 2018) to increase the compilation speed. But it does not work as expected.
Hier a minimal example:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{external}
%\tikzexternalize % activate!
\usepackage{nicematrix}
\begin{document}
% Test 1
\begin{flalign}
\begin{bNiceMatrix}
0 & \Cdots & 0 \\\Vdots & & \Vdots \\0 & \Cdots & 0
\end{bNiceMatrix}
\end{flalign}
% Test 2
\begin{flalign}
\begin{tikzpicture}[baseline,inner sep = 0pt]
\node {$
\begin{bNiceMatrix}
0 & \Cdots & 0 \\\Vdots & & \Vdots \\0 & \Cdots & 0
\end{bNiceMatrix}
$};
\end{tikzpicture}
\end{flalign}
% Test 3
\begin{flalign}
\begin{tikzpicture}[baseline,inner sep = 0pt]
\node {$
\begin{pNiceArrayRC}{CC}%
C_1 & C_2 \\1 & 2 & L_1\\4 & 5 & L_2\\
\end{pNiceArrayRC}
$};
\end{tikzpicture}
\end{flalign}
\end{document}
Here the results of the tests:
- Not external, test 1: No problem.
- Not external, test 2: No problem. Same result as for test 1.
- Not external, test 3: No problem.
- External, test 1: Error.
Line 1: Extra }, or forgotten $. ...nt }]\bgroup \box_use:N \l_tmpa_box \egroup
- External, test 2: No error, but output not as expacted.
- External, test 3: Error.
Package tikz Error: Sorry, the system call 'pdflatex -shell-escape -halt-on-e
Embedding the nicematrix in a tikz picture does not really solve the problem. Which might be doe to nested tikz pictures (see pgfmanual 50.2).
Does anyone have an idea how to overcome this issue?
nicearray
uses TikZ pictures with the overlay and remember picture options which is not supported in terms of externalization. – TeXnician Sep 14 '18 at 10:07nicematrix
and notnicearray
. Indeed, all the lines are drawn with the optionsoverlay
andremember picture
and thus, I think that externalization is not possible. – F. Pantigny Sep 14 '18 at 17:26