Generalmultibib | Only one Bibliography appearing

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
DC2
Posts: 5
Joined: Sun Jan 06, 2013 7:36 pm

multibib | Only one Bibliography appearing

Post by DC2 »

Hi,

I am searching the web for solutions and tried them, but I still cannot manage to build multiple bibliographies. Here is what I did:

My main file is as follows:

Code: Select all

\documentclass[12pt]{article}
\usepackage{natbib}

\usepackage{multibib}
\newcites{bk}{Special books}

\title{Test}
\author{a.b.c. ddddd}
\date{\today}

\begin{document}

\maketitle

\section{Introduction}

this is my first ref.\cite{book1}
and this is my second.\citebk{book2}


\bibliographystylebk{plain}
\bibliographybk{ref}

\renewcommand{\bibname}{Normal books}
\bibliographystyle{plain}
\bibliography{ref}

\end{document}
my bib file, which I have saved as "ref.bib" is as follows

Code: Select all

@Book{book1,
author = {a. bbb},
title = {title1},
year = {1986},
}

@Book{book2,
author = {b. aaa},
title = {title2},
year = {2009},
}
I am making use of Texmaker. First I run my mainfile "PDFLATEX", then "BIBTEX", then I run the ref file "BIBTEX" and then the main file "PDFLATEX".

Unfortunately, my output gives only one bibliography. (I attached an example of my output as pdf)

Please, can somebody be my hero by telling me what to do?

Thank you!
Attachments
mydoc.pdf
example of my output
(40.32 KiB) Downloaded 209 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

multibib | Only one Bibliography appearing

Post by localghost »

DC2 wrote:[…] Please, can somebody be my hero by telling me what to do? […]
Start with a Forum Search to find possible solutions or take a look at the similar topics on the bottom of this page (only when logged in). This issue has been discussed quite often. Finally reading the package manual should give you some useful information.


Best regards and welcome to the board
Thorsten
DC2
Posts: 5
Joined: Sun Jan 06, 2013 7:36 pm

Re: multibib | Only one Bibliography appearing

Post by DC2 »

Dear Thorsten,

Trust me, I really did a lot of searching already (started 5 hours ago) and I tried everything. I also did everything step by step as in the manual of "the multibib package" (is that written by you?). Still my file does not work.. I am really desperate at the moment, that is why I post this topic again.. Please, do you have a suggestion or anything to push me in the right direction?
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

multibib | Only one Bibliography appearing

Post by cgnieder »

Hi DC2,

Your code should work. Did you run bibtex twice, once on your file and once on the new bibliography, i.e., in your case

Code: Select all

bibtex bk
TeXmaker probably doesn't know it must do it here so maybe do it yourself from the command line.

Regards
site moderator & package author
DC2
Posts: 5
Joined: Sun Jan 06, 2013 7:36 pm

Re: multibib | Only one Bibliography appearing

Post by DC2 »

No, it still does not work, but thanks for your advice anyway!

Maybe I do something wrong when running the file. I do not quite understand what you mean by putting it in the command line. Here is what I do:
I always click on the arrow button, which I included as attachment. First I click pdflatex for the mainfile, then bibtex for the mainfile, then bibtex for the reference file and then pdflatex for the mainfile again.

Should this be okay?
Attachments
button.jpg
button.jpg (3.43 KiB) Viewed 5195 times
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

multibib | Only one Bibliography appearing

Post by cgnieder »

I don't know how to call it differently. It's called command line (Wikipedia link).

Regards
site moderator & package author
DC2
Posts: 5
Joined: Sun Jan 06, 2013 7:36 pm

Re: multibib | Only one Bibliography appearing

Post by DC2 »

Where can I put the commands to compile?
Is that the same as clicking the arrow to run the file?
Because clicking that arrow is the only way I know, which might cause the problem.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

multibib | Only one Bibliography appearing

Post by cgnieder »

How you open the command line depends on your OS. If you've openend it and are sure you're in the same directory as your tex file which is called testfile.tex, say, then type in the following and hit enter (for education purposes):

Code: Select all

pdflatex testfile
This should have the same effect as hitting the compile button except that it won't compile twice by itself (I don't know if TeXmaker does that, anyway). Now type the following and hit enter (again for education purposes):

Code: Select all

bibtex testfile
this should have the same effect as hitting the bibtex button. The next is the one TeXmaker probably doesn't do:

Code: Select all

bibtex bk
It's bk because you said \newcites{bk}{...} before and should create the second bibliography. After that run LaTeX again. The PDF now should have both bibliographies.

Regards
site moderator & package author
DC2
Posts: 5
Joined: Sun Jan 06, 2013 7:36 pm

Re: multibib | Only one Bibliography appearing

Post by DC2 »

Thank you so much! The last line of your last post was the thing I needed to do! I called my reference file "ref", but it must be "bk". Thank you!
Post Reply