itikz
itikz copied to clipboard
some code requires multiple executions of the engine
- itikz version:0.1.5
- Python version: 3.8.2
- Operating System: linux
Description
latex engine needs executing more than once.
What I Did
%%itikz --temp-dir --implicit-standalone --tex-packages=nicematrix,tikz
\NiceMatrixOptions{code-for-last-row = \color{red}, code-for-first-row = \color{red}}
$\begin{pNiceArray}{cccc|c}[left-margin = 4pt, first-col, last-row,
code-before =
{
\tikz \draw[red!55] (row-1-|col-1) -- (row-2-|col-1) -- (row-2-|col-3) -- (row-3-|col-3) -- (row-3-|col-6);
}
]
& \color{red}{1} & 2 & 1 & 1 & \; 5 \\
& 0 & 0 & \color{red}{2} & 1 & \; -1 \\
& 0 & 0 & 0 & 0 & 0 \\
\color{blue}{\begin{matrix} \text{basic variables} \\ \text{free variables} \end{matrix}} & \begin{matrix}\ x_1 \\ \\ \end{matrix} & \begin{matrix}\\ \ x_2=\alpha \\ \end{matrix} & \begin{matrix}\ x_3\\ \\ \end{matrix} & \begin{matrix} \\ \ x_4=\beta \\ \end{matrix} & \\
\end{pNiceArray}$
the tikz path is not shown
I hacked the code to add a parameter nexec:
for _ in range(nexec-1):
subprocess.run([tex_program, tex_filename], cwd=working_dir)
check_output([tex_program, tex_filename], cwd=working_dir)
check_output(["pdf2svg", pdf_path, svg_path], cwd=working_dir)
the example above requires nexec=4
I suggest you to use the option --tex-program of itikz with the value latexmk (which will do the required TeX compilations for you).
%%itikz --temp-dir --implicit-standalone --tex-packages=nicematrix --tex-program=latexmk