1

I realised my bibliography was not being included in the ToC, I was taking a look at https://tex.stackexchange.com/a/325853/66353 However, while the inclusion of the option heading=bibintoc in \printbibliography made the trick, in the PDF the link points to a previous section (p. 317 instead of p. 319):

enter image description here

Are there any options to include it on the PDF correctly. I have been going through https://fr.sharelatex.com/learn/Bibliography_management_with_biblatex with no luck. Concretely, the call I am making is

 \printbibliography[heading=bibintoc,title={References}]

Please, find below a minimum version of the skeleton (with only the implicated libraries) of the main file:

\documentclass[a4paper,12pt, oneside]{report}

\usepackage[style=apa, backend=biber, urldate=long, uniquename=false]{biblatex}
\DeclareLanguageMapping{british}{british-apa}
\usepackage[british]{babel}
\usepackage{hyperref}
\usepackage{lipsum}

\begin{document}

\begin{thebibliography}
% Fake bibliography
@article{bergquist2001power,
author = {Bergquist, Magnus and Ljungberg, Jan},
title = {{The power of gifts: organizing social relationships in open source communities}},
journal = {Information Systems Journal},
volume = {11},
number = {4},
publisher = {Blackwell Science Ltd},
issn = {1365-2575},
url = {http://dx.doi.org/10.1046/j.1365-2575.2001.00111.x},
doi = {10.1046/j.1365-2575.2001.00111.x},
pages = {305--320},
keywords = {Gift culture, open source, peer review},
year = {2001}
}

\end{thebibliography}
%% Print index 
\newpage
\setcounter{tocdepth}{1} 
\tableofcontents
\setcounter{tocdepth}{1} %to solve issue with appendixes affecting list of figs and tables

\newpage
\listoftables
\newpage
\listoffigures

%%%%%%%% CHAPTERS %%%%%%%%%%%%

\chapter{A}
\lipsum

\chapter{B}
\lipsum
\parencite{bergquist2001power}
\lipsum

\chapter{C}
\lipsum


%%%%%%%% END CHAPTERS %%%%%%%%%


%% Bibliography - define types and non-types to distinguish websites
\newpage
%% Added to include in ToC. Works in object, but not in PDF bookmark
\printbibliography[heading=bibintoc,title={References}]
\newpage

\end{document}
moewe
  • 175,683
drozas
  • 115
  • 1
    Mhhh, if you don't have other code that is supposed to add the bibliography to the toc, then \printbibliography[heading=bibintoc,title={References}] should work just fine. Can you reproduce your problem in an MWE/MWEB? – moewe Jul 21 '17 at 18:04
  • 2
    Have you tried deleting all auxiliary files (.aux, ...) and recompile from scratch? – moewe Jul 21 '17 at 19:30
  • Unfortunately, we can't run your example since we do not have all the files you \include. Can you reproduce the issue in a document where you don't use \include? See also https://tex.meta.stackexchange.com/q/3343/35864 – moewe Jul 22 '17 at 09:19
  • Note also that your MWE misses crucial packages. You do not load hyperref (which is integral to the question). The command \onehalfspacing also needs another package (either drop it in the MWE, or load the relevant package - if it is important, if you can reproduce the issue without it, drop it). Please check your MWE in an empty folder before you submit it to make sure it compiles and actually shows the problem. – moewe Jul 22 '17 at 09:23
  • Thanks a lot @moewe! I am going through http://www.minimalbeispiel.de/mini-en.html to create a MWE of this case, however, I am not really sure how to deal with the includes. Should I create "dummy" include ones? Otherwise it is not possible to reproduce the error with the index. Thanks! – drozas Jul 22 '17 at 09:26
  • Try to have all the text in one file. If it is enough to replace the \include by a simple word in the MWE that would be preferable. If you need more text, have a look at the lipsum package https://www.ctan.org/pkg/lipsum. Definitely compile the MWE in a new, empty directory and make sure you get no errors and that the compiled document shows the issue at hand. – moewe Jul 22 '17 at 09:30
  • Thanks @moewe! Any thoughts on how can I try to create a MWE to include the bibliography. I have tried to embedded as in https://www.sharelatex.com/learn/Bibliography_management_with_bibtex , but it does not reproduce the same document. I am afraid I could not find any references on how to do this on http://www.minimalbeispiel.de/mini-en.html#x1-70003.1.2 neither. Thanks! – drozas Jul 22 '17 at 09:44
  • Have a look at https://tex.meta.stackexchange.com/q/4407/35864 You can also use the file biblatex-examples.bib which is available on all installations that have biblatex installed. – moewe Jul 22 '17 at 09:45

1 Answers1

2

I think I figured out what the issue was here, it is necessary to add a \phantomsection. Hence, the code regarding this part goes as follows:

\newpage
\phantomsection
\printbibliography[heading=bibintoc,title={References}]
moewe
  • 175,683
drozas
  • 115
  • It should not be necessary to have to resort to a \phantomsection with \printbibliography[heading=bibintoc,title={References}]. – moewe Jul 22 '17 at 09:53