
実は私は LaTeX 初心者です。各章の参考文献を印刷したいのですが、試してみましたが失敗しました。ファイル構造は以下のとおりです。
フォルダーには、 という名前のサブフォルダーが 1 つと、 という名前のメインファイルと、file という名前の別のファイルの2 つのファイルtexfiles
があります。 chapters
.tex
main.tex
.bib
bibliography.bib
サブフォルダーには、とというchapters
2 つの.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
私は Linuxmint OS で「Texstudio」コンパイラを使用しています。これを実行するのを手伝ってください。よろしくお願いします。
答え1
オプションを使用するとrefsegment=chapter
、biblatex
必要なものを入手できます。
そうすれば、
\printbibliography[segment=\therefsegment,title=first bib]
オプションを選択すると、segment=\therefsegment
現在のセグメントで引用されている bib エントリのみの参考文献が表示されます。
以下の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}
そしてその結果得られた2つの書誌:
そして