SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2k stars 362 forks source link

Minted output not working in Sublime Text #1504

Closed edditler closed 3 years ago

edditler commented 3 years ago

Hi, I'm not sure whether this issue belongs here or in the minted repository. I'm also not 100% sure if this is related to the upgrade to Big Sur.

My MWE is

\documentclass[12pt]{article}
\usepackage[cache=false]{minted}

\begin{document}
the code 
\begin{minted}{fortran}
do i = 1, n
    print *, i, j, k
enddo
\end{minted}

\end{document}

If I run this inside Sublime Text 3 (latest build, package control tells me that there's no packages to upgrade) I get a page which only says "the code" and no errors. Running the same shell command on the command line gives me the correct output ("the code" and then the code block).

The command according to the console is latexmk -cd -f -pdf -interaction=nonstopmode -synctex=1 -latexoption=--shell-escape test.tex.

If I remove the cache=false flag, I get in Sublime: Package minted Error: Missing Pygments output; \inputminted was [\end{minted}] and on the command line it works fine again.

What helps is adding this line: \renewcommand{\MintedPygmentize}{~/.pyenv/shims/pygmentize}, which is obviously undesirable. I also tried setting the texpath in LaTeXTools.sublime-settings to

"texpath" : "$PATH:/Library/TeX/texbin:/usr/texbin:/usr/local/bin:/opt/local/bin:~/.pyenv/shims/:"

which doesn't fix the issue.

Generally I don't have trouble with the $PATH in ST.

$ which pygmentize
~/.pyenv/shims/pygmentize

$ which latexmk
/Library/TeX/texbin/latexmk
ig0774 commented 3 years ago

In your texpath can you change ~/.pyenv/shims to $HOME/.pyenv/shims and see if that works? (I don’t think we support tilde-expansion in the texpath.

edditler commented 3 years ago

Neither $HOME/.pyenv/shims nor the absolute path seem to work.

edditler commented 3 years ago

It was my fault, sorry! Pygments was actually not installed for system python. I needed to

pyenv shell system
pip3 install pygments