Of course whatever other solution different from the alias system is
absolutely welcomed.
As often I recommend biblatex
. However the solution below doesn't use biblatex
.
Your example has some errors listed below.
Errors related to multibib
If you define a new bibliography with \newcites{<ext>}{<headind>}
, the new commands \bibliographystyle<ext>
, \bibliography<ext>
and \cite<ext>
will be defined. So in your case the line
\newcites{sec}{Other bibliographic references}
leads to the commands:
\bibliographystylesec
\bibliographysec
and a new file <ext>.aux
will be created. This new file needs his own bibtex run.
Errors related to your bibliography style plainnat
your style writes the following lines to your included bbl
file (included by \bibliography
).
\newcommand{\noopsort}[1]{}
\newcommand{\printfirst}[2]{#1}
\newcommand{\singleletter}[1]{#1}
\newcommand{\switchargs}[2]{#2#1}
You want to have two bibliographies and so the definition of the commands are done twice. This occurs to the error that the commands are defined. One approach would be to set the commands undefined before including the second bibliography.
\bibliographystyle{plainnat}
\bibliography{xampl}
\let\noopsort\undefined
\let\printfirst\undefined
\let\singleletter\undefined
\let\switchargs\undefined
\bibliographystylesec{plainnat}
\bibliographysec{xampl}
the style plainnat
is a numerical citation style. The manual of natbib
provides the following information
By default, natbib is in author–year mode. This can be changed by
- selecting a numerical bibliography style with predefined citation style, defined either in the package or in the local configuration
file;
Errors related to natbib
's \defcitealias
the command \defcitealias
is described in the documentation with the following sentence:
Sometimes one wants to refer to a reference with a special
designation, rather than by the authors
that means your key of \defcitealias
must be a given entry of you bib file. You doesn't show us your bib file so I used the file xampl.bib
which is located in your texmf tree.
the command \defcitealias
makes no differences between the different bibliographies, so you can use it as described in the documentation.
multibib
defines the command \citep<ext>
etc. The defined commands are all listed in the command \@mb@citenamelist
. In the documentation of multibib
you find the following hint:
Packages which define new cite commands can add these commands using
\@mb@citenamelist
. The default definition, which already includes
natbib’s cite variants, is given below.
\def\@mb@citenamelist{cite,citep,citet,citealp,citealt}
You see the commands citepalias
and citetalias
are missed. So before the package multibib
is loaded add the following lines:
\makeatletter
\def\@mb@citenamelist{cite,citep,citet,citealp,citealt,citepalias,citetalias}
\makeatother
Based on the given information here the result as a minimal example with the resulting output. The compilation steps are done by the great tool arara:
% arara: pdflatex
% arara: bibtex : { files :[test , sec] }
% arara: pdflatex
% arara: pdflatex
%: Start Header
\documentclass[a4paper]{article}
\usepackage[numbers]{natbib}
\makeatletter
\def\@mb@citenamelist{cite,citep,citet,citealp,citealt,citepalias,citetalias}
\makeatother
\usepackage{multibib}
\newcites{sec}{Other bibliographic references}
\defcitealias{manual-full}{International journal of logistics, issue 91}
\begin{document}
\cite{article-full}
\citesec{booklet-full}
Something something something and then \citepaliassec{manual-full}.
\bibliographystyle{plainnat}
\bibliography{xampl}
\let\noopsort\undefined
\let\printfirst\undefined
\let\singleletter\undefined
\let\switchargs\undefined
\bibliographystylesec{plainnat}
\bibliographysec{xampl}
\end{document}
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
In general, TeX commands starting with letter cannot contain numbers. Hence in your case it is not the matter of 'natbib
, but
\citeB1and so on. In my example the style
alphasimulates
natbib, as you can expect many problems with using it with
multibib. If you only need citations of the form
(key), it might be a good simulation of
natbib` behaviour.