LaTeX forum ⇒ BibTeX, biblatex and biberChapterbib messing hyperref links

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
ConstantMTL
Posts: 2
Joined: Fri Nov 14, 2014 9:01 pm

Chapterbib messing hyperref links

Postby ConstantMTL » Fri Nov 14, 2014 9:29 pm

Hi all!

I am currently writing my thesis using my university's template. Since I have to write several chapters in different languages, I am using the chapterbib package to be able to have different \bibliographystyle per chapter. Though, I only have one bibliography at the end of the document (\nobibliogrphy for all my chapters).

However the links in the pdf don't work when you click on a citation. It jumps back to the top of the document instead of jumping to the appropriate line in the final bibliography. Note that this problem is solved when the chapterbib package is removed.

I've spent a lot of time online looking for answers, made sure that Hyperref is the last package to be called, etc... It still doesn't work!

Here's my main:
  1. \documentclass[letterpaper,12pt,oneside,final]{book}
  2.  
  3. \usepackage[utf8]{inputenc}
  4. \usepackage[cyr]{aeguill}
  5. \usepackage[english,frenchb]{babel}
  6.  
  7. \usepackage{natbib}
  8. \usepackage[nolist]{acronym}
  9. \usepackage{MemoireThese}
  10. \usepackage{chapterbib}
  11. \usepackage{subfigure}
  12. \usepackage{bibentry}
  13. \usepackage{hyperref}
  14.  
  15. \begin{document}
  16.  
  17. \bibliographystyle{polymtl}
  18. \include{Theme1}
  19. \bibliography{Bibliographie}
  20.  
  21. \end{document}

And theme1 is just:
  1. \Chapter{ARTICLE 1}\label{sec:art1}
  2. \begin{otherlanguage}{english}
  3. \citep{price_1984}.
  4. \bibliographystyle{polymtlbis}
  5. \nobibliography{Bibliographie}
  6. \end{otherlanguage}


I have enclosed a simple test case that still generates the link issue.
Has anyone had the same problem or can help me?

Thanks a lot
Attachments
MWE.zip
(15.03 KiB) Downloaded 208 times

User avatar
Johannes_B
Site Moderator
Posts: 3582
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Nov 20, 2014 7:00 pm

It took me a while to figure out what you are trying to
achieve.
First of all, hyperref tries to link the cites to the
bibliography, which is prevented from being typeset. So the links
get lost. But why do you want different bibliography styles i was
wondering? The output of cites looks similar, a diff on the bst
files reveals that there are localized strings (master thesis vs.
mémoire de maîrise). An entry will be typeset in the bibliography
by the style currently in use. This can vary from chapter to
chapter if the chapterbib is typeset. If you omit typesetting and
let everything being typeset at the very end, you won't gain
anything. Nothing at all.

Why did it took so long for me to figure that out? The whole
system of BibTeX is getting old. You need a crutch for this and a
wheel chair for that. The modern package biblatex
(combining the features of natbib, chapterbib, bibentry ...) is
much more flexible and along with the new bibliography processor
biber (the new alternative to bibtex, the program) you can do
pretty fancy stuff.

