Quantcast
Channel: Multipage listings with minted and captions - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 2

Multipage listings with minted and captions

$
0
0

I have source long listings (2+ pages) that I highlight using minited via \inputminted. I wish to have have a caption and a reference label for the listing in \listoflistings and in my text when I refer to my code.

I have tried the attached code by I get a warning.

Package caption Warning: The option `hypcap=true' will be ignored for this(caption) particular \caption on input line 11.See the caption package documentation for explanation.

Could someone explain the correct was to do this? I do this in 13 places so I would like to understand is this the best way to achieve this?

Thanks

Stuart

\documentclass[a4paper,11pt]{report}\usepackage[hidelinks]{hyperref}  % I use XeLaTeX to pdf with hyperlinks\usepackage{minted}\usepackage{subcaption}  %Include this in MVE as I have figures with subcaption elsewhere\begin{document}\listoflistings\newpageIn my Listing~\ref{label-to-long-listing} I have more than 2 page source code listing.\inputminted[linenos, breaklines=true,fontsize=\scriptsize, numberblanklines=false]{bash}{long.txt}\captionof{listing}{Long Listing ToC\label{label-to-long-listing}}\end{document}

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images