Skip to content
Snippets Groups Projects
Commit 76de7ae8 authored by Marco Ammon's avatar Marco Ammon Committed by Simon Schuster
Browse files

Fix wrong hyperlink targets for listings

```caption``` automatically loads ```hypcap``` with correct settings for
moving a hyperlink target to the begin of the surrounding floating environment.
When ```hypcap``` has been loaded manually before, the target of links
to minted-provided listings is placed at the caption, which is below the
listing.

While the ```hypcap``` option is a default setting for ```caption```,
setting it explicitly helps documentation.
parent 685bde5e
No related branches found
No related tags found
1 merge request!12Full rebase of Marco's changes
This commit is part of merge request !12. Comments created here will be created in the context of that merge request.
......@@ -190,13 +190,13 @@ Program code should be omitted, but if absolutely necessary, it should be set as
\begin{listing}
\inputminted{C}{example.c}
\caption{Listing from example file, fully included}
\captionof{listing}{Listing from example file, fully included}
\label{lst:example-full}
\end{listing}
\begin{listing}
\inputminted[firstline=1, lastline=2]{C}{example.c}
\caption{Listing from example file, partially included}
\captionof{listing}{Listing from example file, partially included}
\label{lst:example-partial}
\end{listing}
......@@ -209,7 +209,7 @@ Program code should be omitted, but if absolutely necessary, it should be set as
}
}
\end{minted}
\caption{Listing defined in document}
\captionof{listing}{Listing defined in document}
\label{lst:example-document}
\end{listing}
......
......@@ -182,6 +182,8 @@
breaklinks=true]{hyperref}
% Captions
% automatically loads hypcap
% manually loading hypcap breaks hyperref targets for listings
\RequirePackage[font=small, labelfont=bf, labelsep=endash, margin=1cm, hypcap]{caption}
% Subfigures
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment