Whenever I try to use the mintinline
command in a source file and then compile that file with pdflatex
, I get an error. Minimum example to show the error is provided below:
\documentclass{book}
\usepackage{minted}
\begin{document}
\mintinline{vala}{main}
\end{document}
When I run pdflatex --shell-escape sample.tex
(where sample.tex
) is the name of the file I have this code in), I get the following output:
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014/Arch Linux) (preloaded format=pdflatex)
\write18 enabled.
entering extended mode
(./sample.tex
LaTeX2e <2014/05/01>
Babel <3.9k> and hyphenation patterns for 79 languages loaded.
(/usr/share/texmf-dist/tex/latex/base/book.cls
Document Class: book 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/bk10.clo))
(/usr/share/texmf-dist/tex/latex/minted/minted.sty
(/usr/share/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix
<2008/02/07> (tvz)) (/usr/share/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/share/texmf-dist/tex/latex/latexconfig/color.cfg)
(/usr/share/texmf-dist/tex/latex/pdftex-def/pdftex.def
(/usr/share/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/share/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)))
(/usr/share/texmf-dist/tex/latex/float/float.sty)
(/usr/share/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/share/texmf-dist/tex/latex/tools/calc.sty)
(/usr/share/texmf-dist/tex/latex/ifplatform/ifplatform.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texmf-dist/tex/generic/oberdiek/ifpdf.sty))
(/usr/share/texmf-dist/tex/generic/oberdiek/catchfile.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/etexcmds.sty)) (./sample.w18)) /usr/bin/pygmentize
(./sample.aux) (/usr/share/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (./sample.pyg)
! Undefined control sequence.
l.4 \mintinline
{vala}{main}
?
Am I missing something here?
Best Answer
The
\mintinline
command is provided by the development version ofminted
, not the one in the current TeX distributions. If you want to use it, manually install the development version.You can instead use
pythontex
:This requires running
pythontex <filename>
after a LaTeX run (when there are new code snippets).