10

How do I customize listing name: Listing 1: thing -- when I use minted? Here's an MWE:

\documentclass{article}

\usepackage{minted}
% \renewcommand{\lstlistingname}{Something} % doesn't work!

\begin{document}
Some text.

\begin{minted}{python}
for i in range(3):
    print i
\end{minted}

Some more text.

\end{document}
Adobe
  • 3,037

1 Answers1

16

I think you are talking about the listing environment from minted package and a \caption there:

\documentclass{article}

\usepackage{minted}
    \renewcommand\listingscaption{My Listing Caption}

\begin{document}
    \begin{listing}[H]
        \begin{minted}[gobble=12]{python}
            for i in range(3):
                print i
        \end{minted}
        \caption{Example of a listing.}
        \label{lst:example}
    \end{listing}
\end{document}

Result:

enter image description here

hpesoj626
  • 17,282
m0nhawk
  • 9,664