2

Is it possible to get both the numbered and the author-year citation style in a single book by using the natbib package?

I need one chapter with numbered and another chapter with author-year style. Is it possible to get the output by using the natbib package?

lockstep
  • 250,273
RCV
  • 2,030
  • Why both styles in the same book? – Aradnix Oct 29 '14 at 04:19
  • 1
    Will there be a separate bibliography for each chapter? – Mico Dec 31 '14 at 13:27
  • 1
    Is the natbib package mandatory or is another package also fine? – cryingshadow Jan 01 '15 at 13:12
  • Which journal is it? Journals do not do this. A journal has a style and authors' articles are laid out according to that style so that the finished product has a consistent look. Similarly, most book publishers have standard styles they use. Certainly, a single style would be used for all chapters in an anthology, and usually for all books in a series or whatever. – cfr Jan 02 '15 at 03:36
  • You need to use a package to support the production of multiple bibliographies. – cfr Jan 02 '15 at 03:51
  • bibunits can do this but I've deleted my answer because ti does not allow numerical + author-year if natbib is used. – cfr Jan 02 '15 at 03:57
  • I think the chapterbib package can do this. See Multiple bibliographies for an example. – Alan Munn Jan 02 '15 at 06:29
  • @AlanMunn Feel free to copy my example. I was just curious about how this would work because I'd tried to get chapterbib working in this way before and failed. You should answer, though. – cfr Jan 03 '15 at 00:21
  • @cfr If your answer works, I would just undelete it and be done with it. – Alan Munn Jan 03 '15 at 02:52
  • @AlanMunn OK. Well, tell me if you change your mind. It worked with my MWE. I don't know whether it will work for the OP given the lack of MWE. – cfr Jan 03 '15 at 02:55

1 Answers1

2

This uses Alan Munn's suggestion in a comment on the question. I'd tried chapterbib before but got errors, even using the documentation for natbib. However, experimentation suggests the following should work:

\begin{filecontents}{f1.tex}
  \chapter{A chapter}
  \bibliographystyle{plainnat}
  \citestyle{plainnat}
  References to an article, \cite{article-full},
  and to an entire journal, which appears
  only in the references\nocite{whole-journal}.
  \bibliography{xampl}
\end{filecontents}
\begin{filecontents}{f2.tex}
  \chapter{Another chapter}
  \bibliographystyle{plainnat}
  \citestyle{plain}
  A new chapter with a different style and a cite
  of some possibly interesting proceedings, \cite{proceedings-full}.
  \bibliography{xampl}
\end{filecontents}
\documentclass[openany]{book}
\usepackage{chapterbib}
\usepackage[sectionbib]{natbib}
\begin{document}
  \include{f1}
  \include{f2}
\end{document}

Note that various things seem to be crucial here. In particular, you need to issue \citestyle{} which was not obvious to me from the documentation. In particular, you need to do this even when you want to use the plainnat style and even when you've just issued \bibliographystyle{plainnat}. At least, without this, I could not get the correct format to be used.

author-year and numerical chapter-by-chapter

cfr
  • 198,882