0

I hope this may be the last request to complete the topic. How to add to the bellow example one more bibliography based on the previous one but with numbers sorted from 1-11, somewhere in alphabetical order.

\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 {titlesec} \titleformat {\chapter}[hang]{\raggedright\Large\bfseries}{\arabic{chapter}.\space\space}{0pt}{}{} \titlespacing* {\chapter}{0pt}{-\baselineskip}{\baselineskip}

\usepackage[backend=biber,language=english, style=numeric,sorting=none, ,citestyle=numeric,giveninits=true,dashed=false,bibstyle=authoryear, refsegment=chapter,backref=true]{biblatex}

\BiblatexSplitbibDefernumbersWarningOff

\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] } } } \makeatletter \input{numeric.bbx} \makeatother

\DeclareNameAlias{author}{family-given}
\DeclareNameAlias{translator}{family-given}
\renewcommand*{\revsdnamepunct}{}

\defbibheading{subsubbibintoc}[\refname]{\subsection{#1}} \defbibheading{subsubbibliography}[\refname]{\subsection{#1}}

\addbibresource{biblatex-examples.bib}

\usepackage {silence} \WarningFilter {latex}{Empty bibliography}

\begin{document} \pagestyle{empty} \tableofcontents \chapter{First chapter}

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

\printbibheading[title=Chapter 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{Second chapter}}

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

\printbibheading[title=Chapter 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{Third chapter}}

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

\printbibheading[title=Chapter 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,heading=bibintoc] \printbibliography[type=book,heading=subsubbibliography,title={Books}] \printbibliography[type=article,heading=subsubbibliography,title={Articles}] \printbibliography[type=online,heading=subsubbibliography,title={Online}] \printbibliography[type=inproceedings,heading=subsubbibliography,title={Conferences}]

% \printbibliography[title=Global Bibliography ALFABETIC ORDER (additionally),heading=bibintoc]

\csletcs{saved@blx@refcontext@context}{blx@refcontext@context} \newrefcontext[sorting=nyt] \makeatletter \preto\blx@thelabelnumber{% \global\csletcs{blx@refcontext@context}{saved@blx@refcontext@context}} \makeatother \printbibliography[title=Global Bibliography (alphabetic),heading=bibintoc]

\csletcs{saved@blx@refcontext@context}{blx@refcontext@context} \newrefcontext[sorting=nyt] \makeatletter \preto\blx@thelabelnumber{% \global\csletcs{blx@refcontext@context}{saved@blx@refcontext@context}} \makeatother \printbibliography[title=Global Bibliography (alphabetic and sort number independent 1- 11 just for convenience),heading=bibintoc]

\end{document}

I gues that again we need do something here

\csletcs{saved@blx@refcontext@context}{blx@refcontext@context}
\newrefcontext[sorting=nyt]
\makeatletter
\preto\blx@thelabelnumber{%
  \global\csletcs{blx@refcontext@context}{saved@blx@refcontext@context}}
\makeatother
\printbibliography[title=Global Bibliography (alphabetic and sort number independent 1- 11 just for convenience),heading=bibintoc]

maybe we need give this time some command to change order from 1-11 only. It would be treated like separate information generally how many position generally is and looking for names in alphabetical order. The numeration wouldn't has connection with the papes in this case. Just to general infor from 1-11 in alphabetic order like below.

enter image description here

Normally when we have only one one bibliography with alphabetic order it this would be done as it is rather standard but the previous one should stay and additional information in the same document is needed one more at the end to not produce separate document with such a list.

L. Flis
  • 53

1 Answers1

1

If we want another bibliography after the alphabetic bibliography from Additional bibliography in alphabetical order with sorting=none with a different numbering scheme, we should probably keep the patches we applied there local with \AtNextBibliography. Then another \newrefcontext and \printbibliography do the job.

I changed the numbering format for the last bibliography to avoid confusion with existing numbers.

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

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

\usepackage[ backend=biber, bibstyle=authoryear, citestyle=numeric, sorting=none, giveninits=true, dashed=false, refsegment=chapter, backref=true, ]{biblatex}

\makeatletter \input{numeric.bbx} \makeatother

\BiblatexSplitbibDefernumbersWarningOff

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

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

\DeclareNameAlias{author}{family-given}
\DeclareNameAlias{translator}{family-given}
\renewcommand*{\revsdnamepunct}{}

\defbibheading{subsubbibintoc}[\refname]{\subsection{#1}} \defbibheading{subsubbibliography}[\refname]{\subsection{#1}}

\addbibresource{biblatex-examples.bib}

\begin{document} \pagestyle{empty} \tableofcontents \chapter{First chapter}

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

\printbibheading[title=Chapter 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{Second chapter}}

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

\printbibheading[title=Chapter 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{Third chapter}}

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

\printbibheading[title=Chapter 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,heading=bibintoc] \printbibliography[type=book,heading=subsubbibliography,title={Books}] \printbibliography[type=article,heading=subsubbibliography,title={Articles}] \printbibliography[type=online,heading=subsubbibliography,title={Online}] \printbibliography[type=inproceedings,heading=subsubbibliography,title={Conferences}]

\csletcs{saved@blx@refcontext@context}{blx@refcontext@context} \newrefcontext[sorting=nyt] \makeatletter \AtNextBibliography{% \def\blx@setdefaultrefcontext#1{}% \csletcs{blx@refcontext@context}{saved@blx@refcontext@context}} \makeatother \printbibliography[title=Global Bibliography (alphabetic),heading=bibintoc]

\newrefcontext[sorting=nyt] \makeatletter \AtNextBibliography{% \def\blx@setdefaultrefcontext#1{}% \DeclareFieldFormat{labelnumberwidth}{#1\addperiod}} \makeatother \printbibliography[title={Global Bibliography (alphabetic & continuous numbering)},heading=bibintoc]

\end{document}

Screenshot of global bibliography with alphabetic sorting and continuous numbering)

edit Updated in light of \begingroup \endgroup changing citation numbers.

moewe
  • 175,683
  • Sir can we tallk via email leszpol2@gmail.com. There are still problems. Here is no place for details. AfI will publish correct solution due to you. When I look at the last solution the bibliography is ok but numbers ofo bibliography in text changed and aren't ok. Additionaly in my oryginal job where I have --"if bolean function"** use I see thext a one line thelabelnumber and alphabetical sorting on my personal bibliography is bad. I use Overleaf that I can give you acces to my oryginal example that you can examine it but I need your email adress. Is it possible, please. – L. Flis Oct 30 '22 at 10:21
  • @L.Flis Sorry, I can't offer help via email. I'll be happy to look at further questions of yours on this site though - even if I of course cannot promise that I have time to answer them. If you need quick support, you may want to enlist one of the people who offer commercial LaTeX support (some, but definitely not all are listed at https://tug.org/consultants.html). – moewe Oct 30 '22 at 15:22
  • Sir I spent few hours preparing question and regected it becuse I didn' notice that also to the previouse one soluton you add \begingroup and \end not only to the last one! It gives positive solution but changes for example 6 position to the 8 etc . It should stay 6 but when I delete begin group the alphabetic order disapears. Ihave prepare shorter question. – L. Flis Oct 31 '22 at 00:22