Is it normal that I cannot access the by nicematrix generated Tikz nodes within the same align environment?
Example:
\begin{align*}
\begin{pNiceMatrix}[name=myMatrix]
1 & 1 & 1 \\
2 & 2 & 2 \\
\end{pNiceMatrix}
\begin{tikzpicture}[remember picture, overlay]
\draw (myMatrix-1-1) -- (myMatrix-1-2);
\end{tikzpicture}
\end{align*}
won't work, but
\begin{align*}
\begin{pNiceMatrix}[name=myMatrix]
1 & 1 & 1 \\
2 & 2 & 2 \\
\end{pNiceMatrix}
\end{align*}
\begin{tikzpicture}[remember picture, overlay]
\draw (myMatrix-1-1) -- (myMatrix-1-2);
\end{tikzpicture}
works.
This is a bit inconvenient when one wants to stay in the same align environment after the pNiceMatrix (otherwise there will be free space between the matrix and the next line in the same environment and writing in the same line as the matrix is not possible (at least it's difficult when writing macros).
Is there a way to "fix" this?
legacy(and could you explain what the\legacy_if:nF {measuring@}does?) – atticus Jun 05 '20 at 19:28amsmathuses boolean\ifmeasuring@to test if it is in "measure" typeset phase or "production" phase (seeamsmathimplementation notes, sec. 17.2).\legacy_if:nF{<latex2e boolean>}{<if false>}is the latex3 style if-then-else function (seetexdoc interface3, Part XXXIV). – muzimuzhi Z Jun 05 '20 at 19:35legacymeans that this is a latex3 conditional structure using an TeX boolean in the old style. There is no problem in using it. – F. Pantigny Jun 05 '20 at 19:37align) like when using something like\centering? – atticus Jun 05 '20 at 19:40\WhenNotMeasuringtakes one argument, and executes it only if\ifmeasuring@is false, aka in the amsmath "production" phase. To sum up, inalign*'s "measure" phase (first typeset), thepNiceMatrixis constructed and tikz code is omit, and in "production" phase (second typeset),pNiceMatrixis constructed again with cell nodes drawn and the following tikz code relying those cell nodes is executed. – muzimuzhi Z Jun 05 '20 at 19:45nicematrixbut only within thetikzpicturebut this will be part of another question for which I'll have to wait because of the stackexchange cooldown) – atticus Jun 05 '20 at 20:10