I have a report with several code blocks (made with minted), and I would like to have a List of Listings to ease searching. However, currently the number and the caption of the elements are overlapping in the list, as seen in the following image, particularly in codes 5.3.10, 5.3.11 and so on.
I have seen some solutions out there, but they mess up with my previous configuration (what is proposed here disables the sectioning, for example making the Code 5.3.9 appear as Code 41 both in the caption and the list of listings).
Is there any other way to do it?
Currently, my minted environments, captions and list of listings are defined this way:
% THIS WAS THE PREVIOUS SOLUTION, BUT IT DISABLED SECTIONING
% \usepackage[titles]{tocloft}
% \newlistof{listing}{lol}{Índice de códigos}
% \setlength{\cftfignumwidth}{2.55em}
% \setlength{\cfttabnumwidth}{2.55em}
% \setlength{\cftlistingnumwidth}{2.55em}
% CURRENT CONFIGURATIONS
\usepackage[section]{minted}
\setminted{xleftmargin=2em,
bgcolor=lightgray!15,
autogobble=true,
numbers=left,
frame=lines,
framesep=2mm,
baselinestretch=1.2,
fontsize=\small,
breaklines=true,
breakanywhere}
\newenvironment{code}{\captionsetup{type=listing}}{}
\SetupFloatingEnvironment{listing}{name=Código}
\renewcommand{\listingscaption}{Código}
\renewcommand{\listoflistingscaption}{Índice de códigos}
If more information is needed please don't hesitate to ask. Thanks in advance!
