# natbib: Split Bibliography Into Sections By Entrytype (without using multibib)

## What's wrong with multibib?

multibib lets me split up my bibliography. But I have to specify manually (by \citeabc or \citedef), which bibliography entry belongs to which section. Also, it's not (really) compatible with LyX.

## What do I want?

I want to create a book including natbib's author-date cites and bibliography using LyX.

My \bibliography should be splitted into 2 parts:

• @ELECTRONIC (Electronical resources)
• non-@ELECTRONIC (Books, jornals etc.)

I don't want to do this by hand because it's error-prone on big bibliographies and just redundant.

## My Question:

What's the best way to automatically split up a natbib bibliography into an @ELECTRONIC and a non-@ELECTRONIC section (by the entrytype of the .bib file)?

## An Example:

% file.bib

@ELECTRONIC{Lundmaier,
%...
}

@ARTICLE{Lundstein,
%...
}

@BOOK{Lundberg,
%...
}

% file.tex

\citep{Lundberg, Lundstein, Lundmaier}
\bibliography{file}


should result in:

== Bibliography ==
= Books and Jornals =
Lundberg, Ulla-Lena ...
Lundstein, Hannah ...

= Electronical Resources =
Lundmaier, Tina ...

-
have you already considered switching to biblatex? It should provide all the features of natbib as well as a mechanism where you can put bibliography entries to different bibliographies depending on various criteria (also entry type if I remember correctly). –  Benedikt Bauer Jan 8 '13 at 21:40
Thanks for your suggestion (my first upvote ever ;-) ). - I don't know much about biblatex, so I'll try to get some informations about biblatex and comment again later on. –  fdj815 Jan 8 '13 at 22:03
I created my own .bst using custom-bib's makebst and I really need that style. - Do you know: Is there any way to port/convert/use .bsts for biblatex? (Or at least: Is there a nice toolkit for style creation like makebst for biblatex?) –  fdj815 Jan 9 '13 at 0:29
Unfortunately it looks like there isn't any such tool yet. Compare Is there a WYSIWYG editor for biblatex styles? –  Benedikt Bauer Jan 9 '13 at 7:41
@BenediktBauer Thanks, I'm going to take a look at that... –  fdj815 Jan 9 '13 at 9:32

My solution based on the biblatex package looks as follows:

\begin{filecontents}{minimal.bib}
@electronic{electronic1,
author = {A. Author},
title = {Funny website},
urldate = {2013-01-09},
url = {http://www.example.org},
},
@book{book1,
author = {B. Bthor},
title = {A Book of whatever},
date = {2012},
},
@article{article1,
author = {C. Cthor and D. Dthor},
title = {Writing interesting articles},
journaltitle = {The Journal of References},
date = {2010-12-01},
}
\end{filecontents}

\documentclass{book}
\usepackage[
natbib=true,                    % natbib compatibility mode
]{biblatex}
\begin{document}
\nocite{*}
\printbibliography[
nottype = online,               % Put here verything that is NOT of the type "online".
% The "electronic" type is just an alias to "online"
title={Books and Journals},     % title of the subbibliography
heading=subbibliography         % make bibliography go one sectioning level lower
]
\printbibliography[
type=online,                    % Put only references of the type "online" here.
title={Electronic Ressources},

As I have never used LyX I cannot tell how to integrate this into the LyX workflow. But as you told that you managed to create a suitable biblatex style I guess that you already managed to get biblatex working in LyX.