1

The following gives a compilation error:

\documentclass{report}
\usepackage{dot2texi}
\usepackage[newfloat]{minted}
\begin{document}
Content
\end{document}

with output

...
Package: dot2texi 2008/05/07 v3.0p1 Run dot2tex from LaTeX
(/usr/local/texlive/2019/texmf-dist/tex/latex/moreverb/moreverb.sty
Package: moreverb 2008/06/03 v2.3a `more' verbatim facilities
(/usr/local/texlive/2019/texmf-dist/tex/latex/tools/verbatim.sty
Package: verbatim 2019/11/10 v1.5r LaTeX2e package for verbatim enhancements
...
Package: minted 2017/07/19 v2.5 Yet another Pygments shim for LaTeX
...
! LaTeX Error: Command \listing already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ...

l.1151 ...sting}{tbp}{lol}[\minted@float@within]}}

Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it.

It seems that moreverb and minted are both trying to define \listing

Eric
  • 669

2 Answers2

1

Unfortunately, moreverb defines listing and listing* environments that conflict with the environment with the same names defined by minted.

You can remove the useless environments defined by moreverb.

\documentclass{report}

\usepackage{dot2texi} % remove the definitions of listing and listing* \newcommand\zzzzzz[1]{\expandafter\let\csname#1\endcsname\relax} \zzzzzz{listing}\zzzzzz{endlisting} \zzzzzz{listing}\zzzzzz{endlisting}

\usepackage[newfloat]{minted}

\begin{document} Content \end{document}

Note: I used a fairly large number of z's in order to make David happy.

With no z:

\documentclass{report}

\usepackage{etoolbox}

\usepackage{dot2texi} % remove the definitions of listing and listing* \csundef{listing}\csundef{endlisting} \csundef{listing}\csundef{endlisting}

\usepackage[newfloat]{minted}

\begin{document} Content \end{document}

egreg
  • 1,121,712
  • \csundef was exactly what I was looking for - I was expecting https://tex.stackexchange.com/q/20655/41112 to mention it, but it seems not to. – Eric Aug 16 '20 at 19:14
  • Is there a reason to prefer your zzz approach instead of csundef? – Eric Aug 16 '20 at 19:14
  • @Eric The z approach would make David happy, that's the main reason. Out of joke, it doesn't require loading an additional package. – egreg Aug 16 '20 at 19:47
1

It worked for me if I changed the order of the package declarations. First, moreverb and later minted.

\usepackage{moreverb}

\usepackage{minted}

Mensch
  • 65,388