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
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
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: 10335
- 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