Obtenga las referencias de un archivo .bib a un capítulo separado en el subdirectorio

Obtenga las referencias de un archivo .bib a un capítulo separado en el subdirectorio

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 texfileshay una subcarpeta llamada chaptersy dos archivos, un .texarchivo principal llamado main.texy otro .bibarchivo llamado bibliography.bibarchivo.

La subcarpeta chapterscontiene dos .texarchivos que son chapter01.texy chapter02.tex.

El directorio texfilescontiene:

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 chapterscontiene 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=chapterpara que biblatexpuedas conseguir lo que quieras.

Entonces puedes escribir

\printbibliography[segment=\therefsegment,title=first bib]

y la opción segment=\therefsegmentle 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:

primera bobliografía

y

segunda bibliografía

información relacionada