Just to show you that xcite
is not necceccary and how to build an MWE for your problem please check the following MWE (with commented xcite
). It includes with package filecontents
three chapter files and a bib file. If you copied this MWE into file mwe.tex
then \jobname
becomes mwe
.
\RequirePackage{filecontents}
\begin{filecontents*}{testxcite1.tex}
\chapter{Chapter One}
Text \cite{adams}
\end{filecontents*}
\begin{filecontents*}{testxcite2.tex}
\chapter{Chapter Two}
Text \cite{companion}
\end{filecontents*}
\begin{filecontents*}{testxcite3.tex}
\chapter{Chapter Three}
Text \cite{adams} \cite{companion}
\end{filecontents*}
\begin{filecontents*}{\jobname.bib}
@Book{companion,
author = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
title = {The LaTeX Companion},
edition = {1},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994}
}
@Book{adams,
title = {The Restaurant at the End of the Universe},
author = {Douglas Adams},
series = {The Hitchhiker's Guide to the Galaxy},
publisher = {Pan Macmillan},
year = {1980}
}
\end{filecontents*}
\listfiles % to show used packages and versions
\documentclass{report}
\usepackage[authoryear,comma,nonamebreak,round,sort&compress]{natbib}
%\usepackage{xcite}
\bibliographystyle{plainnat}
%\externalcitedocument{testxcite1}
%\externalcitedocument{testxcite2}
%\externalcitedocument{testxcite3}
\begin{document}
\include{testxcite1}
\include{testxcite2}
\include{testxcite3}
\bibliography{\jobname}
\end{document}
Compile this MWE with latex, bibtex, latex, latex and you will get a pdf file and four warnings, coming from package filecontents
(they are okay and can be ignored). If you have still ?
instead of a correct citation there is something other wrong with your system or way to build the pdf file.
I'm not aware of a BibTeX style file for PNAS, but the Bibulous project does provide an easy way of customizing styles. For the style suggestions linked to by the OP, it took me only a few minutes to put together a complete style template to follow PNAS' requirements. Using the following main.bib database file
@ARTICLE{Neuhaus,
author = {Jean-Marc Neuhaus and Liliane Sitcher and Meins, Jr, Frederick and Thomas Boller},
year = {1991},
title = {A short C-terminal sequence is necessary and sufficient for the targeting of chitinases to the plant vacuole},
journal = {Proc Natl Acad Sci USA},
volume = {88},
number = {22},
pages = {10362-10366}
}
@INCOLLECTION{Hill,
author = {Adrian V. S. Hill},
year = {1991},
title = {HLA associations with malaria in Africa: some implications for MHC evolution},
booktitle = {Molecular Evolution of the Major Histocompatibility Complex},
editor = {Jan Klein and Dagmar Klein},
publisher = {Springer},
address = {Heidelberg},
pages = {403-420}
}
and the style template file main.bst (the lines below show the complete file)
TEMPLATES:
article = <au> (<year>) <title>. \textit{<journal>} <volume>(<number>): [<startpage>--<endpage>|<startpage>|<eid>|].[ <note>]
incollection = <au> (<year>) <title>. \textit{<booktitle>}[, vol.~<volume>, ][, <edition_ordinal>~ed.][, <null.if_singular(editorlist, edmsg1, edmsg2)>~<ed>][, <series>][, Chap.~<chapter>] (<publisher>, <address>)[, pp~<startpage>--<endpage>|p~<startpage>|<eid>|].[ <note>]
SPECIAL-TEMPLATES:
authorlist = <author.to_namelist()>
editorlist = <editor.to_namelist()>
authorname.n = [<authorlist.n.prefix> ]<authorlist.n.last>[ <authorlist.n.first.initial()>][<authorlist.n.middle.initial().compress()>][, <authorlist.n.suffix>]
au = <authorname.0>, ..., <authorname.9>
editorname.n = [<editorlist.n.prefix> ]<editorlist.n.last>[ <editorlist.n.first.initial()>][<editorlist.n.middle.initial().compress()>][, <editorlist.n.suffix>]
ed = <editorname.0>, ..., <editorname.9>
null = {}
OPTIONS:
edmsg1 = ed
edmsg2 = eds
compiling the main.tex file
\documentclass{article}
\usepackage[paper=letterpaper, text={6.5in,9in},centering]{geometry}
\makeatletter %
\renewcommand{\@biblabel}[1]{#1.}
\makeatother
\begin{document}
\nocite{Neuhaus,Hill}
\bibliography{temp}
\bibliographystyle{temp}
\end{document}
produces the following formatted result:
This provides templates for only journal articles and articles/chapters in books, but the PNAS website provides guidelines for only these two. Templates for other entry types are easily derived from the two shown here. (For example, a book
entry type template can be defined by adding another line
book = <au> (<year>) <title>. ...
in the lines below TEMPLATE:
in the style template file.)
Best Answer
With the option
refsegment=chapter
forbiblatex
you can get what you want.Then you can write
and option
segment=\therefsegment
gives you a bibliography for only cited bib entries in the current segment.Please see the following MWE
and the two resulting bibliographies:
and