plk / biblatex

biblatex is a sophisticated bibliography system for LaTeX users. It has considerably more features than traditional bibtex and supports UTF-8
520 stars 118 forks source link

Case of references in several subdivided bibliographies #1372

Open amelieled opened 3 months ago

amelieled commented 3 months ago

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 commented 3 months ago

This is a ME:

\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 commented 3 months ago

So there is the same problem in multibiband biblatex.

zepinglee commented 3 months ago

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 commented 3 months ago

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 commented 2 months ago

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

amelieled commented 2 months ago

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

amelieled commented 1 month ago

@plk I guess this is a bug...

plk commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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