tectonic icon indicating copy to clipboard operation
tectonic copied to clipboard

Minted `autogobble` breaks content of listings

Open fezjo opened this issue 1 year ago • 0 comments

Version: Tectonic 0.14.1 OS: Arch Linux

Presence of autogobble setting causes wrong listing content to be displayed when using both minted and inputminted commands.

Content of problem.py


print("file")

Content of problem.tex:

\documentclass[10pt,a4paper]{article}
\usepackage[cache=false]{minted} % Line A1
% \usepackage[cache=false,outputdir=latex.out]{minted} % Line A2

\setminted{autogobble=true} % Line B

\begin{document}

\inputminted{python}{problem.py} % line C1

% Block C2
\begin{minted}{python}
    print("begin")
\end{minted}

\mint{python}{    print("mint")} % Line C3

\inputminted{python}{problem.py} % line C4

\end{document}

Behaviour:

  • Code with active parts A1 C1 C2 C3 C4 ran as tectonic problem.tex -Zshell-escape-cwd=. produces correct
print("file")
     print("begin")
     print("mint")
print("file")
  • Code with active parts A1 B C1 C2 C3 C4 ran as tectonic problem.tex -Zshell-escape-cwd=. does not output error and still produces incorrect
print("file")
    print("begin")
    print("mint")
    print("mint")
  • Code with active parts A1 C1 C2 C3 C4 ran as tectonic problem.tex -Zshell-escape outputs error and produces incorrect
    print("begin")
    print("mint")
    print("mint")
  • Code with active parts A1 B C1 C2 C3 C4 ran as tectonic problem.tex -Zshell-escape outputs error and still produces incorrect
    print("mint")
    print("begin")
    print("mint")
    print("mint")
  • Code with active parts A1 B C1 C4 ran as tectonic problem.tex -Zshell-escape-cwd=. produces correct
print("file")
print("file")
  • Code with active parts A1 C1 C2 C3 C4 or A1 B C1 C2 C3 C4 ran as latexrun --latex-args="-shell-escape" problem.tex produces incorrect
print("file")
print("file")
print("file")
print("file")
  • Code with active parts A2 C1 C2 C3 C4 ran as latexrun --latex-args="-shell-escape" problem.tex produces correct
print("file")
    print("begin")
    print("mint")
print("file")
  • Code with active parts A2 B C1 C2 C3 C4 ran as latexrun --latex-args="-shell-escape" problem.tex produces correct
print("file")
print("begin")
print("mint")
print("file")

In summary, latexrun is able to produce correct output regardless of autogobble setting when specifying outputdir. Tectonic is able to produce correct output when using at most two out of

  • autogobble
  • inputminted
  • in-Latex code

However using all three, the content of inputminted parts contains the content of last in-Latex code block.

The minted package is too finicky. Maybe this is issue with minted, maybe with tectonic. I can't tell.

fezjo avatar Nov 11 '23 12:11 fezjo