# htlatex with minted

The minted package helps to include code in a LATEX document.

It required that -shell-escape:

pdflatex -shell-escape document.tex

document.tex

\documentclass{article}

\usepackage{minted}

\begin{document}

\begin{minted}{c}
int main() {
printf("hello, world");
return 0;
}
\end{minted}

\end{document}


I tried to generate an HTML from that using htlatex:

! Package minted Error: You must invoke LaTeX with the -shell-escape flag.

See the minted package documentation for explanation.
Type  H <return>  for immediate help.
...

l.4

?


But it complains for that option (-shell-escape). How should I deal with this issue?

You can use --shell-escape (or -s shortdd) option provided by make4ht:

make4ht -s document.tex


If you want to use htlatex, it is a little bit more involved, as parameters for LaTeX are passed as fifth argument:

htlatex document.tex "" "" "" " -shell-escape"


htlatex passes arguments to three different commands and also to tex4ht.sty package. It isn't really much user friendly as you can see.

• 8AFE.pygtex l.1 --- TeX4ht warning --- \Configure{color}? --- ! Missing { inserted. \FV@FormattingPrep ...re {color}{\xdef \fv:color } \fi \FV@BreakAfterPrep \gl... l.1 \begin{Verbatim}[commandchars=\\\{\}] ? I GOT THIS (sorry for the upper case). I got this when I did make4ht -s document.tex. Any idea of what might be going on? – KcFnMi Dec 30 '16 at 16:56
• @KcFnMi do you get this for your sample code? I've got no such error. Which TeX distribution do you use? – michal.h21 Dec 30 '16 at 17:10
• Yes, for that sample code. Using TexLive on macOS. Which one do you use? – KcFnMi Dec 30 '16 at 17:40
• @KcFnMi I use TL on Linux. Could you try to update the distribution? – michal.h21 Dec 30 '16 at 18:02