Here's how to do it using biblatex
. (The defernumbers
package option ensures that the numeric labels are assigned according to the order of entries in the bibliographies.)
\documentclass{article}
\usepackage[defernumbers=true]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@book{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo},
location = {Location},
publisher = {Publisher},
}
@article{C03,
author = {Cuthor, C.},
year = {2003},
title = {Charlie},
journaltitle = {Journal title},
volume = {1},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
\printbibliography[type=book,title={Books}]
\printbibliography[type=article,title={Articles}]
\printbibliography[nottype=book,nottype=article,title={Miscellaneous}]
\end{document}
(The filecontents environment is only used to include some external files directly into the example, so that it compiles. It is not necessary for the solution.)
Here is a way to achieve your result. (I had duplicated your references to check whether the sorting and compression works.)
You have to keep in mind that the natbib
package should be commented till you generate O.bbl
and <filename>.bbl
. That is to load the natbib
package once you generate the bbl
files using bibtex
. Otherwise, the \citation
entries will only write to <filename>.aux
and the O.bbl
will generate with no \bibitem{...}
. This will be kept in your mind in later stage when you edit your main.bib
file.
\documentclass{scrbook}
\usepackage{filecontents}
\begin{filecontents}{main.bib}
@ARTICLE{travis,
author = {Brehm, M. and Kirchner, B.},
title = {TRAVIS - A free Analyzer and Visualizer for Monte Carlo and Molecular
Dynamics Trajectories},
journal = {J. Chem. Inf. Model.},
year = {2011},
volume = {51 (8)},
pages = {2007-2023},
owner = {Brehministrator},
timestamp = {2011.11.27}
},
@ARTICLE{travis1,
author = {Brehm, M. and Kirchner, B.},
title = {TRAVIS - A free Analyzer and Visualizer for Monte Carlo and Molecular
Dynamics Trajectories},
journal = {J. Chem. Inf. Model.},
year = {2011},
volume = {51 (8)},
pages = {2007-2023},
owner = {Brehministrator},
timestamp = {2011.11.27}
},
@ARTICLE{travis2,
author = {Brehm, M. and Kirchner, B.},
title = {TRAVIS - A free Analyzer and Visualizer for Monte Carlo and Molecular
Dynamics Trajectories},
journal = {J. Chem. Inf. Model.},
year = {2011},
volume = {51 (8)},
pages = {2007-2023},
owner = {Brehministrator},
timestamp = {2011.11.27}
},
@ARTICLE{travis3,
author = {Brehm, M. and Kirchner, B.},
title = {TRAVIS - A free Analyzer and Visualizer for Monte Carlo and Molecular
Dynamics Trajectories},
journal = {J. Chem. Inf. Model.},
year = {2011},
volume = {51 (8)},
pages = {2007-2023},
owner = {Brehministrator},
timestamp = {2011.11.27}
},
@ARTICLE{welton2001,
author = {L. Cammarata and S. G. Kazarian and P. A. Salter and T. Welton},
title = {Molecular states of water in room temperature ionic liquids},
journal = {Phys. Chem. Chem. Phys.},
year = {2001},
volume = {3},
pages = {5192-5200},
owner = {Brehministrator},
timestamp = {2011.12.11}
}
@ARTICLE{welton20011,
author = {L. Cammarata and S. G. Kazarian and P. A. Salter and T. Welton},
title = {Molecular states of water in room temperature ionic liquids},
journal = {Phys. Chem. Chem. Phys.},
year = {2001},
volume = {3},
pages = {5192-5200},
owner = {Brehministrator},
timestamp = {2011.12.11}
}
@ARTICLE{welton20012,
author = {L. Cammarata and S. G. Kazarian and P. A. Salter and T. Welton},
title = {Molecular states of water in room temperature ionic liquids},
journal = {Phys. Chem. Chem. Phys.},
year = {2001},
volume = {3},
pages = {5192-5200},
owner = {Brehministrator},
timestamp = {2011.12.11}
}
@ARTICLE{welton20013,
author = {L. Cammarata and S. G. Kazarian and P. A. Salter and T. Welton},
title = {Molecular states of water in room temperature ionic liquids},
journal = {Phys. Chem. Chem. Phys.},
year = {2001},
volume = {3},
pages = {5192-5200},
owner = {Brehministrator},
timestamp = {2011.12.11}
}
}
\end{filecontents}
\usepackage[square,sort&compress,super,comma]{natbib} %%Comment on first run
\usepackage[labeled,resetlabels]{multibib}
\newcites{O}{Own Publications}
\makeatletter
\AtBeginDocument{\@ifpackageloaded{natbib}{%
\expandafter\DeclareRobustCommand\csname cite\@suffix\endcsname
{\begingroup\let\NAT@ctype\z@\NAT@partrue\NAT@swatrue
\@ifstar{\NAT@fulltrue\NAT@cites}{\NAT@fullfalse\csname NAT@cites\@suffix\endcsname}}
\expandafter\newcommand\csname NAT@cites\@suffix\endcsname{\@ifnextchar [{\csname NAT@@citetp\@suffix\endcsname}{%
\ifNAT@numbers\else
\NAT@swafalse
\fi
\csname NAT@@citetp\@suffix\endcsname[]}}
\expandafter\newcommand\csname NAT@citetp\@suffix\endcsname{\@ifnextchar[{\csname NAT@@citetp\@suffix\endcsname}{\csname NAT@@citetp\@suffix\endcsname[]}}
\expandafter\newcommand\csname NAT@@citetp\@suffix\endcsname{}
\expandafter\def\csname NAT@@citetp\@suffix\endcsname[#1]{\@ifnextchar[{\csname @citex\@suffix\endcsname[#1]}{\csname @citex\@suffix\endcsname[][#1]}}
\expandafter\newcommand\csname NAT@set@cites\@suffix\endcsname{%
\ifNAT@numbers
\ifNAT@super \let\@cite\NAT@citesuper
\def\NAT@mbox##1{\unskip\nobreak\textsuperscript{##1}}%
\let\citeyearpar=\citeyear
\let\NAT@space\relax
\def\NAT@super@kern{\kern\p@}%
\else
\let\NAT@mbox=\mbox
\let\@cite\NAT@citenum
\let\NAT@space\NAT@spacechar
\let\NAT@super@kern\relax
\fi
\expandafter\let\csname @citex\@suffix\expandafter\endcsname\csname NAT@citexnum\@suffix\endcsname
\let\@biblabel\NAT@biblabelnum
\let\@bibsetup\NAT@bibsetnum
\renewcommand\NAT@idxtxt{\NAT@name\NAT@spacechar\NAT@open\NAT@num\NAT@close}%
\def\natexlab##1{}%
\def\NAT@penalty{\penalty\@m}%
\else
\let\@cite\NAT@cite
\let\@citex\NAT@citex
\let\@biblabel\NAT@biblabel
\let\@bibsetup\NAT@bibsetup
\let\NAT@space\NAT@spacechar
\let\NAT@penalty\@empty
\renewcommand\NAT@idxtxt{\NAT@name\NAT@spacechar\NAT@open\NAT@date\NAT@close}%
\def\natexlab##1{##1}%
\fi}
\expandafter\newcommand\csname NAT@sep\@suffix\endcsname{,\@suffix}
\expandafter\def\csname NAT@separator\@suffix\endcsname{\csname NAT@sep\@suffix\endcsname\NAT@penalty}%
\expandafter\def\csname NAT@def@citea\@suffix\endcsname{\def\@citea{\csname NAT@separator\@suffix\endcsname\NAT@space}}%
\expandafter\def\csname NAT@def@citea@space\@suffix\endcsname{\def\@citea{\csname NAT@separator\@suffix\endcsname\NAT@spacechar}}%
\expandafter\def\csname NAT@def@citea@close\@suffix\endcsname{\def\@citea{\NAT@@close\csname NAT@separator\@suffix\endcsname\NAT@space}}%
\expandafter\def\csname NAT@def@citea@box\@suffix\endcsname{\def\@citea{\NAT@mbox{\NAT@@close}\csname NAT@separator\@suffix\endcsname\NAT@spacechar}}%
\expandafter\def\csname NAT@citexnum\@suffix\endcsname[#1][#2]#3{%
\NAT@reset@parser
\NAT@sort@cites{#3}%
\NAT@reset@citea
\@cite{\def\NAT@num{-1}\let\NAT@last@yr\relax\let\NAT@nm\@empty
\@for\@citeb:=\NAT@cite@list\do
{\@safe@activestrue
\edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
\@safe@activesfalse
\@ifundefined{b@\@citeb\@extra@b@citeb}{%
{\reset@font\bfseries?}
\NAT@citeundefined\PackageWarning{natbib}%
{Citation `\@citeb' on page \thepage \space undefined}}%
{\let\NAT@last@num\NAT@num\let\NAT@last@nm\NAT@nm
\NAT@parse{\@citeb}%
\ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
\let\NAT@name=\NAT@all@names
\global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
\fi
\ifNAT@full\let\NAT@nm\NAT@all@names\else
\let\NAT@nm\NAT@name\fi
\ifNAT@swa
\@ifnum{\NAT@ctype>\@ne}{%
\@citea
\NAT@hyper@{\@ifnum{\NAT@ctype=\tw@}{\NAT@test{\NAT@ctype}}{\NAT@alias}}%
}{%
\@ifnum{\NAT@cmprs>\z@}{%
\NAT@ifcat@num\NAT@num
{\let\NAT@nm=\NAT@num}%
{\def\NAT@nm{-2}}%
\NAT@ifcat@num\NAT@last@num
{\@tempcnta=\NAT@last@num\relax}%
{\@suffix\@tempcnta\m@ne}%
\@ifnum{\NAT@nm=\@tempcnta}{%
\@ifnum{\NAT@merge>\@ne}{}{\NAT@last@yr@mbox}%
}{%
\advance\@tempcnta by\@ne
\@ifnum{\NAT@nm=\@tempcnta}{%
\ifx\NAT@last@yr\relax
\def@NAT@last@yr{\@citea}%
\else
\def@NAT@last@yr{--\NAT@penalty\@suffix}%
\fi
}{%
\NAT@last@yr@mbox
}%
}%
}{%
\@tempswatrue
\@ifnum{\NAT@merge>\@ne}{\@ifnum{\NAT@last@num=\NAT@num\relax}{\@tempswafalse}{}}{}%
\if@tempswa\NAT@citea@mbox\fi
}%
}%
\csname NAT@def@citea\@suffix\endcsname
\else
\ifcase\NAT@ctype
\ifx\NAT@last@nm\NAT@nm \NAT@yrsep\NAT@penalty\NAT@space\else
\@citea \NAT@test{\@ne}\NAT@spacechar\NAT@mbox{\NAT@super@kern\NAT@@open}%
\fi
\if*#1*\else#1\NAT@spacechar\fi
\NAT@mbox{\NAT@hyper@{{\citenumfont{\NAT@num}}}}%
\csname NAT@def@citea@box\@suffix\endcsname
\or
\csname NAT@hyper@citea@space\@suffix\endcsname{\NAT@test{\NAT@ctype}}%
\or
\csname NAT@hyper@citea@space\@suffix\endcsname{\NAT@test{\NAT@ctype}}%
\or
\csname NAT@hyper@citea@space\@suffix\endcsname\NAT@alias
\fi
\fi
}%
}%
\@ifnum{\NAT@cmprs>\z@}{\NAT@last@yr}{}%
\ifNAT@swa\else
\@ifnum{\NAT@ctype=\z@}{%
\if*#2*\else\NAT@cmt#2\fi
}{}%
\NAT@mbox{\NAT@@close}%
\fi
}{#1}{#2}%
}%
\csname NAT@set@cites\@suffix\endcsname
}{}
\def\mycite{\csname cite\@suffix\endcsname}
}%
\makeatother
\begin{document}
\chapter{Introduction}
Citing my own literature\mycite{travis} and\mycite{travis,travis3} and\mycite[p.~1]{travis,travis3,travis2,travis1} and\mycite{travis,travis3,travis1}
Citing other people's literature\cite{welton2001} and\cite{welton2001,welton20013} and\cite[p.~1]{welton2001,welton20013,welton20012,welton20011} and\cite{welton2001,welton20013,welton20011}.
\appendix
\bibliographystyle{plain}
\bibliographystyleO{plain}
\bibliography{main}
\bibliographyO{main}
\end{document}
The macros which are defined between \makeatletter
and \makeatother
are taken from natbib
package.
The output will look like:
Best Answer
I came up with a small set of modifications for a bst file. I only tested it with author-year style, francaissc.bst.
Basically, the
presort
function must be altered.Without entering in too much details about the bst files, there is one thing to understand for making those modifications: the .sort are functions, that must be defined, for example
author.editor.sort
is most likely already defined in an author-year style.Hence, first thing to do is to add those functions:
They are very simple because they rely on stuff already defined in there, mostly the
sort.format.names
function.Then, you must modify the
presort
function itself. Basically, changeauthor
toyear
, but I let be the judge of what you actually want to change. In my case I now have (a commented line is the previous content, with the new one next line):And for an added bonus, with the 'sort' option of the natbib package, the in-text references are now also ordered chronologically, because the main bibliography is.