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

Case of references in several subdivided bibliographies #1372

Open
amelieled opened this issue Jul 31, 2024 · 10 comments
Open

Case of references in several subdivided bibliographies #1372

amelieled opened this issue Jul 31, 2024 · 10 comments

Comments

@amelieled
Copy link

Hi,

I would like to write a document with several chapters, and where each chapter has its own subdivided bibliography.
It is therefore quite possible for a reference to be cited in several different chapters.
Until now, I've been using multibib, but I've just realized that there seems to be a bug in this extension.
Visually, I get what I want, but all occurrences of the said citation refer to the first time it appears in a bibliography, when clicked on.

I'm having trouble seeing if this is possible to achieve with biblatex. What do you think?

@amelieled
Copy link
Author

This is a ME:

  • test.tex:
\documentclass[a4paper,french]{book}
%% Préambule
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[backend=biber, style=alphabetic]{biblatex}
\usepackage[french]{babel}
\usepackage{hyperref}
\addbibresource{test.bib}

\DeclareBibliographyCategory{sek} 
\DeclareBibliographyCategory{prim}

\newcommand*{\citeprim}[2][]{\addtocategory{prim}{#2}\cite[#1]{#2}}
\newcommand*{\citesek}[2][]{\addtocategory{sek}{#2}\cite[#1]{#2}}

%% Fin préambule
\begin{document}

\chapter{Prim}

		\citeprim{Demoule2009}
		
		\citeprim{besse2014}

	\printbibliography[category=prim]

	
\chapter{sek}

		\citesek{besse2014}

	\printbibliography[category=sek]

\end{document}
  • test.bib:
@article{besse2014,
Author = {Besse, Marie},
Journal = {La Recherche},
Number = {484},
Pages = {42--46},
Title = {Il y a 5000 ans, une mystérieuse unité européenne},
Date = {2014-02},
Url = {https://www.academia.edu/},
Urldate = {2014-06-09}
}
@book{leroi-gourhan2005,
title = {Dictionnaire de la Préhistoire},
editor = {Leroi-Gourhan, André},
publisher = {Presses universitaires de France},
year = {2005},
address = {Paris},
pagetotal = {1277},
series = {Quadrige}
}
@inbook{gaucher2005,
title = {L'Âge du bronze},
author = {Gaucher, Gilles},
booktitle = {Dictionnaire de la Préhistoire},
editor = {Leroi-Gourhan, André"},
publisher = {Presses universitaires de France},
year = {2005},
address = {Paris},
series = {Quadrige},
pages = {577--578}
}
@proceedings{Demoule2009,
Editor = {Demoule, Jean-Paul and Landes, Christian},
Eventdate = {2008-02-14/2008-02-15},
Eventtitle = {Actes du colloque \enquote{La fabrique de
l'archéologie en France}},
Location = {Paris},
Pagetotal = {301},
Publisher = {La Découverte},
Title = {La fabrique de l'archéologie en France},
Venue = {Paris},
Year = {2009}
}
  • Compilation process:
    1. pdflatex test.tex
    2. biber test
    3. pdflatex test.tex
    4. pdflatex test.tex

@amelieled
Copy link
Author

So there is the same problem in multibiband biblatex.

@zepinglee
Copy link

You can use the refsection (see § 3.8.4 in documentation) rather than category. In this example, the package option refsection=chapter is most helpful.

\documentclass[a4paper,french]{book}
%% Préambule
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=alphabetic, refsection=chapter]{biblatex}
\addbibresource{test.bib}
\usepackage{hyperref}

%% Fin préambule
\begin{document}

\chapter{Prim}
\cite{Demoule2009}
\cite{besse2014}
\printbibliography

\chapter{sek}
\cite{besse2014}
\printbibliography

\end{document}

@amelieled
Copy link
Author

amelieled commented Aug 1, 2024

Hi @zepinglee ,
Thank you for your quick answer!
In fact, I would like something more sophisticated: I would like a subdivided bibliography at the end of each chapter (not just one bibliography by chapter).

\documentclass[a4paper,french]{book}
%% Préambule
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[backend=biber, style=alphabetic]{biblatex}
\usepackage[french]{babel}
\usepackage{hyperref}
\addbibresource{test.bib}

\usepackage{titlesec}

\DeclareBibliographyCategory{sek}
\DeclareBibliographyCategory{sekbis}
\DeclareBibliographyCategory{prim}
\DeclareBibliographyCategory{primbis}

\newcommand*{\citeprim}[2][]{\addtocategory{prim}{#2}\cite[#1]{#2}}
\newcommand*{\citeprimbis}[2][]{\addtocategory{primbis}{#2}\cite[#1]{#2}}
\newcommand*{\citesek}[2][]{\addtocategory{sek}{#2}\cite[#1]{#2}}
\newcommand*{\citesekbis}[2][]{\addtocategory{sekbis}{#2}\cite[#1]{#2}}

%% Fin préambule
\begin{document}

\chapter{Prim}

		\citeprim{Demoule2009}

		\citeprimbis{leroi-gourhan2005}

		\citeprimbis{gaucher2005}

		\citeprim{besse2014}

		\printbibliography[category=prim, title=Toto] 
		\printbibliography[category=primbis, title=Titi]

\chapter{sek}

		\citesekbis{besse2014}
		
		\citesek{gaucher2005}

		\printbibliography[title=Tutu,category=sek]
		\printbibliography[title=Tata, category=sekbis]

\end{document}

@amelieled
Copy link
Author

Hey!
What's up about my issue? The problem is clear for you?

@amelieled
Copy link
Author

Hi @moewew !
Is it possible to get an answer quickly? Thanks.

@amelieled
Copy link
Author

@plk I guess this is a bug...

@plk
Copy link
Owner

plk commented Oct 4, 2024

I think you should first ask on tex.stackexchange.com as it's not clear if there is any bug here - you might just need some more sophisticated use of sections/segments and \printbibliograhy arguments.

@moewew
Copy link
Collaborator

moewew commented Oct 8, 2024

Sorry, for not replying sooner. I'm stretched quite thin at the moment and this looked more like a question for TeX.SX or your favourite LaTeX forum than a clear bug report. We don't really have the resources and time to provide support here - you're much more likely to get that in a forum - we can only track bugs and clear feature requests here.

@amelieled
Copy link
Author

amelieled commented Oct 8, 2024

In my last example, the problem is: if I click on the reference [besse2014] or [gaucher2005] in chapter sek, I go to the bibliography of chapter Prim because these references are also mentioned in the chapter Prim.

Here the file test.bib associated to my last example:

@article{besse2014,
Author = {Besse, Marie},
Journal = {La Recherche},
Number = {484},
Pages = {42--46},
Title = {Il y a 5000 ans, une mystérieuse unité européenne},
Date = {2014-02},
Url = {https://www.academia.edu/},
Urldate = {2014-06-09}
}
@book{leroi-gourhan2005,
title = {Dictionnaire de la Préhistoire},
editor = {Leroi-Gourhan, André},
publisher = {Presses universitaires de France},
year = {2005},
address = {Paris},
pagetotal = {1277},
series = {Quadrige}
}
@inbook{gaucher2005,
title = {L'Âge du bronze},
author = {Gaucher, Gilles},
booktitle = {Dictionnaire de la Préhistoire},
editor = {Leroi-Gourhan, André"},
publisher = {Presses universitaires de France},
year = {2005},
address = {Paris},
series = {Quadrige},
pages = {577--578}
}
@proceedings{Demoule2009,
Editor = {Demoule, Jean-Paul and Landes, Christian},
Eventdate = {2008-02-14/2008-02-15},
Eventtitle = {Actes du colloque \enquote{La fabrique de
l'archéologie en France}},
Location = {Paris},
Pagetotal = {301},
Publisher = {La Découverte},
Title = {La fabrique de l'archéologie en France},
Venue = {Paris},
Year = {2009}
}

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

No branches or pull requests

4 participants