fmarotta / kaobook

A LaTeX class for books, reports or theses based on https://github.com/kenohori/thesis and https://github.com/Tufte-LaTeX/tufte-latex.
https://github.com/fmarotta/kaobook
LaTeX Project Public License v1.3c
846 stars 182 forks source link

Bibliography by chapter? #43

Closed Santiago-Mosquera closed 4 years ago

Santiago-Mosquera commented 4 years ago

Hi! Im new using overleaf and Latex, so sorry in advance if my question is silly. I want to use this fantastic template but i need bibliography to be at the end of each chapter.

I finded a way but i get the expiration time error every single time!

Could you help me? Thank you very much!

AdrienPlacais commented 4 years ago

What did you do precisely? It is hard to help you without any information. I did it in my document by editing kaobiblio.sty :

\PassOptionsToPackage{
   %style=numeric-comp,
   % ...
   % some others lines
   % ...
   ibidtracker=context,
   refsection=chapter, % <- Add this line
}{biblatex}

Then, you need to write \printbibliography at the end of each chapter.

Santiago-Mosquera commented 4 years ago

Thanks for your Answer, Adrien! I did this in my kaobook.CLS (i dont have kaobiblio.sty, should i create it? ):

\RequirePackage[ style=authoryear, %citestyle=authortitle-icomp, %citestyle=authoryear, %bibstyle=authoryear, %bibstyle=numeric, %sorting=none, natbib=true, sorting=nyt, %sortcites=true, %autocite=footnote, backend=biber, % Compile the bibliography with biber hyperref=true, backref=true, citecounter=true, citetracker=true, %giveinits=true, bibencoding=auto, ibidtracker=context, refsection=chapter, ]{biblatex}

\AtEveryBibitem{ \clearfield{url} \clearfield{issn} \clearfield{isbn} \clearfield{archivePrefix} \clearfield{arxivId} \clearfield{pmid} \clearfield{eprint} \ifentrytype{book}{\clearfield{doi}}{} }

\DefineBibliographyStrings{english}{% backrefpage = {cited on page}, backrefpages = {cited on pages}, }

Then, in the main.tex i write \printbibliography[heading=subbibintoc] at the end of each chapter

I inherited this project so i'm not familiar with all the environment yet

AdrienPlacais commented 4 years ago

kaobiblio.sty should already exist in the styles folder. The majority of what you wrote already is in this file, where you can modify the options of \RequirePackage, \AtEveryBibitem and \DefineBibliographyStrings according to your needs.

fmarotta commented 4 years ago

Hello, and thank you both. @Santiago-Mosquera, if you are using a very old kaobook version it is possible that kaobiblio.sty does not exist and that all the relevant commands are indeed in kaobook.cls. It may be a good idea to update the template, but be prepared to see a lot of error messages, so if you are new to LaTeX I'd recommend to stick with the old version, for the moment.

The expiration time error usually appears for very large documents which take a lot of time to compile; you have several options:

Santiago-Mosquera commented 4 years ago

Hi, Federico! Thanks for you kind answer! I updated the template and i still get the error. The first solution you suggested works fine, so i'm glad it works. However, we will try with the premium plan in overleaf to be calmer.

Maybe in the future i will have to ask you again!

Kind regards!

fmarotta commented 4 years ago

Excellent! Don't hesitate to open other issues.