I want to create an article in Latex with natbib
and the following structure:
- Introduction
- Chapter 2
- Chapter 3
- Discussion
The article's references should have the following characteristics:
- Introduction and Discussion should "share" their reference list
- Chapter 2 and Chapter 3 should each have their own reference list (only containing the references that are used in Chapter 2 and Chapter 3, respectively)
- References that are used in Chapter 2 and/or Chapter 3, but not in Introduction or Discussion should not be included in the References of Introduction/Discussion.
- References should be printed after Chapter 2, after Chapter 3 and Discussion
- there should be no reference list after Introduction (all references from Introduction should be used in the reference list of the discussion)
I have created the following MWE:
\documentclass[11pt,a4paper,english,arial,twoside]{article}\usepackage[]{graphicx}\usepackage[]{color}
%\usepackage[backend=bibtex,natbib,style=authoryear,maxcitenames=2]{biblatex}
%\addbibresource{citations}
\usepackage[authoryear,sectionbib, sort&compress]{natbib}
\usepackage{chapterbib}
\usepackage{filecontents}
\begin{document}
\begin{filecontents*}{bibliography_mwe.bib}
@article{ref1,
title={ref1},
author={ref1},
year={1},
institution={ref1}
}
@article{ref2,
title={ref2},
author={ref2},
year={2},
institution={ref2}
}
@article{ref3,
title={ref3},
author={ref3},
year={3},
institution={ref3}
}
@article{ref4,
title={ref4},
author={ref4},
year={4},
institution={ref4}
}
@article{ref5,
title={ref5},
author={ref5},
year={5},
institution={ref5}
}
@article{ref6,
title={ref6},
author={ref6},
year={6},
institution={ref6}
}
@article{ref7,
title={ref7},
author={ref7},
year={7},
institution={ref7}
}
@article{ref8,
title={ref8},
author={ref8},
year={8},
institution={ref8}
}
\end{filecontents*}
\section{Introduction}
bla bla bla bla bla \newline
\cite{ref1} \newline
bla bla bla bla bla \newline
\cite{ref2} \newline
bla bla bla bla bla \newline
\cite{ref3} \newline
bla bla bla bla bla \newline
\begin{filecontents*}{chap2_mwe.tex}
\section{Chapter 2}
bla bla bla bla bla \newline
\cite{ref4} \newline
bla bla bla bla bla \newline
\cite{ref5} \newline
\bibliographystyle{alpha}
\bibliography{bibliography_mwe}
\end{filecontents*}
\begin{filecontents*}{chap3_mwe.tex}
\section{Chapter 3}
bla bla bla bla bla \newline
\cite{ref6} \newline
bla bla bla bla bla \newline
\cite{ref7} \newline
\bibliographystyle{alpha}
\bibliography{bibliography_mwe}
\end{filecontents*}
\include{chap2_mwe}
\include{chap3_mwe}
\section{Discussion}
bla bla bla bla bla \newline
\cite{ref4} \newline
bla bla bla bla bla \newline
\cite{ref8} \newline
\bibliographystyle{alpha}
\bibliography{bibliography_mwe}
\end{document}
I would like to have the following output:
- Reference list of Chapter 2: ref4, ref5
- Reference list of Chapter 3: ref6, ref7
- Reference list of Introduction&Discussion: ref1, ref2, ref3, ref4, ref8.
Do you have any idea how this can work?
My idea with using filecontents*
environments for Chapter 2 and Chapter 3, does not work, when compiling:
bibtex chap2_mwe.aux
bibtex chap3_mew.aux
bibtex mwe.aux
pdflatex_mwe.tex
pdflatex_mwe.tex
EDIT as proposed by @moewe: using bibtex
and refsection
only one bibliography is created. Maybe I am missing something here...
EDIT: works if I have used it correctly (see below)
\documentclass[11pt,a4paper,english,arial,twoside]{article}
\usepackage[]{graphicx}\usepackage[]{color}
\usepackage[style=alphabetic,backend=bibtex]{biblatex}
\addbibresource{bibliography_mwe}
\usepackage{filecontents}
\begin{filecontents*}{bibliography_mwe.bib}
@article{ref1,
title={ref1},
author={ref1},
year={1},
institution={ref1}
}
@article{ref2,
title={ref2},
author={ref2},
year={2},
institution={ref2}
}
@article{ref3,
title={ref3},
author={ref3},
year={3},
institution={ref3}
}
@article{ref4,
title={ref4},
author={ref4},
year={4},
institution={ref4}
}
@article{ref5,
title={ref5},
author={ref5},
year={5},
institution={ref5}
}
@article{ref6,
title={ref6},
author={ref6},
year={6},
institution={ref6}
}
@article{ref7,
title={ref7},
author={ref7},
year={7},
institution={ref7}
}
@article{ref8,
title={ref8},
author={ref8},
year={8},
institution={ref8}
}
\end{filecontents*}
\begin{document}
\section{Introduction}\label{sec:int}
bla bla bla bla bla \newline
\cite{ref1} \newline
bla bla bla bla bla \newline
\cite{ref2} \newline
bla bla bla bla bla \newline
\cite{ref3} \newline
bla bla bla bla bla \newline
\begin{refsection}
\section{Chapter 2}\label{sec:2}
bla bla bla bla bla \newline
\cite{ref4} \newline
bla bla bla bla bla \newline
\cite{ref5} \newline
\printbibliography[heading=subbibliography]
\end{refsection}
\begin{refsection}
\section{Chapter 3}\label{sec:3}
bla bla bla bla bla \newline
\cite{ref6} \newline
bla bla bla bla bla \newline
\cite{ref7} \newline
\printbibliography[heading=subbibliography]
\end{refsection}
\section{Discussion}\label{sec:disc}
bla bla bla bla bla \newline
\cite{ref4} \newline
bla bla bla bla bla \newline
\cite{ref8} \newline
\printbibliography[heading=subbibliography]
\end{document}
EDIT:
solution: run
pdflatex mwe.tex
bibtex mwe.aux
bibtex mwe1-blx.aux
bibtex mwe2-blx.aux
pdflatex mwe.tex
natbib
(or BibTeX in general) doesn't support multiple bibliographies, no matter if you use\include
(and/orfilecontents
) or not. You'll need additional packages like ctan.org/pkg/chapterbib or ctan.org/pkg/bibunits, but I'm not sure if those are enough for what you want.biblatex
can do a lot more in that regard (but I'm not sure if what you want is easily doable withbiblatex
, either.) Possibly interesting/related: tex.stackexchange.com/a/44602/35864, tex.stackexchange.com/q/17474/35864, tex.stackexchange.com/q/229846/35864biblatex
that would be great, too. Looking at your links it seems, that they are dealing with slightly different question. I guess, in my case it is most tricky that the two connected sections (Introduction&Discussion) are split up by Chapter 2 and Chapter 3.