當我使用 minted 時,如何自訂清單名稱:Listing 1:
thing?這是一個 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}
答案1
我認為你正在談論包listing
中的環境:minted
\caption
\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}
結果: