ismayc / thesisdown

An updated R Markdown thesis template using the bookdown package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hyperlinks in citations

JVAQUEROM opened this issue · comments

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.

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.

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

I'm not exactly sure, unfortunately.

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

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?

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...

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!