2

I want to separate my bibliography in two parts: 1) Articles, books, etc. 2) Webpages.

I am using multibib, but something is wrong. When I run my Latex, it only shows the first bibliography.

I have tried to select a single piece of my latex doc, and tried run it separate. For this part it works.

My document is as follow:

\documentclass[12pt,danish,a4paper]{article}
\usepackage[danish]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{float}
\usepackage{lastpage}
\usepackage{enumerate}
\usepackage{booktabs}
\setcounter{secnumdepth}{5}
\usepackage[font={small,it}]{caption}
\setcounter{tocdepth}{5}
\usepackage[hidelinks]{hyperref}
\usepackage{color}
\usepackage{enumitem}
\usepackage[top=3cm, bottom=3cm, left=2cm, right=2cm]{geometry}
\usepackage{setspace}
\usepackage[round]{natbib}
\usepackage{titlesec}
\usepackage[table,xcdraw]{xcolor}
\numberwithin{equation}{section}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\chead{\emph{Title of text}}
\cfoot{\thepage\ of \pageref{mylastpage}}
\linespread{1.5}
\usepackage{setspace}
\usepackage{array,booktabs,tabularx}
\newcolumntype{L}{>{\arraybackslash}X} 
\usepackage[nottoc,numbib]{tocbibind}
\usepackage[toc,page]{appendix}
\usepackage{multibib}
\newcites{web}{Webpages)

\begin{document}

text... \cite{xxx}, \citeweb{xxxx}.

\newpage
\bibliographystyle{agsm}
\bibliography{Litterature}

\bibliographystyleweb{agsm}
\bibliographyweb{Litterature}

\end{document} 

Is there something wrong with the preamble? It seems like something is annoying my second bibliography, although im not getting any errors?

  • I am using bibtex, by the way. – Christine Sep 04 '16 at 18:37
  • There is a typo in your code \newcites should end with } not ). Leaving this aside: Are you running bibtex on web.aux? – DG' Sep 04 '16 at 19:11
  • Im not sure what you mean by running web.aux? Do I have to make two separate bibtex files, in order make two separate bibliography? I only have a bibtex file called Litterature, but have runned bibtex several times on that. – Christine Sep 05 '16 at 09:58
  • According to the documentation, you have tor run bibtex for each bibliography created by \newcites. In your case this is web. – DG' Sep 05 '16 at 15:23

2 Answers2

4

According to the multibib-documentation you have to run bibtex for each additional bibliography created by \newcites. You are creating one additional bibliography called "web" with \newcites{web}{Webpages). So you have to run (assuming your document is called yourdoc.tex):

pdflatex yourdoc  #or equivalently "yourdoc.tex"
bibtex yourdoc    #or equivalently "yourdoc.aux"
bibtex web        #or equivalently "web.aux"
pdflatex yourdoc
pdflatex yourdoc

If you don't want to run bibtex manually, you can use latexmk, which is able to handle multibib.

Emadpres
  • 105
DG'
  • 21,727
  • I have now created two separate bibtex files. One called "Literature" and one called "Web". When I run my doc and bibtex as you described, it still doesn't work. It only shows "Literature". Also, bibtex "web" doesn't show up in my structure. – Christine Sep 06 '16 at 08:19
  • 1
    You do not have to create two bibtex files. You just have to run bibtex twice, i.e. once for each .aux-file. – DG' Sep 06 '16 at 08:21
0
\documentclass[12pt]{article}
\usepackage[backend=bibtex, defernumbers=true]{biblatex}
\addbibresource{\jobname-bib.bib}

\begin{document}

cite first article \cite{a1} plus second \cite{a2}
cite first book \cite{b1} then second \cite{b2}.
cite want to read \cite{w1}

\pagebreak{}

\printbibliography[type=book, heading=bibliography,title={Books}]
\printbibliography[type=article, heading=bibliography, title={Articles}]
\printbibliography[heading=subbibliography,keyword=want, title={Want to Read}]

%     Create bibliography  

\begin{filecontents}{\jobname-bib.bib}

@Book{b1,
  author = {BOOK 1},
  ALTeditor = {},
  title = {TITLE},
  publisher = {Publisher},
  year = {year}
}

@Book{b2,
  author = {BOOK 2},
  ALTeditor = {},
  title = {TITLE},
  publisher = {Publisher},
  year = {year}
}

@Article{a1,
  author =  {ART 1},
  title =  {TITLE},
  journal =  {Journal},
  year =  {year}
}

@Article{a2,
  author =  {ART 2},
  title =  {TITLE},
  journal =  {Journal},
  year =  {year}
}

@Reference{w1,
  author = {WANT TO READ 1},
  ALTeditor = {},
  title = {TITLE},
  publisher =  {Publisher},
  year =  {year},
  keywords = {want}
}

\end{filecontents}

\end{document}