minted icon indicating copy to clipboard operation
minted copied to clipboard

Make \listoflistings a subheading

Open rugk opened this issue 5 years ago • 2 comments

I want the \listoflistings of Minted to appear as a subsection heading. (My \documentclass is scrartcl.)

Things like \printbibliography have a "heading" option, which you can use to define, which heading type it should use. \printacronyms (package acro) has the same. With \KOMAoption{listof}{totocnumbered,leveldown} I can also move \listoffigures from a section heading to a subsection heading, but as for \listoflistings nothing of this works.

So basically, I just want a subheading (subsection-like) instead of a heading (section). It would also be nice, if it could appear in the toc.


BTW, also asked on tex.stackexchange.com.

rugk avatar Aug 29 '18 11:08 rugk

I found a solution on Stackexchange, but it's a bit hacky, so could you maybe add "native" support for that? tocloft could be used.

rugk avatar Aug 30 '18 15:08 rugk

At some point, I can look into adding better integration for the KOMA-Script classes. It looks like that will probably just amount to this from your link:

\addtotoclist[float]{lol}
\renewcommand*\listoflistings{\listoftoc[{\listoflistingscaption}]{lol}}

I'm not sure about adding support for the general case. tocloft is compatible with float, which minted currently uses by default. However, minted also supports newfloat, which isn't listed as compatible with tocloft. There are multiple families of packages for defining new lists of things like listings, and trying to support multiple approaches may add too much complexity and potential for package conflicts. Perhaps I need to look into a way for the user to disable a list of listings from automatically being defined, so that it can be created using whatever package is desired.

gpoore avatar Sep 03 '18 20:09 gpoore