2

I have some parts of the book with my literature. I use a bibliography with BiBLaTeX after every single chapter a and at the end of the book I print Global Bibliography. I need to show the Bibliography as Articles, Books, Online, Conference etc. every position should be sorted via appearing in the book and have a number in bracket like below

enter image description here

and at the end of the Global Bibliography

enter image description here

All appeared correctly. All entries are processed in citation order. I use a simple option for BibLaTeX

\usepackage[sorting=none,defernumbers=true,refsegment=chapter]{biblatex}

I can add more options but this is nothing that helps but only improve the listing - this is the main idea that I need. To print the bibliography after chapters I use segment option.

\printbibheading  [title=BIBLIOGRAPHY,heading=subbibliography]
\printbibliography[segment=\therefsegment,type=book,heading=subbibintoc,title={Books},resetnumbers=false]
\printbibliography[segment=\therefsegment,type=article,heading=subbibintoc,title={Articles},resetnumbers=false]
\printbibliography[segment=\therefsegment,type=misc,heading=subbibintoc,title={Online},resetnumbers=false]
\printbibliography[segment=\therefsegment,type=inproceedings,heading=subbibintoc,title={Conferences}, resetnumbers=false]

for printing Global Bibliography the same apart of

segment=\therefsegment

option. I is easy now.

The problem is that numbering refers to the chapters and the citation order but I would like the opposite one. The listing of the Global Bibliography now is ok and should stay. Every book and every article etc (titles) are via citation order but should be numbered from up to down from 1 to the end 36 positions and such number from the Global bibliography should be taken and appear in the appropriate position after Chapters. For example, the numbering of the Global bibliography should look like

enter image description here

and in this way before article 1 Len Schwer. “Optional Strain-rate... has number [11] Len Schwer. “Optional Strain-rate... and should appear with its [11] number after chapter!

I should be well see that in the Global bibliography we can see publications from 1 to 36 and after chapters observing which global position was used in the current chapter. In the Global bibliography, we can additionally observe the Names of the author which appears in citation order, aren’t we?

My working example is here.

\documentclass  [10pt,oneside,a4paper]  {book}

\usepackage     [utf8]                                              {inputenc}
\usepackage     [T1]                                                {fontenc}
\usepackage     [left=3.5cm,right=2.5cm,tmargin=2.5cm,bmargin=2.5cm]{geometry}


\usepackage     [sorting=none,defernumbers=true,refsegment=chapter]{biblatex}
\addbibresource {biblatex-examples.bib}

\usepackage     {silence}
\usepackage     {indentfirst}
\usepackage     {mathpazo}
\usepackage     {setspace}  
\usepackage     {titlesec}

\titleformat{\chapter}[hang]{\raggedright\Large\bfseries}{\arabic{chapter}.\space}{0pt}{}{}
\titlelabel{\thetitle.\space}
\titlespacing*{\chapter}{0pt}{-\baselineskip}{\baselineskip}

\begin{document}

\chapter{Chapter 1}

Lorem\cite{nietzsche:ksa1}~\cite{sigfridsson}~\cite{moraux}~\cite{knuth:ct:c}.

\printbibheading  [title=BIBLIOGRAPHY,heading=subbibliography]
\printbibliography[segment=\therefsegment,type=book,heading=subbibintoc,title={Books},resetnumbers=false]
\printbibliography[segment=\therefsegment,type=article,heading=subbibintoc,title={Articles},resetnumbers=false]
\printbibliography[segment=\therefsegment,type=online,heading=subbibintoc,title={Online},resetnumbers=false]
\printbibliography[segment=\therefsegment,type=inproceedings,heading=subbibintoc,title={Conferences}, resetnumbers=false]

\vspace{5mm}
{\let\clearpage\relax \chapter{Chapter 2}}

Lorem~\cite{vizedom:related}~\cite{gerhardt}~\cite{augustine}~\cite{ctan}.

\printbibheading  [title=BIBLIOGRAPHY,heading=subbibliography]
\printbibliography[segment=\therefsegment,type=book,heading=subbibintoc,title={Books},resetnumbers=false]
\printbibliography[segment=\therefsegment,type=article,heading=subbibintoc,title={Articles},resetnumbers=false]
\printbibliography[segment=\therefsegment,type=online,heading=subbibintoc,title={Online},resetnumbers=false]
\printbibliography[segment=\therefsegment,type=inproceedings,heading=subbibintoc,title={Conferences}, resetnumbers=false]

\vspace{5mm}
{\let\clearpage\relax \chapter{Chapter 3}}

Lorem~\cite{wassenberg}~\cite{baez/online}.

\printbibheading  [title=BIBLIOGRAPHY,heading=subbibliography]
\printbibliography[segment=\therefsegment,type=book,heading=subbibintoc,title={Books},resetnumbers=false]
\printbibliography[segment=\therefsegment,type=article,heading=subbibintoc,title={Articles},resetnumbers=false]
\printbibliography[segment=\therefsegment,type=online,heading=subbibintoc,title={Online},resetnumbers=false]
\printbibliography[segment=\therefsegment,type=inproceedings,heading=subbibintoc,title={Conferences}, resetnumbers=false]

