我希望这可能是完成该主题的最后一个请求。如何在以下示例中添加一个基于前一个参考书目但数字按字母顺序排列的参考书目。
\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}
我想我们需要在这里做点什么
\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]
也许我们需要这次给出一些命令来仅从 1-11 更改顺序。它将被视为单独的信息,通常有多少职位,并按字母顺序查找姓名。在这种情况下,编号与文件无关。只是按字母顺序从 1-11 提供一般信息,如下所示。
通常,当我们只有一个按字母顺序排列的参考书目时,我们会这样做,因为这是相当标准的,但前一个应该保留,并且同一文档中的附加信息需要在最后再添加一个,以免生成具有此类列表的单独文档。
答案1
如果我们想要在字母顺序书目之后再添加一个书目按字母顺序排列的附加参考书目(sorting=none)使用不同的编号方案,我们可能应该将我们在那里应用的补丁保留在本地\AtNextBibliography
。然后再执行另一个\newrefcontext
并\printbibliography
完成工作。
我更改了最后一份参考书目的编号格式,以避免与现有数字混淆。
\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}
编辑根据以下情况更新\begingroup \endgroup 更改引用编号。