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

Minted autogobble breaks content of listings #1115

Open
fezjo opened this issue Nov 11, 2023 · 0 comments
Open

Minted autogobble breaks content of listings #1115

fezjo opened this issue Nov 11, 2023 · 0 comments

Comments

@fezjo
Copy link

fezjo commented Nov 11, 2023

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.

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

1 participant