
Na verdade, sou novo em LaTeX. Quero imprimir a bibliografia de cada capítulo. Eu tentei, mas falhei. Minha estrutura de arquivos é fornecida abaixo:
Na pasta texfiles
há uma subpasta chamada chapters
e dois arquivos, um .tex
arquivo principal chamado main.tex
e outro .bib
arquivo chamado bibliography.bib
arquivo.
A subpasta chapters
contém dois .tex
arquivos: chapter01.tex
e chapter02.tex
.
O diretório texfiles
contém:
1.
main.tex
:
\documentclass[a4paper,12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
%\usepackage[sectionbib]{chapterbib}
\usepackage{biblatex}
\usepackage[numbers]{natbib}
\bibliography{bibliography}
\bibliographystyle{ieeetr}
\begin{document}
\author{Author's Name}
\title{Simple Book Example}
\date{January 2017}
\frontmatter
\maketitle
\tableofcontents
\mainmatter
\include{./chapters/chapter01}
\include{./chapters/chapter02}
\backmatter
\end{document}
2.
bibliography.bib
:
@book{id1,
author = {author},
title = {title},
date = {date},
publisher={aaaaaaa},
year={2017}
}
@book{id2,
author = {author},
title = {title},
date = {date},
publisher={sdddddddds},
year={2017}
}
e o subdiretório chapters
contém o seguinte:
1.
chapter01.tex
:
\chapter{Title of chapter 1}
some text of chapter 1
\section{Title of section}
some text of section of chapter 1
\cite{id1,id2}
\printbibliography
2.
chapter02.tex
:
\chapter{Title of chapter 2}
some text of chapter 2
\section{Title of section}
some text of section of chapter 2
\cite{id1,id2}
\printbibliography
Estou usando o compilador 'Texstudio' no sistema operacional Linuxmint. Por favor me ajude a fazer isso. Desde já, obrigado.
Responder1
Com a opção refsegment=chapter
você biblatex
pode conseguir o que deseja.
Então você pode escrever
\printbibliography[segment=\therefsegment,title=first bib]
e a opção segment=\therefsegment
fornece uma bibliografia apenas para as entradas citadas no segmento atual.
Por favor, veja o seguinte MWE
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{id1,
author = {author},
title = {title},
date = {date},
publisher={aaaaaaa},
year={2017}
}
@book{id2,
author = {author},
title = {title},
date = {date},
publisher={sdddddddds},
year={2017}
}
\end{filecontents}
\documentclass[a4paper,12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[%
refsegment=chapter, % <===============================================
natbib
]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
\author{Author's Name}
\title{Simple Book Example}
\date{January 2017}
\frontmatter
\maketitle
\tableofcontents
\mainmatter
\chapter{Title of chapter 1}
some text of chapter 1
\section{Title of section}
some text of section of chapter 1
\cite{id1,id2}
\printbibliography[segment=\therefsegment,title=first bib] % <==========
\chapter{Title of chapter 2}
some text of chapter 2
\cite{id1}
\printbibliography[segment=\therefsegment,title=second bib] % <=========
\backmatter
\end{document}
e as duas bibliografias resultantes:
e