But with biblatex as well, there will be no switch between and et
et with every new item. Also, who would winn if an entry was
cited in an english and a french chapter?
  1. \documentclass[letterpaper,12pt,oneside,final]{book}
  2. \usepackage[utf8]{inputenc}
  3. \usepackage[T1]{fontenc}
  4. \usepackage[english,frenchb]{babel}
  5. \usepackage{MemoireThese}
  6. \usepackage[natbib,style=authoryear,hyperref]{biblatex}
  7. \addbibresource{Bibliographie.bib}
  8. \usepackage{blindtext}
  9. \usepackage{hyperref}
  10. \begin{document}
  11. \Chapter{ARTICLE 1}\label{sec:art1}
  12. \begin{otherlanguage}{english}
  13. \citep{master}.
  14. \printbibliography
  15. \end{otherlanguage}
  16. \printbibliography
  17. \end{document}

  1. @article{price_1984,
  2. author = "S. J. Price and M. P. Pa{\"{i}}doussis",
  3. title = "An improved mathematical model for the stability of cylinder rows subject to cross-flow",
  4. journal = "Journal of {S}ound and {V}ibrations",
  5. volume = "97",
  6. number = "4",
  7. pages = "615-640",
  8. year = "1984"
  9. }
  10.  
  11. @mastersthesis{master,
  12. author = "Thor, A. U.",
  13. title = "Titles of master thesis can be quite nice, or not",
  14. school = "LaTeX",
  15. year = "2014",
  16. }


  1. \begin{filecontents}{includedChapter.tex}
  2. \Chapter{ARTICLE 1}\label{sec:art1}
  3. \begin{otherlanguage}{english}
  4. \citep{master}.
  5. \bibliographystyle{polymtlbis}
  6. %\nobibliography{Bibliographie}
  7. \bibliography{Bibliographie}
  8. \end{otherlanguage}
  9. \end{filecontents}
  10. \documentclass[letterpaper,12pt,oneside,final]{book}
  11.  
  12. \usepackage[utf8]{inputenc}
  13. \usepackage[cyr]{aeguill}
  14. \usepackage[english,frenchb]{babel}
  15.  
  16. \usepackage{natbib}
  17. \usepackage[nolist]{acronym}
  18. \usepackage{MemoireThese}
  19. \usepackage{chapterbib}
  20. %\usepackage{subfigure}%deprecated, subcaption!
  21. \usepackage{bibentry}
  22. \usepackage{blindtext}
  23. \usepackage{hyperref}
  24.  
  25. \begin{document}
  26. \bibliographystyle{polymtl}
  27. \include{includedChapter}
  28. \bibliography{Bibliographie}
  29. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

ConstantMTL
Posts: 2
Joined: Fri Nov 14, 2014 9:01 pm

Postby ConstantMTL » Mon Nov 24, 2014 11:08 pm

Hey, thanks for your answer. I want several bibliography styles because of the citations with two authors only. Indeed, I don't want two have something like " We acknowledge the work by Price et Paidoussis (1984)...". What I want is " We acknowledge the work by Price and Paidoussis (1984)...". Hence, the second bibliography style.

However, at the end of the document, I only want one general list of references with the French style ("et" instead of "and").

User avatar
Johannes_B
Site Moderator
Posts: 3582
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Nov 25, 2014 4:32 pm

This can be easily done with biblatex and biber.
It is impossible to do that with natbib and get the links (as described in you initial question).

Biblatex is the new standard, it was developed to overcome all those limitations of the old system.

  1. \begin{filecontents}{\jobname.bib}
  2. @article{price_1984,
  3. author = "S. J. Price and M. P. Pa{\"{i}}doussis",
  4. title = "An improved mathematical model for the stability of cylinder rows subject to cross-flow",
  5. journal = "Journal of {S}ound and {V}ibrations",
  6. volume = "97",
  7. number = "4",
  8. pages = "615-640",
  9. year = "1984"
  10. }
  11.  
  12. @mastersthesis{master,
  13. author = "Thor, A. U.",
  14. title = "Titles of master thesis can be quite nice, or not",
  15. school = "LaTeX",
  16. year = "2014",
  17. }
  18. \end{filecontents}
  19. \documentclass[letterpaper,12pt,oneside,final]{book}
  20. \usepackage[utf8]{inputenc}
  21. \usepackage[T1]{fontenc}
  22. \usepackage[english,frenchb]{babel}
  23. %\usepackage{MemoireThese}
  24. \usepackage[natbib,style=authoryear,hyperref]{biblatex}
  25. \addbibresource{\jobname.bib}
  26. \usepackage{blindtext}
  27. \usepackage{hyperref}
  28. \begin{document}
  29. \chapter{ARTICLE 1}\label{sec:art1}
  30. \begin{otherlanguage}{english}
  31. Language in use is: \languagename\par
  32. \citep{master}.
  33. \citep{price_1984}.
  34. \end{otherlanguage}
  35.  
  36. Language in use is: \languagename\par
  37. \citep{price_1984}.
  38. \printbibliography
  39. \end{document}


Hint: click on »Open in Writelatex« to see the output.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

qwertysef

Postby qwertysef » Wed May 17, 2017 1:33 pm

may I ask why the first post in that thread has doubled up?

User avatar
Stefan Kottwitz
Site Admin
Posts: 8522
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Wed May 17, 2017 2:19 pm

It has not doubled up. Perhaps post a screenshot. Otherwise it looks similar to what some spammers do: post meaningless stuff for creating a bit activity and then posting spam. We watch and remove advertisements and spam here.

Stefan
Site admin


Return to “BibTeX, biblatex and biber”

Who is online

Users browsing this forum: No registered users and 2 guests