BibTeX, biblatex and biber ⇒ natbib and subfiles packages
natbib and subfiles packages
Obviously I only want one reference list in my final document so I cant include an instruction to crease a bibliography in every subfile. But when I do not include the commands to crease a bibliography in each subfile I cant get the in text citations to show when I compile individual subfiles.
Thanks
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
natbib and subfiles packages
Code: Select all
\usepackage{comment}
\excludecomment{thebibliography}
natbib and subfiles packages
Code: Select all
%\bibliographystyle{plain}
%\bibliography{../References}
Note that I use "../References" instead of "References" because my References.bib file is located in the parent directory.
natbib and subfiles packages
In your main file:
Code: Select all
\documentclass[...]{...}
\usepackage{natbib}
\usepackage{subfiles}
...
\def\biblio{\bibliographystyle{plainnat}\bibliography{bibliography}}
\begin{document}
\def\biblio{}
...
\subfile{chapter_1}
\subfile{chapter_2}
...
\bibliographystyle{plainnat}
\bibliography{bibliography}
\end{document}
Code: Select all
\documentclass[main]{subfiles}
\begin{document}
...
\biblio
\end{document}
-
- Posts: 1
- Joined: Sun Aug 09, 2015 5:28 pm
Re: natbib and subfiles packages
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
natbib and subfiles packages
welcome to the forum!
It's great to read, that it worked for you. Just to mention that, perhaps the challenge could be tackled with the modern biblatex package too.
Stefan