5

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}

marked as duplicate by hpesoj626, Mensch, lockstep, Claudio Fiandrino, jub0bs Apr 8 '13 at 12:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Page 7 of the minted documentation: \renewcommand\listingscaption{Program code} – jub0bs Apr 8 '13 at 11:28
10

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

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