0

Thanks "moewe I have solution like below:

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

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

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

\newrefcontext[sorting=nyt] \begingroup \DeclareFieldFormat{labelnumberwidth}{#1\addperiod} \printbibliography[title={Global Bibliography (alphabetic & continuous numbering)},heading=bibintoc] \endgroup

\end{document}

With \begingroup \endgroup I have Global bibliography (alphabetic & continuous numbering) and this is OK.

enter image description here

but for example in the text position [6] of the bibliography has now number [8] from the last Global Bibliography (alphabetic & continuous numbering). It changes all citation in the text. This should stay [6] etc.

enter image description here

enter image description here

When I coment \begingroup \endgroup

enter image description here

the citations are correct

enter image description here

but continuous numbering is broken :(.

enter image description here

I need in the Global Bibliography (alphabetic & continuous numbering) just only nubers [1], [2] [3]...[11] not conected with the text and the previous citation numbers [6] [1] which should stay.

L. Flis
  • 53

1 Answers1

1

Try the following streamlined version that keeps into account that the last bibliography normally sets the default refcontext (which we don't want here).

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

moewe
  • 175,683
  • Sir. It works. Thank you. I put the last problem when I use \ifthen function thera are problems. Of course if you hve time..... Biblatex - using bolean function – L. Flis Nov 01 '22 at 14:31
  • Sir. I have solved the last problem using if \else \fi* function agains ifthen package and evrythongs works fine. Apparently some bug exist in ifthen package. I am interested in using ifthen package and I wil try to report the problem to the author. I will give an answer solution to my last post myself but if you find aslo answer it would be great. Thank you for all help. – L. Flis Nov 01 '22 at 19:12