GeneralRestart reference numbering after each chapter

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
marbocam
Posts: 66
Joined: Thu Dec 19, 2024 11:14 am

Restart reference numbering after each chapter

Post by marbocam »

Hi there,

so, this is enoying because at some point I managed to do it, but now I can't figure it out... I need to restart the reference numbering after each chapter, but can't seem to achieve it..

Here's my code with a hopefully working example:

Code: Select all

\documentclass{report}
\usepackage[backend=bibtex,style=ieee,natbib=true,maxnames=100,minnames=100,defernumbers=true,citestyle=numeric-comp]{biblatex}
\begin{filecontents}{references.bib}
@book{DK86,
  author = "D.E. Knuth",
  title = "The {\TeX}book",
  publisher = "Addison Wesley",
  year = 1986,
  keywords={chap1}
}
@article{DK89,
  author = "D.E. Knuth",
  title = "Typesetting Concrete Mathematics",
  journal = "TUGboat",
  volume = 10,
  number = 1,
  pages = "31--36",
  month = apr,
  year = 1989,
  keywords={chap1}
}
@book{Lamport,
  author = "Leslie Lamport",
  title = "\LaTeX: A Document Preparation System",
  publisher = "Addison Wesley",
  year = 1986,
  keywords={chap2}
}
\end{filecontents}
\addbibresource{references.bib}
\begin{document}
\chapter{\TeX}
To study \TeX\ in depth, see \autocite{DK86}. For writing math texts,
see \autocite{DK89}.
\addcontentsline{toc}{section}{References}
\printbibliography[heading=subbibliography,resetnumbers,keyword=chap1]
\chapter{\LaTeX}
The basic reference for \LaTeX\ is \autocite{Lamport}.
\addcontentsline{toc}{section}{References}
\printbibliography[heading=subbibliography,resetnumbers,keyword=chap2]
\end{document}
What am I doing wrong???

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

marbocam
Posts: 66
Joined: Thu Dec 19, 2024 11:14 am

Re: Restart reference numbering after each chapter

Post by marbocam »

JC.. Why is it not working for me????
marbocam
Posts: 66
Joined: Thu Dec 19, 2024 11:14 am

Re: Restart reference numbering after each chapter

Post by marbocam »

I ended up deleting all the doc associated to my main and now it's working! :P
User avatar
Stefan Kottwitz
Site Admin
Posts: 10397
Joined: Mon Mar 10, 2008 9:44 pm

Re: Restart reference numbering after each chapter

Post by Stefan Kottwitz »

Good to know that it works now! Indeed, removing all the automatically generated files (.aux etc.) can help in starting fresh without errors caused within those files.

Stefan
LaTeX.org admin
marbocam
Posts: 66
Joined: Thu Dec 19, 2024 11:14 am

Re: Restart reference numbering after each chapter

Post by marbocam »

Exactly, I only left behind <main>.tex/.xmpdata/.dvi and <main>.blg . All the rest were erased :)
Post Reply