\printbibheading  [title=GLOBAL BIBLIOGRAPHY AT THE END,heading=subbibliography]
\printbibliography[type=book,heading=subbibliography,title={Books},resetnumbers=false]
\printbibliography[type=article,heading=subbibliography,title={Articles},resetnumbers=false]
\printbibliography[type=online,heading=subbibliography,title={Online},resetnumbers=false]
\printbibliography[type=inproceedings,heading=subbibliography,title={Conferences},resetnumbers=false]

\end{document}
1
  • 1
    Please don't link to .zip files on external sites. Minimise your example so far that it can be included as code directly in the question. You can use the file biblatex-examples.bib (cf. github.com/plk/biblatex/blob/master/bibtex/bib/biblatex/…) that is available on all systems that havebiblatex installed in case you need many example entries.
    – moewe
    Oct 16, 2022 at 7:04

1 Answer 1

1

One option would be not to use defernumbers and instead to employ presort to ensure that the sorting of the global bibliography is as intended. Since in effect your entries only deviate from sorting=none, in the grouping induced by the entry types, we take the type into account when sorting. There are several ways to do that, but a simple one is to use presort.

\documentclass[10pt,oneside,a4paper]{book}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[backend=biber, style=numeric, sorting=none, refsegment=chapter]{biblatex}


\DeclareSortingTemplate{none}{
  \sort{\field{presort}}
  \sort{\citeorder}
  \sort{\intciteorder}
}

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \pertype{book}
      \step[fieldset=presort, fieldvalue=aa]
    }
    \map{
      \pertype{article}
      \step[fieldset=presort, fieldvalue=bb]
    }
    \map{
      \pertype{online}
      \step[fieldset=presort, fieldvalue=cc]
    }
    \map{
      \pertype{inproceedings}
      \step[fieldset=presort, fieldvalue=dd]
    }
  }
}


