
De hecho soy nuevo en LaTeX. Quiero imprimir la bibliografía de cada capítulo. Lo intenté pero fallé. La estructura de mis archivos se detalla a continuación:
En la carpeta texfiles
hay una subcarpeta llamada chapters
y dos archivos, un .tex
archivo principal llamado main.tex
y otro .bib
archivo llamado bibliography.bib
archivo.
La subcarpeta chapters
contiene dos .tex
archivos que son chapter01.tex
y chapter02.tex
.
El directorio texfiles
contiene:
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}
}
y el subdirectorio chapters
contiene lo siguiente:
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
Estoy usando el compilador 'Texstudio' en el sistema operativo Linuxmint. Por favor, ayúdame a hacer esto. Gracias de antemano.
Respuesta1
Con la opción refsegment=chapter
para que biblatex
puedas conseguir lo que quieras.
Entonces puedes escribir
\printbibliography[segment=\therefsegment,title=first bib]
y la opción segment=\therefsegment
le brinda una bibliografía solo para las entradas bibliográficas citadas en el segmento actual.
Por favor consulte el siguiente 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}
y las dos bibliografías resultantes:
y