Получить ссылки из файла .bib на отдельную главу в подкаталоге

Получить ссылки из файла .bib на отдельную главу в подкаталоге

На самом деле я новичок в LaTeX. Хочу распечатать библиографию в каждой главе. Я пробовал, но не получилось. Структура моих файлов приведена ниже:

В папке texfilesесть одна подпапка с именем chaptersи два файла: один основной .texфайл с именем main.texи другой .bibфайл с именем bibliography.bibfile.

Подпапка chaptersсодержит два .texфайла: chapter01.texи chapter02.tex.

Каталог texfilesсодержит:

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}
}

и подкаталог chaptersсодержит следующее:

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

Я использую компилятор 'Texstudio' в ОС Linuxmint. Пожалуйста, помогите мне это сделать. Заранее спасибо.

решение1

refsegment=chapterС этой опцией biblatexвы можете получить то, что хотите.

Тогда вы можете написать

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

и опция segment=\therefsegmentпредоставляет вам библиографию только для цитируемых записей-библиографий в текущем сегменте.

Пожалуйста, ознакомьтесь со следующим 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}

и две полученные библиографии:

первая боблиография

и

вторая библиография

Связанный контент