I would like to change the appearance of the caption of a code snippet that I have created with minted and listing. However, using \captionsetup[listing]{<options>} does not change anything. Does someone know how to change the caption setup in a listing/minted environment so that the caption is closer to the code?
Here is a working example:
\documentclass[a4paper,oneside,11pt]{report}
\usepackage{listing}
\usepackage[chapter]{minted}
\usepackage{caption}
\usepackage{hyperref}
\usepackage{blindtext}
\setminted{frame=single}
\captionsetup[listing]{belowskip=-10pt} % --> is not working
\begin{document}
\blindtext
\begin{listing}[!h]
\begin{minted}{c}
int main() {
printf("hello, world");
return 0;
}
\end{minted}
\caption{test code 2}
\label{code:2}
\end{listing}
\blindtext
\end{document}
\usepackage{listing}and instead\usepackage[newfloat,chapter]{minted}, see the answer on the related question https://tex.stackexchange.com/a/256796 for an example. – Marijn Mar 14 '19 at 22:11newfloatoption as\listingscaptionand\listoflistingscaptionare then undefined and produce an error. – berlinesther Mar 15 '19 at 05:40