\defbibheading{subsubbibintoc}[\refname]{%
  \subsection*{#1}%
  \addcontentsline{toc}{subsection}{#1}}

\addbibresource{biblatex-examples.bib}

\begin{document}
\tableofcontents
\chapter{Chapter 1}

Lorem \autocite{nietzsche:ksa1}
ipsum \autocite{sigfridsson}
dolor \autocite{moraux}
sit \autocite{knuth:ct:c}.

\printbibheading[title=Bibliography,heading=subbibintoc]
\printbibliography[segment=\therefsegment,type=book,heading=subsubbibintoc,title={Books}]
\printbibliography[segment=\therefsegment,type=article,heading=subsubbibintoc,title={Articles}]
\printbibliography[segment=\therefsegment,type=online,heading=subsubbibintoc,title={Online}]
\printbibliography[segment=\therefsegment,type=inproceedings,heading=subsubbibintoc,title={Conferences}]

\vspace{5mm}
{\let\clearpage\relax \chapter{Chapter 2}}

Lorem~\cite{vizedom:related}
ipsum~\cite{gerhardt}
dolor~\cite{augustine}
sit~\cite{ctan}.

\printbibheading[title=Bibliography,heading=subbibintoc]
\printbibliography[segment=\therefsegment,type=book,heading=subsubbibintoc,title={Books}]
\printbibliography[segment=\therefsegment,type=article,heading=subsubbibintoc,title={Articles}]
\printbibliography[segment=\therefsegment,type=online,heading=subsubbibintoc,title={Online}]
\printbibliography[segment=\therefsegment,type=inproceedings,heading=subsubbibintoc,title={Conferences}]

\vspace{5mm}
{\let\clearpage\relax \chapter{Chapter 3}}

Lorem~\cite{wassenberg},
ipsum~\cite{baez/online}.

\printbibheading[title=Bibliography,heading=subbibintoc]
\printbibliography[segment=\therefsegment,type=book,heading=subsubbibintoc,title={Books}]
\printbibliography[segment=\therefsegment,type=article,heading=subsubbibintoc,title={Articles}]
\printbibliography[segment=\therefsegment,type=online,heading=subsubbibintoc,title={Online}]
\printbibliography[segment=\therefsegment,type=inproceedings,heading=subsubbibintoc,title={Conferences}]

\printbibheading[title=Global bibliography at the end,heading=bibintoc]
\printbibliography[type=book,heading=subbibintoc,title={Books}]
\printbibliography[type=article,heading=subbibintoc,title={Articles}]
\printbibliography[type=online,heading=subbibintoc,title={Online}]
\printbibliography[type=inproceedings,heading=subbibintoc,title={Conferences}]

\end{document}

Another option would be to use defernumbers, but to mess with internals that the numbering is not determined by the first bibliography in which an entry appears, but instead of the global bibliography.

\documentclass[10pt,oneside,a4paper]{book}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[
  backend=biber,
  style=numeric-comp,
  sorting=none,
  defernumbers,
  refsegment=chapter,
]{biblatex}


\makeatletter
\newrobustcmd*{\DefernumbersEnable}{%
  \toggletrue{blx@defernumbers}%
  \let\blx@thelabelnumber\blx@addlabelnumber
  \let\abx@aux@number\blx@aux@number}
\newrobustcmd*{\DefernumbersDisable}{%
  \togglefalse{blx@defernumbers}%
  \let\blx@thelabelnumber\relax
  \let\abx@aux@number\@gobblefive}
\makeatother
\AtBeginDocument{%
  \DefernumbersDisable
  \BiblatexSplitbibDefernumbersWarningOff}


\defbibheading{subsubbibintoc}[\refname]{%
  \subsection*{#1}%
  \addcontentsline{toc}{subsection}{#1}}

\addbibresource{biblatex-examples.bib}

\begin{document}
\tableofcontents
\chapter{Chapter 1}

Lorem \autocite{nietzsche:ksa1}
ipsum \autocite{sigfridsson}
dolor \autocite{moraux}
sit \autocite{knuth:ct:c}.

\printbibheading[title=Bibliography,heading=subbibintoc]
\printbibliography[segment=\therefsegment,type=book,heading=subsubbibintoc,title={Books}]
\printbibliography[segment=\therefsegment,type=article,heading=subsubbibintoc,title={Articles}]
\printbibliography[segment=\therefsegment,type=online,heading=subsubbibintoc,title={Online}]
\printbibliography[segment=\therefsegment,type=inproceedings,heading=subsubbibintoc,title={Conferences}]

\vspace{5mm}
{\let\clearpage\relax \chapter{Chapter 2}}

Lorem~\cite{vizedom:related}
ipsum~\cite{gerhardt}
dolor~\cite{augustine}
sit~\cite{ctan}.

\printbibheading[title=Bibliography,heading=subbibintoc]
\printbibliography[segment=\therefsegment,type=book,heading=subsubbibintoc,title={Books}]
\printbibliography[segment=\therefsegment,type=article,heading=subsubbibintoc,title={Articles}]
\printbibliography[segment=\therefsegment,type=online,heading=subsubbibintoc,title={Online}]
\printbibliography[segment=\therefsegment,type=inproceedings,heading=subsubbibintoc,title={Conferences}]

\vspace{5mm}
{\let\clearpage\relax \chapter{Chapter 3}}

Lorem~\cite{wassenberg},
ipsum~\cite{baez/online}.

\printbibheading[title=Bibliography,heading=subbibintoc]
\printbibliography[segment=\therefsegment,type=book,heading=subsubbibintoc,title={Books}]
\printbibliography[segment=\therefsegment,type=article,heading=subsubbibintoc,title={Articles}]
\printbibliography[segment=\therefsegment,type=online,heading=subsubbibintoc,title={Online}]
\printbibliography[segment=\therefsegment,type=inproceedings,heading=subsubbibintoc,title={Conferences}]

\DefernumbersEnable % we want the numbering from this bib
\printbibheading[title=Global bibliography at the end,heading=bibintoc]
\printbibliography[type=book,heading=subbibintoc,title={Books}]
\printbibliography[type=article,heading=subbibintoc,title={Articles}]
\printbibliography[type=online,heading=subbibintoc,title={Online}]
\printbibliography[type=inproceedings,heading=subbibintoc,title={Conferences}]
\end{document}
5
  • All works . Thank you. I would like to ask a little bit more. Is it possible to remove "Articles Books Conferences" from the tableofcontents? I commented your definition % \defbibheading but it gives me an error and still exist in Global bibliography. I would have possibility remove it olaso from Global bubliography. Thank you a lot.
    – L. Flis
    Oct 17, 2022 at 7:38
  • @L.Flis You can define something like \defbibheading{subsubbibliography}[\refname]{\subsection*{#1}} and then use heading=subsubbibliography, instead of heading=subsubbibintoc,. (For the global bibliography you could analogously replace heading=subbibintoc, with heading=subbibliography, - those definitions already exist, so you don't need a \defbibheading.)
    – moewe
    Oct 17, 2022 at 7:44
  • Works. Thank you so much. You are really smart person. ... 'It is possible to off warring Empty bibliography on input line 63...etc
    – L. Flis
    Oct 17, 2022 at 8:11
  • @L.Flis Yes, there are ways to silence this warning. Either via surgery in biblatex internals or with a package that can be used to suppress warnings. (I have to be off now and can't look at it for the next few hours, if it really bothers you, you may want to ask a new question. I for one would just accept the warnings.)
    – moewe
    Oct 17, 2022 at 8:26
  • Sorry if I was abusing your help but you are the only one who can help me right now. So I will ask separate questions later on how to silence it (I tried package {silence but} but it did not work) and second I will ask you to consider sorting alphabetically global bibliography (whit sorting=non for chapter – I think it could be a challenge or too much asking) - so far I do not want to abuse your patience and I will take a break and correctly formulate two questions. Thank you.
    – L. Flis
    Oct 17, 2022 at 9:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .