BibTeX, biblatex and biber ⇒ Two References Sections
-
- Posts: 141
- Joined: Sun Jun 12, 2011 6:30 am
Two References Sections
Basically, I want the document to appear as follows after it is compiled:
1. Article
2. References for Article
3. Appendix
4. References for Appendix
Currently, I can get the article to format as:
1. Article
2. Appendix
3. References for both
or
1. Article
2. References for both
3. Appendix
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
-
- Posts: 126
- Joined: Sun Feb 13, 2011 8:36 pm
Two References Sections
The other solution I can think of is to compile the appendix as a separate document and then either merge the PDFs or \input the bibliography.
-
- Posts: 141
- Joined: Sun Jun 12, 2011 6:30 am
Two References Sections
I really appreciate your response and your taking the time to help me. Neither solution is quite what I have in mind, however. At least that's what I think unless I am operating under some wrong assumptions.
As I wrote before, I am wondering whether I can produce from 1 Latex document 2 reference sections using only 1 .bib file. So that would already knock off the first solution, which requires using 2 .bib files (though not the worst thing to do.)
My concern with the second solution is how that will affect using hyperref. I suppose I can always just mannually update the page count in the second latex document by setting the page counter, right? However, I'm worried that merging the 2 .pdf files will mess up the hyperref. Are you suggesting using Adobe Professional for that?
Please let me know if I am misunderstanding what you are saying or I am generally not correct in how I'm thinking about Bibtex. My deepest apologies if that is the case.
Again, I really appreciate your thoughts on the subject.
5gon12eder wrote:This is not exactly, what you had in mind, but you can use the bibtopic package to produce independent bibliographies from two *.bib files. This might help you somewhat.
The other solution I can think of is to compile the appendix as a separate document and then either merge the PDFs or \input the bibliography.
-
- Posts: 126
- Joined: Sun Feb 13, 2011 8:36 pm
Two References Sections
One solution would be to use the bibunits package. It allows you to define environments in your document that have all their own bibliographies. Unfortunately, hyperref doesn't seem to detect its citations and doesn't link them. Here is an example:
Code: Select all
\documentclass{article}
\usepackage{bibunits}
\usepackage{hyperref}
\title{A Document With Two Bibliographies}
\author{The Unreasonable Man}
\begin{document}
\begin{bibunit}[plain]
\maketitle
\tableofcontents
\section{The Art of Computer Programming}
You can look this up in Knuth's famous books
\cite{ArtCompProg1:2011,ArtCompProg2:1998,ArtCompProg3:2004}.
\putbib[literature]
\end{bibunit}
\begin{bibunit}[plain]
\appendix
\section{Note on Sorting and Searching}
Well, have a look at the book mentioned before \cite{ArtCompProg3:2004}.
\putbib[literature]
\end{bibunit}
\end{document}
Code: Select all
pdflatex bibunits
bibtex bu1
bibtex bu2
pdflatex bibunits
pdflatex bibunits
Code: Select all
\documentclass{article}
\usepackage{multibbl}
\usepackage{hyperref}
\newbibliography{main}
\newbibliography{appendix}
\title{A Document With Two Bibliographies}
\author{The Unreasonable Man}
\begin{document}
\maketitle
\tableofcontents
\section{The Art of Computer Programming}
You can look this up in Knuth's famous books
\cite{main}{ArtCompProg1:2011,ArtCompProg2:1998,ArtCompProg3:2004}.
\bibliographystyle{main}{plain}
\bibliography{main}{literature}{References}
\appendix
\section{Note on Sorting and Searching}
Well, have a look at the book mentioned before \cite{appendix}{ArtCompProg3:2004}.
\bibliographystyle{appendix}{plain}
\bibliography{appendix}{literature}{References}
\end{document}
Code: Select all
pdflatex multibbl
bibtex main
bibtex appendix
pdflatex multibbl
pdflatex multibbl
To try the examples, the following bibliography file, that should be named literature.bib may be used:
Code: Select all
@book{ArtCompProg1:2011,
author = "Knuth, Donald E.",
title = "The art of computer programming",
volume = "1: Fundamental algorithms",
publisher = "Addison-Wesley",
address = "Reading, Mass.",
year = "2011",
edition = "3",
}
@book{ArtCompProg2:1998,
author = "Knuth, Donald E.",
title = "The art of computer programming",
volume = "2: Seminumerical algorithms",
address = "Reading, Mass.",
publisher = "Addison-Wesley",
year = "1998",
edition = "3",
}
@book{ArtCompProg3:2004,
author = "Knuth, Donald E.",
title = "The art of computer programming",
volume = "3: Sorting and searching",
address = "Reading, Mass.",
publisher = "Addison-Wesley",
year = "2004",
edition = "2",
}
Best
- Attachments
-
- multibbl.pdf
- Typeset example using the multibbl package.
- (82.38 KiB) Downloaded 1340 times
-
- Posts: 141
- Joined: Sun Jun 12, 2011 6:30 am
Two References Sections
The second case is exactly what I would like to do. However, I have a few questions.
Primarily, I cannot understand what you mean by the following:
I work with TeXnicCenter and I executive files by doing Build -> Current File -> Build.5gon12eder wrote:Code: Select all
pdflatex multibbl bibtex main bibtex appendix pdflatex multibbl pdflatex multibbl
So I cannot understand how to run the code. What does it mean to do bibtex main and bibtex appendix? I thought that the bibtex files had a different name. I realize I am not doing anything for the 2 bibtex lines, and so I am not able to get the references to work.
Second, I have traditionally been using natbib. Does this replace that?
Lastly, I use a customized .sty file. Could I still incorporate it?
-
- Posts: 126
- Joined: Sun Feb 13, 2011 8:36 pm
Two References Sections
sorry for answering late.
The commands were meant to be run on a terminal. I don't know about TeXnicCenter. Maybe someone else here can help you how to get it invoke these commands. At least for testing you can invoke them by hand from the terminal.
bibtex is processing the aux files and the package makes LaTeX write different aux files for the different reference sections. You'll see it when you run latex on the document.
In a one-minute try I was able to use the plainnat citation style within the example to produce [Author (Year)] style citations without any further changes. However, loading the natbib package seems to be somewhat more tricky and I don't know if it will work at all. The problem is that both, natbib and multibbl redefine the \cite macro.
Best
-
- Posts: 141
- Joined: Sun Jun 12, 2011 6:30 am
Two References Sections
I normally do the Build file I talked to you about. That is the equilvalent of the pdflatex multibbl. And normally bibtex gets called/complied automatically in the process....
But that does not seem to the be the case now. I keep getting told "no file main.bbl" and "no file appendix .bbl" as warnings.
So I guess my question is how to I exceutive/run the bibtex main and bibtex appendix lines?
5gon12eder wrote: pdflatex multibbl
bibtex main
bibtex appendix
pdflatex multibbl
pdflatex multibbl
Best
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Two References Sections
Steps 2 and 3 of the procedure that 5gon12eder has given have to be done on the command line. You should find the command line window (command prompt?) somewhere in your »Start« menu under »Tools« or so. If I remember right, you can also invoke it by pressing the key combination "Windows"+"R", then typing »cmd« and confirming with "Enter". If you are successful, a window with black background opens where there is a flashing cursor. There you type consecutivelylatexhelp1 wrote:[…] So I guess my question is how to I exceutive/run the bibtex main and bibtex appendix lines?
Code: Select all
bibtex main
Code: Select all
bibtex appendix
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 141
- Joined: Sun Jun 12, 2011 6:30 am
Two References Sections
I really like the second solution because I want to use hyperref! And thanks to localghost's earlier note, I am able to compile it!

However, I still have two questions.
1. I do not quite understand what you mean by plainnat. I am not sure how to cite within the text.
Currently, I use \usepackage{natbib}. And with that, in the text, I use \citet to cite like Author (Year), \citep to cite like (Author, Year), \citealp* for multiple citations, and \defcitealias{citation}{Citation)}\citepalias{citation} to customize the citation.
What are you saying I should do instead?
2. I have a customized .bst file that I must use for formatting the bibliography section. Currently I use \bibliographystyle{customized} for the customized.sty. When I try this with the new file, \bibliographystyle{main}{customized}, it does not work. It only works with \bibliographystyle{main}{plain}
How would I incorporate this new .bst?
I suspect that my .bst is based on using natbib, which is why I asked before about how to incorporate natbib...
Thank you very much for your help!
P.S. The following example suggests that it is possible to use natbib:
http://www.latex-community.org/forum/vi ... 09&start=0
I cannot understand how to modify it per your example, however. Yours I understand much better.
5gon12eder wrote:Hello latexhelp1,
In a one-minute try I was able to use the plainnat citation style within the example to produce [Author (Year)] style citations without any further changes. However, loading the natbib package seems to be somewhat more tricky and I don't know if it will work at all. The problem is that both, natbib and multibbl redefine the \cite macro.
Best
-
- Posts: 141
- Joined: Sun Jun 12, 2011 6:30 am
Two References Sections
Code: Select all
\makeatletter
\providecommand\@newciteauxhandle{\@auxout}
\def\@restore@auxhandle{\gdef\@newciteauxhandle{\@auxout}}
\AtBeginDocument{%
\@ifundefined{newcites}{\global\let\@restore@auxhandle\relax}{}}
\makeatother
HOWEVER, I have NO idea how to use natbib with this syntax!! I just understand that the code will compile with these lines and yet they are required to do natbib like things (e.g. \citet, citep).
Any further help would be much appreciated!! I have tried to read the manual!! I promise
