Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some code requires multiple executions of the engine #20

Open
ea42gh opened this issue Aug 25, 2020 · 2 comments
Open

some code requires multiple executions of the engine #20

ea42gh opened this issue Aug 25, 2020 · 2 comments

Comments

@ea42gh
Copy link

ea42gh commented Aug 25, 2020

  • 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

@ea42gh
Copy link
Author

ea42gh commented Aug 25, 2020

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

@fpantigny
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants