更新每章参考书目编号的命令

更新每章参考书目编号的命令

更新代码:

\documentclass[11pt,fleqn]{book}
\usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,a4paper]{geometry} \usepackage{xcolor}
\definecolor{ocre}{RGB}{243,102,25}
\usepackage{avant}
\usepackage{mathptmx}
\usepackage{microtype}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{calc}

\usepackage[refsection=chapter,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}
\defbibheading{bibempty}{}
\usepackage{empheq}
\usepackage{calc}
\usepackage{makeidx}
\makeindex
\newcommand*{\refname}{Bibliography}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@book{book1,
    address = {New York},
    publisher = {John Wiley \& Sons},
    author = {Egan, Willian F.},
    title = {Phase-Lock Basics},
    year = {1998},
    %volume = {3},
    %series = {2},
    edition = {1},
    pages = {3--4},
    %month = {January}
}

@article{art1,
    address = {City},
    publisher = {Myself},
    author = {Doe, John},
    title = {Synthesizer Modulation},
    year = {1979},
    %volume = {14},
    %number = {6},
    %pages = {1--8},
    month = {June}
}

@book{book2,
    address = {New York},
    publisher = {John Wiley \& Sons},
    author = {Gardner, Floyd M.},
    title = {Phaselock Techniques},
    year = {2005},
    %volume = {14},
    %number = {6},
    pages = {6--28},
    %month = {June}
}

@book{book3,
    address = {California},
    publisher = {Benjamin/Cummings},
    author = {Norman S.},
    title = {Control Systems Engineering},
    year = {1995},
    %volume = {3},
    %series = {2},
    edition = {2},
    pages = {231--232},
    %month = {February}
}

@article{art2,
    address = {Plantation},
    publisher = {Myself},
    author = {Me.},
    title = {Lock Time Performance},
    year = {1990},
    %volume = {14},
    %number = {6},
    %pages = {1--8},
    month = {June}
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

\chapter{Chapter 1}
Some  text \autocite{book1,art1}.


\section{Second}

Some  text \autocite{book2}.

Some  text \autocite{art1}.

Some  text \autocite{art2}.

Some  text \autocite{book2}.

\chapter*{Bibliography}
\addcontentsline{toc}{chapter}{\textcolor{ocre}{Bibliography}}
\section*{Books}
\addcontentsline{toc}{section}{Books}
\printbibliography[heading=bibempty,type=book,prefixnumbers={B}]
\section*{Articles}
\addcontentsline{toc}{section}{Articles}
\printbibliography[heading=bibempty,type=article,prefixnumbers={A}]

\chapter{Chapter 2}
Some  text \autocite{art1}
\chapter*{Bibliography}
\addcontentsline{toc}{chapter}{\textcolor{ocre}{Bibliography}}
\section*{Books}
\addcontentsline{toc}{section}{Books}
\printbibliography[heading=bibempty,type=book,prefixnumbers={B}]
\section*{Articles}
\addcontentsline{toc}{section}{Articles}
\printbibliography[heading=bibempty,type=article,prefixnumbers={A}]

\end{document}

但这是我得到的输出:

enter image description here

而不是 B1、B2...然后 A1、A2... 我如何获得书籍的连续编号,然后重新开始编号以获得文章的连续编号?

答案1

添加defernumbers=true选项biblatex就足以实现您的目标。

biblatex因此,对于你的情况,应该这样调用:

\usepackage[%
refsection=chapter,
defernumbers=true,
sorting=nyt,
sortcites=true,
autopunct=true,
babel=hyphen,
hyperref=true,
abbreviate=false,
backref=true,
backend=biber]{biblatex}

我没有添加完整的 MWE,但结果是:

enter image description here

相关内容