0

My question is literally like a previous one I found (see this link), which – unfortunately does not have an answer.

Here there are the data:

  • I use biblatex.
  • I have two chapters, and every chapter has to have its own bibliography;
  • There has to be a final with global bibliography;
  • The two chapters' bibliographies do (unfortunately) overlap.

If I use the option backref along with refsegment all those entries that overlap between the two bibliographies will also have the pages that belong to the other chapter.

E.g. say the entry \cite{Shakespeare_1600} is in Chapter 1 at page 3 and in Chapter 2 at page 27. By using backref, in the bibliography of Chapter 1, there will be the entry "Shakespeare, W. (1600) (pp.3, 27).

How to constrain backref to provide, for every chapter's bibliography, the reference page that belongs only to that chapter?

Thanks a lot in advance for any help.

[Concerning the MWE, the question linked works fine, since the OP uses exactly the options I would use].

Kolmin
  • 559
  • 1
    Maybe there is a "proper" solution, but if not, you might just have to create duplicates of the BibTex records in question - for example, \cite{Shakespeare1600c2} in chapter 2, and \cite{Shakespeare1600c3} in chapter 3. – Michael Palmer Aug 23 '17 at 14:02
  • Thanks for pointing out this. :) . I will consider it as a last option. ;) – Kolmin Aug 23 '17 at 14:20

1 Answers1

2

You can try this here. Attention: it needs two biber runs: pdflatex biber pdflatex biber pdflatex ...

\documentclass[a4paper,titlepage,10pt,twoside,openright]{report}
\usepackage[backend=biber,style=ieee-alphabetic,natbib=true,backref=true]{biblatex}
\addbibresource{IEEEfull.bib}
\addbibresource{IEEEexample.bib}
\usepackage{lipsum}
\usepackage{xparse}
\ExplSyntaxOn

\seq_new:N\g_UF_allcitekeys_seq

\AtEveryBibitem
 {
  \seq_gput_right:Nx\g_UF_allcitekeys_seq{ \thefield{entrykey} }
 }


\NewDocumentCommand\nociteall { }
 {
  \seq_map_function:NN\g_UF_allcitekeys_seq\nocite
 }
\ExplSyntaxOff


\makeatletter
 %for the backrefs of the main bib:
\let\oriabx@aux@backref\abx@aux@backref
\renewcommand\abx@aux@backref[5]{%
 \oriabx@aux@backref{#1}{#2}{#3}{#4}{#5}%
 \oriabx@aux@backref{#1}{#2}{0}{#4}{#5}
 }
\makeatother
\begin{document}

 \chapter{Introduction}
  \begin{refsection}
   \cite{IEEEexample:articledualmonths}
  \printbibliography[heading=subbibliography]
  \end{refsection}

 \chapter{Second chapter}
  \begin{refsection}
   \cite{IEEEexample:articledualmonths}
   \cite{IEEEexample:IEEEwebsite}
   \nocite{IEEEexample:book_typical,IEEEexample:article_typical}
  \printbibliography[heading=subbibliography]
  \end{refsection}

\cleardoublepage
\nociteall
\printbibliography[heading=bibliography]

\end{document}

enter image description here enter image description here

enter image description here

Ulrike Fischer
  • 327,261
  • First of all, thanks a lot for your answer. There is a problem: I use TeXWorks on Mac and I don't use Biber. Strictly speaking I kinda learned about Biber today, since – again – today I moved to BibLaTeX, since I just could not find a way to solve the problem with BibTeX. Is there a way I can avoid to use Biber? – Kolmin Aug 23 '17 at 14:56
  • Btw, this is exactly what I was looking for, if not for the fact that I do not know how to implement it. :) – Kolmin Aug 23 '17 at 14:57
  • You wrote that the linked example can be used as MWE and this uses biber. I have no idea if it works with bibtex but I strongly advise to use biber anyway. A lot of things work only with it. It is really not difficult to switch to biber. See https://tex.stackexchange.com/questions/154751/biblatex-with-biber-configuring-my-editor-to-avoid-undefined-citations – Ulrike Fischer Aug 23 '17 at 15:06
  • Actually I found out that TeXShop has Biber as a default engine, thus I switched to it to implement your suggestion (I had actually overlooked that the OP used Biber). Thus, I ran as you suggest and the result is with the pages unconstrained. Also, maybe it is relevant, but in both occasions in which I ran Biber, I received a warning. EDIT: I checked the warning, and it is irrelevant (it is about an entry that is not found). – Kolmin Aug 23 '17 at 15:11
  • What do you mean by " unconstrained"? I got a lot of warning by biber as the example bib is not very good, but didn't want to spent time on adjusting the example. – Ulrike Fischer Aug 23 '17 at 15:13
  • A question, most probably stupid, the number of runs does depend on the number of independent chapters? – Kolmin Aug 23 '17 at 15:14
  • No, the second biber run is for the main bib. – Ulrike Fischer Aug 23 '17 at 15:16
  • With "unconstrained" I just mean that it does not work. I still get The first chapter with all the pages that refer back to the second chapter. – Kolmin Aug 23 '17 at 15:17
  • Last question. Why do you have two addbibresource? Is this relevant? Edit: Btw, I accepted the answer. It does the job. It's my problem if I don't know how to implement it. :) – Kolmin Aug 23 '17 at 15:23
  • The two bib's were in the example -- next time you should perhaps be less lazy and make your own example then it would fit better for you ;-) – Ulrike Fischer Aug 23 '17 at 15:29
  • Thanks for your advice, even if I did not actually do that out of laziness. But again, thanks for your time. :) – Kolmin Aug 23 '17 at 15:38