1

I'm working off of an example from https://www.overleaf.com/learn/latex/Code_Highlighting_with_minted that shows how to import code into a LaTeX document, which I've simplified to give a minimal working example:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{minted}

\begin{document}
\begin{minted}{perl}
use strict;
use warnings FATAL => 'all';
use List::Util 'sum';

my @a = (1,2,3,4,5,6,7,8);
print sum(@a) . "\n"
\end{minted}
\end{document}

However, this code doesn't even compile.

as the manual https://ctan.math.illinois.edu/macros/latex/contrib/minted/minted.pdf suggests, I compile using shell-escape

This gives an error:

/home/con/Scripts/latex/.minted.tex.swp:15: Package minted Error: Missing Pygme
nts output; \inputminted was
probably given a file that does not exist--otherwise, you may need 
the outputdir package option, or may be using an incompatible build tool,
or may be using frozencache with a missing file.

I've tried using the outputdir option, but that doesn't do anything. As for the incompatible build tool I get the same error with XeTeX or LaTeX.

I can compile this at the command line with

pdflatex  -shell-escape --no-pdf minted.tex && 
pdflatex  -shell-escape -draftmode minted.tex && 
pdflatex  -shell-escape minted.tex

but gummi fails with the same options (cf. image).

How can I get gummi to compile this very simple document? Gummi compilation options

what's bizarre is that Gummi works with minted if a file is included, but not the text

con
  • 351
  • 1
  • 3
  • 15
  • See please: https://tex.stackexchange.com/questions/279214/pygmentize-not-working-properly-with-minted-package-in-texshop-on-os-x. You need a reference to pygmentize within /Library/TeX/texbin, but it's sufficient to create a symlink instead of a copy: – JardaFait Nov 26 '19 at 20:24
  • @JardaFait the high up directory /Library/ doesn't exist on my machine. Perhaps there is another directory? sudo ln -s $(which pygmentize) pygmentize still doesn't help. I also updated pygments from 2.2.0 to 2.5.1, but gummi still can't make the preview :( – con Nov 27 '19 at 15:55
  • In my machine with Gummi (with a vanilla TeX Live 2019 in /usr/local) works without problems. – Fran Nov 30 '19 at 06:49
  • @Fran I am unable to update my TeXlive, but can still compile on the command line :( – con Dec 03 '19 at 16:39

0 Answers0