diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-13 00:08:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-13 00:08:30 +0000 |
commit | 9c2380f55c4f48aeafffc091b5aee38295a12da4 (patch) | |
tree | 4758028c96fd928b7d557b7fd8ab194ae06e713a /Master/texmf-dist/tex/latex/t2/citehack.sty | |
parent | a81f8bb58bc6bf52d25a58b67a4d1ccf5e58d9ea (diff) |
t2
git-svn-id: svn://tug.org/texlive/trunk@1368 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/t2/citehack.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/t2/citehack.sty | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/t2/citehack.sty b/Master/texmf-dist/tex/latex/t2/citehack.sty new file mode 100644 index 00000000000..4e44dc54170 --- /dev/null +++ b/Master/texmf-dist/tex/latex/t2/citehack.sty @@ -0,0 +1,88 @@ +% This is the file citehack.sty of the T2 package. +% +% Allow inputenc-generated characters as references in \cite and \bibitem. +% Also in \label and \ref. + +\ProvidesPackage{citehack} + +\let\org@IeC\IeC +\def\tmp@IeC#1{\string\IeC\space{\string#1 }} + +% This is a modified \@bibitem command; +% we added \let\protect\noexpand, like in \@lbibitem, +% because the item may include, e.g., \IeC {...} +% or some other protected commands. +\def\@bibitem#1{\item\if@filesw {\let\protect\noexpand\immediate\write\@auxout + {\string\bibcite{#1}{\the\value{\@listctr}}}}\fi\ignorespaces} +%\def\@lbibitem[#1]#2{\item[\@biblabel{#1}\hfill]\if@filesw +% {\let\protect\noexpand\let\IeC\tmp@IeC +% \immediate +% \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces} +%\def\@bibitem#1{\item\if@filesw \let\IeC\tmp@IeC\immediate\write\@auxout +% {\string\bibcite{#1}{\the\value{\@listctr}}}\let\IeC\org@IeC\fi\ignorespaces} + +\def\@citex[#1]#2{\let\IeC\tmp@IeC\edef\CH@temp{#2}\let\IeC\org@IeC + \let\@citea\@empty + \@cite{\@for\@citeb:=\CH@temp\do + {\@citea\def\@citea{,\penalty\@m\ }% + \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}% + \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi + \@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}% + \G@refundefinedtrue + \@latex@warning + {Citation `\@citeb' on page \thepage \space undefined}}% + {\hbox{\csname b@\@citeb\endcsname}}}}{#1}} + +\def\nocite#1{\@bsphack + \let\IeC\tmp@IeC\edef\CH@temp{#1}\let\IeC\org@IeC + \@for\@citeb:=\CH@temp\do{% + \edef\@citeb{\expandafter\@firstofone\@citeb}% + \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi + \@ifundefined{b@\@citeb}{\G@refundefinedtrue + \@latex@warning{Citation `\@citeb' undefined}}{}}% + \@esphack} + +\def\@newl@bel#1#2#3{\let\IeC\tmp@IeC + \@ifundefined{#1@#2}% + \relax + {\gdef \@multiplelabels {% + \@latex@warning@no@line{There were multiply-defined labels}}% + \@latex@warning@no@line{Label `#2' multiply defined}}% + \global\@namedef{#1@#2}{#3}\let\IeC\org@IeC} + +% This is a modified \@testdef command taken from Babel: +\def\@testdef #1#2#3{% + \let\IeC\tmp@IeC + \expandafter\let\expandafter\bbl@tempa\csname #1@#2\endcsname + \def\bbl@tempb{#3}% + \ifx\bbl@tempa\relax\else + \edef\bbl@tempa{\expandafter\strip@prefix\meaning\bbl@tempa}\fi + \edef\bbl@tempb{\expandafter\strip@prefix\meaning\bbl@tempb}% + \ifx \bbl@tempa \bbl@tempb + \else \@tempswatrue \fi\let\IeC\org@IeC} + +% \ref, \pageref and \label support: +\DeclareRobustCommand\ref[1]{\let\IeC\tmp@IeC + \expandafter\let\expandafter\CH@temp\csname r@#1\endcsname + \let\IeC\org@IeC\@setref\CH@temp\@firstoftwo{#1}} +\DeclareRobustCommand\pageref[1]{\let\IeC\tmp@IeC + \expandafter\let\expandafter\CH@temp\csname r@#1\endcsname + \let\IeC\org@IeC\@setref\CH@temp\@secondoftwo{#1}} +\def\label#1{\let\IeC\tmp@IeC + \@bsphack\protected@write\@auxout{}{\string\newlabel{#1}{{\@currentlabel}{\thepage}}}\@esphack + \let\IeC\org@IeC} + +% varioref package support: +\def\vref@pagenum#1#2{\let\IeC\tmp@IeC + \@ifundefined{r@#2}{\@namedef{r@#2}{{??}{??}}}{}% + \edef#1{\expandafter\expandafter\expandafter + \@cdr\csname r@#2\endcsname + \@nil}% + \let\IeC\org@IeC} +\def\vrefpagenum#1#2{\let\IeC\tmp@IeC + \@ifundefined{r@#2}% + {\G@refundefinedtrue + \@latex@warning{Reference `#2' on page \thepage \space + undefined}}{}% + \let\IeC\org@IeC + \vref@pagenum{#1}{#2}} |