Obtenha as referências de um arquivo .bib para um capítulo separado no subdiretório

Obtenha as referências de um arquivo .bib para um capítulo separado no subdiretório

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 texfileshá uma subpasta chamada chapterse dois arquivos, um .texarquivo principal chamado main.texe outro .bibarquivo chamado bibliography.bibarquivo.

A subpasta chapterscontém dois .texarquivos: chapter01.texe chapter02.tex.

O diretório texfilesconté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 chaptersconté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=chaptervocê biblatexpode conseguir o que deseja.

Então você pode escrever

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

e a opção segment=\therefsegmentfornece 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:

primeira bobliografia

e

segunda bibliografia

informação relacionada