diff options
author | Karl Berry <karl@freefriends.org> | 2009-09-07 23:11:56 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-09-07 23:11:56 +0000 |
commit | 9811e61a31288ae1d73ac3534bd85c911ce81bbc (patch) | |
tree | 741451bf1f70e8a2ae7dc397ccb748befe2212ef /Master/texmf-dist/tex/latex/collref/collref.sty | |
parent | b7d70cabd9d223b8736e0877da5b0b0dbfa7b9bc (diff) |
collref 2.0 (7sep09)
git-svn-id: svn://tug.org/texlive/trunk@15177 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/collref/collref.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/collref/collref.sty | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/collref/collref.sty b/Master/texmf-dist/tex/latex/collref/collref.sty index 23e8190f843..b0e73238523 100644 --- a/Master/texmf-dist/tex/latex/collref/collref.sty +++ b/Master/texmf-dist/tex/latex/collref/collref.sty @@ -17,15 +17,18 @@ %% version 2005/12/01 or later. %% \NeedsTeXFormat{LaTeX2e}[1996/12/01] -\ProvidesPackage{collref}[2009/06/09 v1.0 Collect References] +\ProvidesPackage{collref}[2009/09/07 v2.0 Collect References] + +\newcommand{\collectsep}[2][]{\def\nc@punct{#1}\def\nc@sep{#2}} +\newcommand{\nocollect}[1]{\nc@breakbefore{#1}\ignorespaces} -\newcommand{\collectsep}[1]{\def\nc@sep{#1}} -\newcommand{\nocollect}[1]{\nc@breakbefore{#1}} \DeclareOption{nosep}{\collectsep{}} \DeclareOption{parsep}{\collectsep{\par}} -\DeclareOption{bulletsep}{\collectsep{$\bullet$ }} +\DeclareOption{bulletsep}{\collectsep{\textbullet{} }} +\DeclareOption{punctsep}{\collectsep[.]{; }} \ExecuteOptions{nosep} \ProcessOptions + \newcommand{\nc@getcsname}[1]{\csname #1\endcsname} \newcommand{\nc@setcsname}[2]{\expandafter\xdef\csname #1\endcsname{#2}} \newcommand{\nc@breakbefore}[1]{% @@ -38,13 +41,15 @@ \ifx\nc@citesucc\@empty\else\nc@setcsname{nc@p@\nc@citesucc}{}\fi% \nc@setcsname{nc@s@#1}{}% } + \let\nc@old@citex\@citex \def\@citex[#1]#2{% \let\nc@citecomma\@empty% \let\nc@citestring\@empty% \let\nc@citelast\@empty% - \@for\nc@citethis:=#2\do{% + \edef\nc@citelist{#2}% + \@for\nc@citethis:={\nc@citelist}\do{% \edef\nc@citethis{\expandafter\@firstofone\nc@citethis\@empty}% \ifx\nc@citelast\@empty% \nc@breakbefore{\nc@citethis}% @@ -80,25 +85,37 @@ } \let\nc@old@thebibliography\thebibliography +\let\nc@old@endthebibliography\endthebibliography \def\thebibliography{% \xdef\nc@biblast{asldjfhasklfh}% + \xdef\nc@nextpunct{}% \catcode`\^^M=10% \nc@old@thebibliography} + +\def\endthebibliography{% + \nc@nextpunct% +\nc@old@endthebibliography} + \def\bibitem{\@ifnextchar[\nc@lbibitem\nc@bibitem} \def\nc@noitem#1{% - \nc@sep% \if@filesw\immediate\write\@auxout{\string\bibcite{#1}{}}\fi% \ignorespaces} + \def\nc@bibitem#1{% \edef\nc@bibpred{\@ifundefined{nc@p@#1}{}{\nc@getcsname{nc@p@#1}}}% - \ifx\nc@biblast\nc@bibpred\nc@noitem{#1}\else\@bibitem{#1}\fi% + \ifx\nc@biblast\nc@bibpred\nc@sep\nc@noitem{#1}% + \else\nc@nextpunct\@bibitem{#1}\fi% \xdef\nc@biblast{#1}% + \xdef\nc@nextpunct{\nc@punct}% \ignorespaces} + \def\nc@lbibitem[#1]#2{% \edef\nc@bibpred{\@ifundefined{nc@p@#2}{}{\nc@getcsname{nc@p@#2}}}% - \ifx\nc@biblast\nc@bibpred\nc@noitem{#2}\else\@lbibitem[#1]{#2}\fi% + \ifx\nc@biblast\nc@bibpred\nc@sep\nc@noitem{#2}% + \else\nc@nextpunct\@lbibitem[#1]{#2}\fi% \xdef\nc@biblast{#2}% + \xdef\nc@nextpunct{\nc@punct}% \ignorespaces} \endinput |