-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.1.6.2 with link-citations: true
breaks LaTeX citation hyperlinks
#9022
Comments
Is there a corresponding hypertarget defined for |
Yes. There is no difference in the reference list between 3.1.6.1 and 3.1.6.2: \hypertarget{refs}{}
\begin{CSLReferences}{1}{0}
\leavevmode\vadjust pre{\hypertarget{ref-casey2018}{}}%
Casey, G. (2018). Type 2 diabetes mellitus. \emph{Kai Tiaki : Nursing New Zealand}, \emph{24}(4), 20–24.
\end{CSLReferences} |
I see what is happening. From hyperref manual:
The change in #8744 left headings with a label but no hypertarget; What to do? One option would be to revert #8744 and go back to the old verbose approach. The other option would be to have the writer keep track of which internal links link to headings and which link to other things, and use @u-fischer do you have any further advice? |
Well instead of In a current LaTeX you can also use But setting targets and links manually as you do here has the same problems as in the other question: They make the code ugly, and they loose semantic information. You get a link from the citation text to the bib entry but you don't get more. As example: there just was a question on tex.sx why backref doesn't work with the LaTeX generated from pandoc: https://tex.stackexchange.com/q/693293/2388. Well backref needs to know that Accessibility is also a problem. If you use the standard commands (e.g. with natbib to get author year) and load the tagging code (this needs a current LaTeX!):
Then even without hyperref (and without bibtex or any external tool!) you get a structure where the citation is connected to the bib entry. The citation is surrounded by a Reference structure, which contains a /Ref pointing to the list entry in the bibliography:
But if the output of pandoc has not structure information about what is a citation and what is a bibentry then the tagging code has no chance to add such structures anymore. |
Of course, it's possible to tell pandoc to produce natbib or biblatex citation commands instead of using citeproc ( |
Thanks for the pointer about |
It depends on how many different texts the |
Just to be clear, what I mean is this: using
|
yes, the main question is how many different arbitrary text you have for every citation. If it is only one you can make use of the natbib interface:
If it is more, you need to do some coding, but you can store basically what you want in the \bibitem argument - jurabib used that e.g. to implement an author-title system. |
Interestingly, when I use |
Unfortunately this trick with bibitem won't work for us. citeproc won't always generate the same citation (part) for the same item, because of things like "ibid." |
That's why I asked about the variants. If you really want arbitrary text you need a bit code (mostly to get rid of the default brackets ...): Note: the empty lines between the bibitems are needed for backref.
|
That's a neat approach! I may try that. |
Created new issue #9031 for this. |
In pandoc 3.1.6.2, #8744 was resolved by commit 70329ed. However, with
link-citations: true
the applicable item in the reference list is no longer linked to the citation.The LaTeX output in 3.1.6.1:
(\protect\hyperlink{ref-casey2018}{Casey, 2018})
, is changed in 3.1.6.2 to:(\hyperref[ref-casey2018]{Casey, 2018})
.The text was updated successfully, but these errors were encountered: