Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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{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}
- }
- }
- end{filecontents}
- usepackage[square, sort&compress, super, comma]{natbib}
- usepackage[labeled,resetlabels]{multibib}
- newcites{O}{Own Publications}
- begin{document}
- chapter{Introduction}
- Citing my own literatureciteO{travis}.
- Citing other people's literaturecite{welton2001}.
- appendix
- bibliographystyle{plain}
- bibliographystyleO{plain}
- bibliography{main}
- bibliographyO{main}
- end{document}
- 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}{%
- expandafterDeclareRobustCommandcsname cite@suffixendcsname
- {begingroupletNAT@ctypez@NAT@partrueNAT@swatrue
- @ifstar{NAT@fulltrueNAT@cites}{NAT@fullfalsecsname NAT@cites@suffixendcsname}}
- expandafternewcommandcsname NAT@cites@suffixendcsname{@ifnextchar [{csname NAT@@citetp@suffixendcsname}{%
- ifNAT@numberselse
- NAT@swafalse
- fi
- csname NAT@@citetp@suffixendcsname[]}}
- expandafternewcommandcsname NAT@citetp@suffixendcsname{@ifnextchar[{csname NAT@@citetp@suffixendcsname}{csname NAT@@citetp@suffixendcsname[]}}
- expandafternewcommandcsname NAT@@citetp@suffixendcsname{}
- expandafterdefcsname NAT@@citetp@suffixendcsname[#1]{@ifnextchar[{csname @citex@suffixendcsname[#1]}{csname @citex@suffixendcsname[][#1]}}
- expandafternewcommandcsname NAT@set@cites@suffixendcsname{%
- ifNAT@numbers
- ifNAT@super let@citeNAT@citesuper
- defNAT@mbox##1{unskipnobreaktextsuperscript{##1}}%
- letciteyearpar=citeyear
- letNAT@spacerelax
- defNAT@super@kern{kernp@}%
- else
- letNAT@mbox=mbox
- let@citeNAT@citenum
- letNAT@spaceNAT@spacechar
- letNAT@super@kernrelax
- fi
- expandafterletcsname @citex@suffixexpandafterendcsnamecsname NAT@citexnum@suffixendcsname
- let@biblabelNAT@biblabelnum
- let@bibsetupNAT@bibsetnum
- renewcommandNAT@idxtxt{NAT@nameNAT@spacecharNAT@openNAT@numNAT@close}%
- defnatexlab##1{}%
- defNAT@penalty{penalty@m}%
- else
- let@citeNAT@cite
- let@citexNAT@citex
- let@biblabelNAT@biblabel
- let@bibsetupNAT@bibsetup
- letNAT@spaceNAT@spacechar
- letNAT@penalty@empty
- renewcommandNAT@idxtxt{NAT@nameNAT@spacecharNAT@openNAT@dateNAT@close}%
- defnatexlab##1{##1}%
- fi}
- expandafternewcommandcsname NAT@sep@suffixendcsname{,@suffix}
- expandafterdefcsname NAT@separator@suffixendcsname{csname NAT@sep@suffixendcsnameNAT@penalty}%
- expandafterdefcsname NAT@def@citea@suffixendcsname{def@citea{csname NAT@separator@suffixendcsnameNAT@space}}%
- expandafterdefcsname NAT@def@citea@space@suffixendcsname{def@citea{csname NAT@separator@suffixendcsnameNAT@spacechar}}%
- expandafterdefcsname NAT@def@citea@close@suffixendcsname{def@citea{NAT@@closecsname NAT@separator@suffixendcsnameNAT@space}}%
- expandafterdefcsname NAT@def@citea@box@suffixendcsname{def@citea{NAT@mbox{NAT@@close}csname NAT@separator@suffixendcsnameNAT@spacechar}}%
- expandafterdefcsname NAT@citexnum@suffixendcsname[#1][#2]#3{%
- NAT@reset@parser
- NAT@sort@cites{#3}%
- NAT@reset@citea
- @cite{defNAT@num{-1}letNAT@last@yrrelaxletNAT@nm@empty
- @for@citeb:=NAT@cite@listdo
- {@safe@activestrue
- edef@citeb{expandafter@firstofone@citeb@empty}%
- @safe@activesfalse
- @ifundefined{b@@citeb@extra@b@citeb}{%
- {reset@fontbfseries?}
- NAT@citeundefinedPackageWarning{natbib}%
- {Citation `@citeb' on page thepage space undefined}}%
- {letNAT@last@numNAT@numletNAT@last@nmNAT@nm
- NAT@parse{@citeb}%
- ifNAT@longnames@ifundefined{bv@@citeb@extra@b@citeb}{%
- letNAT@name=NAT@all@names
- global@namedef{bv@@citeb@extra@b@citeb}{}}{}%
- fi
- ifNAT@fullletNAT@nmNAT@all@nameselse
- letNAT@nmNAT@namefi
- 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@numNAT@num
- {letNAT@nm=NAT@num}%
- {defNAT@nm{-2}}%
- NAT@ifcat@numNAT@last@num
- {@tempcnta=NAT@last@numrelax}%
- {@suffix@tempcntam@ne}%
- @ifnum{NAT@nm=@tempcnta}{%
- @ifnum{NAT@merge>@ne}{}{NAT@last@yr@mbox}%
- }{%
- advance@tempcnta by@ne
- @ifnum{NAT@nm=@tempcnta}{%
- ifxNAT@last@yrrelax
- 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@numrelax}{@tempswafalse}{}}{}%
- if@tempswaNAT@citea@mboxfi
- }%
- }%
- csname NAT@def@citea@suffixendcsname
- else
- ifcaseNAT@ctype
- ifxNAT@last@nmNAT@nm NAT@yrsepNAT@penaltyNAT@spaceelse
- @citea NAT@test{@ne}NAT@spacecharNAT@mbox{NAT@super@kernNAT@@open}%
- fi
- if*#1*else#1NAT@spacecharfi
- NAT@mbox{NAT@hyper@{{citenumfont{NAT@num}}}}%
- csname NAT@def@citea@box@suffixendcsname
- or
- csname NAT@hyper@citea@space@suffixendcsname{NAT@test{NAT@ctype}}%
- or
- csname NAT@hyper@citea@space@suffixendcsname{NAT@test{NAT@ctype}}%
- or
- csname NAT@hyper@citea@space@suffixendcsnameNAT@alias
- fi
- fi
- }%
- }%
- @ifnum{NAT@cmprs>z@}{NAT@last@yr}{}%
- ifNAT@swaelse
- @ifnum{NAT@ctype=z@}{%
- if*#2*elseNAT@cmt#2fi
- }{}%
- NAT@mbox{NAT@@close}%
- fi
- }{#1}{#2}%
- }%
- csname NAT@set@cites@suffixendcsname
- }{}
- defmycite{csname cite@suffixendcsname}
- }%
- makeatother
- begin{document}
- chapter{Introduction}
- Citing my own literaturemycite{travis} andmycite{travis,travis3} andmycite[p.~1]{travis,travis3,travis2,travis1} andmycite{travis,travis3,travis1}
- Citing other people's literaturecite{welton2001} andcite{welton2001,welton20013} andcite[p.~1]{welton2001,welton20013,welton20012,welton20011} andcite{welton2001,welton20013,welton20011}.
- appendix
- bibliographystyle{plain}
- bibliographystyleO{plain}
- bibliography{main}
- bibliographyO{main}
- end{document}
- usepackage{xparse}
- letoriCiteOciteO
- %% The O{} in this re-definition means "an optional argument
- %% with an empty default value". It is not related to the
- %% "O" prefix in the OP's example.
- RenewDocumentCommand{citeO}{O{} O{} m}{%
- %% The "O" here *is* the prefix as required by the OP's example
- renewcommand{citenumfont}[1]{O##1}%
- oriCiteO[#1][#2]{#3}%
- renewcommand{citenumfont}[1]{##1}%
- }
Add Comment
Please, Sign In to add comment