summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/collref
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-06-11 00:11:01 +0000
committerKarl Berry <karl@freefriends.org>2009-06-11 00:11:01 +0000
commitb5132ffc519f2695644d078951baf6a558eea289 (patch)
treeb32bd083685bf671038814505f7de27549c62252 /Master/texmf-dist/tex/latex/collref
parent7d020dfa7b09d9569405ad925a4e141f0c0f9841 (diff)
new latex package collref
git-svn-id: svn://tug.org/texlive/trunk@13702 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/collref')
-rw-r--r--Master/texmf-dist/tex/latex/collref/collref.sty106
1 files changed, 106 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/collref/collref.sty b/Master/texmf-dist/tex/latex/collref/collref.sty
new file mode 100644
index 00000000000..23e8190f843
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/collref/collref.sty
@@ -0,0 +1,106 @@
+%%
+%% This is file `collref.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% collref.dtx (with options: `package')
+%%
+%% Copyright (C) 2003-2009 Niklas Beisert
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+\NeedsTeXFormat{LaTeX2e}[1996/12/01]
+\ProvidesPackage{collref}[2009/06/09 v1.0 Collect References]
+
+\newcommand{\collectsep}[1]{\def\nc@sep{#1}}
+\newcommand{\nocollect}[1]{\nc@breakbefore{#1}}
+\DeclareOption{nosep}{\collectsep{}}
+\DeclareOption{parsep}{\collectsep{\par}}
+\DeclareOption{bulletsep}{\collectsep{$\bullet$ }}
+\ExecuteOptions{nosep}
+\ProcessOptions
+\newcommand{\nc@getcsname}[1]{\csname #1\endcsname}
+\newcommand{\nc@setcsname}[2]{\expandafter\xdef\csname #1\endcsname{#2}}
+\newcommand{\nc@breakbefore}[1]{%
+ \edef\nc@citepred{\@ifundefined{nc@p@#1}{}{\nc@getcsname{nc@p@#1}}}%
+ \ifx\nc@citepred\@empty\else\nc@setcsname{nc@s@\nc@citepred}{}\fi%
+ \nc@setcsname{nc@p@#1}{}%
+}
+\newcommand{\nc@breakafter}[1]{%
+ \edef\nc@citesucc{\@ifundefined{nc@s@#1}{}{\nc@getcsname{nc@s@#1}}}%
+ \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@citethis{\expandafter\@firstofone\nc@citethis\@empty}%
+ \ifx\nc@citelast\@empty%
+ \nc@breakbefore{\nc@citethis}%
+ \else%
+ \@ifundefined{nc@s@\nc@citelast}%
+ {\nc@setcsname{nc@s@\nc@citelast}{\nc@citethis}}{}%
+ \@ifundefined{nc@p@\nc@citethis}%
+ {\nc@setcsname{nc@p@\nc@citethis}{\nc@citelast}}{}%
+ \edef\nc@citesucc{\nc@getcsname{nc@s@\nc@citelast}}%
+ \edef\nc@citepred{\nc@getcsname{nc@p@\nc@citethis}}%
+ \ifx\nc@citesucc\nc@citethis%
+ \ifx\nc@citepred\nc@citelast%
+ \else%
+ \nc@breakafter{\nc@citelast}%
+ \nc@breakbefore{\nc@citethis}%
+ \fi%
+ \else%
+ \nc@breakafter{\nc@citelast}%
+ \nc@breakbefore{\nc@citethis}%
+ \fi%
+ \fi%
+ {\def\hyper@@link[##1]##2##3##4{##4}%
+ \xdef\nc@citelabel{\nc@getcsname{b@\nc@citethis}}}%
+ \ifx\nc@citelabel\@empty\else%
+ \edef\nc@citestring{\nc@citestring\nc@citecomma\nc@citethis}%
+ \fi%
+ \if@filesw\immediate\write\@auxout{\string\citation{\nc@citethis}}\fi%
+ \edef\nc@citelast{\nc@citethis}%
+ \def\nc@citecomma{,}%
+ }%
+ \nc@breakafter{\nc@citelast}%
+ \nc@old@citex[#1]{\nc@citestring}%
+}
+
+\let\nc@old@thebibliography\thebibliography
+
+\def\thebibliography{%
+ \xdef\nc@biblast{asldjfhasklfh}%
+ \catcode`\^^M=10%
+\nc@old@thebibliography}
+\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%
+ \xdef\nc@biblast{#1}%
+\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%
+ \xdef\nc@biblast{#2}%
+\ignorespaces}
+
+\endinput
+%%
+%% End of file `collref.sty'.