Skip to content
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

Hyperlinks in citations #151

Open
JVAQUEROM opened this issue Apr 16, 2021 · 8 comments
Open

Hyperlinks in citations #151

JVAQUEROM opened this issue Apr 16, 2021 · 8 comments
Assignees

Comments

@JVAQUEROM
Copy link

Describe the bug
I do not get hyperlinks in citations to point out to the references sections (to the particular entry, of course).

To Reproduce
Use any citation, and it does not happen. My experience with LaTeX is more in the way of using \cite, \citep, etc. But I am not familiar with this CSL-way.

Expected behavior
All citations with a link that points to the corresponding entry in references chapter.

@ismayc
Copy link
Owner

ismayc commented Apr 16, 2021

I can't seem to get this to work either. I was hoping that adding in pagebackref=true to the call to \usepackage{hyperref} and then moving \usepackage[pagebackref=true]{hyperref} to be the last line before \begin{document} in template.tex would do it, but it looks like this might be more of a Pandoc/bookdown issue as I'm not getting bookdown::pdf_book to produce links to citations either.

@JVAQUEROM
Copy link
Author

I guess there is no simple way to use normal natbib package with \citet / \citep commands, right?

@ismayc
Copy link
Owner

ismayc commented Apr 19, 2021

I'm not exactly sure, unfortunately.

@JVAQUEROM
Copy link
Author

Ok, I'm getting close to getting biblatex to work.

One has to put this in the preamble of the template.tex

\usepackage[
backend=biber,
style=alphabetic,
sorting=ynt
]{biblatex}
\addbibresource{$bibliography$}

Also, in the index.Rmd, the YAML must be

output:
thesisdown::thesis_pdf:
citation_package: biblatex

and in the 99-References.Rmd, last line must be:

\printbibliography

The you can knit the index.Rmd. This will fail BUT you have the .tex. Compile to PDF (this will fail). Then in a terminal (I'm on linux) run biber thesis and then you can compile to PDF again, and all goes well.

I am, however, not sure how to tell pandoc to do this, to do it automatically in the knit call

@ismayc
Copy link
Owner

ismayc commented Apr 23, 2021

Thanks for the update! I wonder if RStudio Community may be able to assist? Referencing {bookdown} with template: template.tex instead of {thesisdown} may get you more traction too. I have to imagine there is someone out there that has gotten this to work?

@JVAQUEROM
Copy link
Author

I made some tests with {bookdown}'s pdf_book but still having some trouble with natbib. I may try biblatex, but I do not really have much time for tests, I must finish my thesis...

@the-jul
Copy link

the-jul commented Aug 5, 2021

Hello everyone,
I experienced the same issue as described above (in-text citations are not linked to the reference chapter). However, I am was using the command [@author], where @author refers to the bibtex code. Is there anything that can be done include the hyperlink for this citation type?
Thanks for you help!

@shdam
Copy link

shdam commented Aug 30, 2024

Hey,
Perhaps I should have posted it here, but I managed to get biblatex and hyperlinks working in a way where you can swap between using either citeproc (without hyperlinks) or biblatex (with hyperlinks).
Here's the comment with the details: #207 (comment)

Unfortunately, I didn't manage to tell pandoc to run biber, but instead made a script to knit the document.

Hope this is helpful to anyone :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants