Closed jpcirrus closed 9 months ago
In pandoc 3.1.8 there are two changes required of pandoc-crossref
to prevent LaTeX compilation errors and log warnings:
\label{ID}
. Permits compilation.\phantomsection\label{ID}
added by pandoc above the longtable
environment (by removing the identifier?) to preserve the correct \cref
label name if the \label{ID}
added by pandoc-crossref
were removed. Removes log warnings about multiple labels.Turns out, listings were also subtly broken by this. Anywho, I've pushed some fixes, will try to push a release later today or tomorrow, provided CI passes :crossed_fingers:
Many thanks for this. Have just tested using the GitHub Actions Haskell CI #442 build for 5d308d1. All working great. Cheers.
Of interest, in my testing over the last few weeks I discovered that with longtable
if \label
is prefixed with \MakeLinkTarget{}
then the anchor is the same as with regular floats that respect the default hypcap=true
option of the caption
package (loaded by pandoc-crossref
). This macro has been included in the hyperref
package since release 7.00o
of 2022-05-15, and is documented in hyperref-linktarget.pdf
. Not sure if you would consider it worthwhile adding that, which I have been using in a lua filter run after pandoc-crossref
.
The release is live. As for \MakeLinkTarget{}
thing, I don't have the bandwidth to investigate it in any detail, so I've opted not to fit it into this release, but I've opened a new issue (#406).
I encourage you to comment on that issue with any additional context, i.e. what is the exact issue it's supposed to fix and how it does that. I'm afraid my LaTeX-fu is quite rusty, so I don't remember what hypcap
does, and it's the first time I've encountered MakeLinkTarget
.
In pandoc 3.1.7 the fix for jgm/pandoc#9022 means 2 labels are added to floats i.e.
which causes compilation to terminate with an error raised by the
amsmath
package.And, here's what now happens to pandoc tables:
And, a codelisting, where there is only one label, but
\phantomsection
has been added:Here the addition of
\phantomsection
causes links to navigate so that the caption is not displayed when thecodelisting
float style has been changed from the default with:The issue with figures was fixed by jgm/pandoc@632e3c1