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

0
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}
3
  • \csundef was exactly what I was looking for - I was expecting 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.