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

It required that -shell-escape:

pdflatex -shell-escape document.tex





int main() {
    printf("hello, world");
    return 0;


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.



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

1 Answer 1


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
    Commented Dec 30, 2016 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
    Commented Dec 30, 2016 at 17:10
  • Yes, for that sample code. Using TexLive on macOS. Which one do you use?
    – KcFnMi
    Commented Dec 30, 2016 at 17:40
  • @KcFnMi I use TL on Linux. Could you try to update the distribution?
    – michal.h21
    Commented Dec 30, 2016 at 18:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .