From 36d4aa42d015b48d19108d0b983d26cc207ca078 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 12 Jan 2006 23:57:07 +0000 Subject: index git-svn-id: svn://tug.org/texlive/trunk@994 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/index/autind.sty | 80 +++++ Master/texmf-dist/tex/latex/index/bibref.sty | 117 +++++++ Master/texmf-dist/tex/latex/index/index.sty | 435 +++++++++++++++++++++++++++ 3 files changed, 632 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/index/autind.sty create mode 100644 Master/texmf-dist/tex/latex/index/bibref.sty create mode 100644 Master/texmf-dist/tex/latex/index/index.sty (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/index/autind.sty b/Master/texmf-dist/tex/latex/index/autind.sty new file mode 100644 index 00000000000..5e433831aff --- /dev/null +++ b/Master/texmf-dist/tex/latex/index/autind.sty @@ -0,0 +1,80 @@ +%%% ==================================================================== +%%% @LaTeX-style-file{ +%%% filename = "autind.sty", +%%% version = "1.0beta", +%%% date = "28 September 1995", +%%% time = "23:00:49 EDT", +%%% author = "David M. Jones", +%%% address = "MIT Laboratory for Computer Science +%%% Room NE43-316 +%%% 545 Technology Square +%%% Cambridge, MA 02139 +%%% USA", +%%% telephone = "(617) 253-5936", +%%% FAX = "(617) 253-3480", +%%% checksum = "41079 80 198 2750", +%%% email = "dmjones@theory.lcs.mit.edu", +%%% codetable = "ISO/ASCII", +%%% keywords = "", +%%% supported = "yes", +%%% abstract = "", +%%% docstring = "See autind.tex for documentation. +%%% +%%% The checksum field above contains a CRC-16 +%%% checksum as the first value, followed by the +%%% equivalent of the standard UNIX wc (word +%%% count) utility output of lines, words, and +%%% characters. This is produced by Robert +%%% Solovay's checksum utility.", +%%% } +%%% ==================================================================== + +\def\authorindextag{aut} + +\def\authorindex@cite#1{% + \begingroup + \def\do{\index[\authorindextag]}% + \@for\@tempa:=#1\do{% + \csname b@autind@\@tempa\endcsname + }% + \endgroup +} + +\def\authorindexentries#1#2{% + \if@filesw + \def\@tempa{#2}% + \edef\@tempa{% + \write\@auxout{% + \string\bibcite{autind@#1}{\@nearverbatim\@tempa}% + }% + }% + \@tempa + \fi + \begingroup + \def\do{\index[\authorindextag]}% + #2% + \endgroup +} + +\def\adjustcitation#1{% + \edef\@tempa{\string#1}% + \edef\@tempb{% + \let\expandafter\noexpand\csname ord@\@tempa\endcsname\noexpand#1% + \def\noexpand#1{% + \noexpand\@ifnextchar [ + {\expandafter\noexpand\csname a@\@tempa\endcsname} + {\expandafter\noexpand\csname b@\@tempa\endcsname}% + }% + \def\expandafter\noexpand\csname a@\@tempa\endcsname[####1]####2{% + \noexpand\authorindex@cite{####2}% + \expandafter\noexpand\csname ord@\@tempa\endcsname[####1]{####2}% + }% + \def\expandafter\noexpand\csname b@\@tempa\endcsname ####1{% + \noexpand\authorindex@cite{####1}% + \expandafter\noexpand\csname ord@\@tempa\endcsname{####1}% + }% + }% + \@tempb +} + +\endinput diff --git a/Master/texmf-dist/tex/latex/index/bibref.sty b/Master/texmf-dist/tex/latex/index/bibref.sty new file mode 100644 index 00000000000..62b985b18f8 --- /dev/null +++ b/Master/texmf-dist/tex/latex/index/bibref.sty @@ -0,0 +1,117 @@ +%%% ==================================================================== +%%% @LaTeX-style-file{ +%%% filename = "bibref.sty", +%%% version = "1.0beta", +%%% date = "29 September 1995", +%%% time = "14:36:27 EDT", +%%% author = "David M. Jones", +%%% address = "MIT Laboratory for Computer Science +%%% Room NE43-316 +%%% 545 Technology Square +%%% Cambridge, MA 02139 +%%% USA", +%%% telephone = "(617) 253-5936", +%%% FAX = "(617) 253-3480", +%%% checksum = "21394 117 377 3498", +%%% email = "dmjones@theory.lcs.mit.edu", +%%% codetable = "ISO/ASCII", +%%% keywords = "", +%%% supported = "yes", +%%% abstract = "", +%%% docstring = "The checksum field above contains a CRC-16 +%%% checksum as the first value, followed by the +%%% equivalent of the standard UNIX wc (word +%%% count) utility output of lines, words, and +%%% characters. This is produced by Robert +%%% Solovay's checksum utility.", +%%% } +%%% ==================================================================== + +%% This is an experimental package to support back references from +%% reference sections to the pages where individual items are cited. +%% I.e., the reference section would +%% +%% Zofia Adamowicz. A sharp version of the bounded +%% {Matijasevich} conjecture and the end-extension problem. +%% Journal of Symbolic Logic}, 57(2):597--616, June 1992. (pages +%% 1, 3-5, 54) +%% +%% if that item were cited on pages 1, 3, 4, 5 and 54. +%% +%% To use this feature, you'll need to make a small change to your +%% BibTeX bibliography style file. In the standard styles, all that +%% is needed is to modify the function fin.entry as follows: +%% +%% FUNCTION {fin.entry} +%% { add.period$ +%% write$ +%% "\bibref{" cite$ "}" * * write$ % added line +%% newline$ +%% } +%% +%% Then load the bibref package by adding +%% +%% \usepackage{bibref} +%% +%% to your document preamble, and run LaTeX as normal. After running +%% LaTeX, invoke makeindex as follows: +%% +%% makeindex -s bibref.ist -o .bnd .bdx +%% +%% The next time you run LaTeX, the back-references should magically +%% appear. +%% +%% See plaintst.tex and xplain.bst for an example. + +\RequirePackage{index} + +\newindex{@bib}{bdx}{bnd}{} + +\newcommand{\biblabel}[2]{% + \global\@namedef{br@#1}{#2}% +} + +\newcommand{\bibref}[1]{% + \unskip\space + \@ifundefined{br@#1}{% +% (\textbf{??})% + }{% + \edef\reserved@a{\@nameuse{br@#1}}% + \afterassignment\@bibref\count@\reserved@a\relax\@nil + }% +} + +\def\@bibref#1\@nil{% + \if\relax#1% + (page~\reserved@a)% + \else + (pages~\reserved@a)% + \fi +} + +\let\@@cite\cite + +\renewcommand{\cite}[2][]{% + \@for\@citea:=#2\do{% + \edef\reserved@a{% + \noexpand\index[@bib]{\@citea}% + }% + \reserved@a + }% + \def\reserved@a{#1}% + \ifx\reserved@a\@empty + \@@cite{#2}% + \else + \@@cite[#1]{#2}% + \fi +} + +\renewcommand{\bibliography}[1]{% + \if@filesw + \immediate\write\@auxout{\string\bibdata{#1}}% + \fi + \@input@{\jobname.bnd}% + \@input@{\jobname.bbl}% +} + +\endinput diff --git a/Master/texmf-dist/tex/latex/index/index.sty b/Master/texmf-dist/tex/latex/index/index.sty new file mode 100644 index 00000000000..b0cca83e334 --- /dev/null +++ b/Master/texmf-dist/tex/latex/index/index.sty @@ -0,0 +1,435 @@ +%% +%% This is file `index.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% index.dtx (with options: `style') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from index.sty. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file index.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) +%% \CheckSum{755} +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\NeedsTeXFormat{LaTeX2e}[1995/06/01] + +\ProvidesPackage{index}[2004/01/20 v4.2beta Improved index support (dmj)] +\def\disableindex#1{% + \@for\@tempa:=#1\do{% + \@namedef{disable@\@tempa}{}% + \@ifundefined{tf@\@tempa}{}{% + \PackageWarningNoLine{index}{It's too late to disable + the `\@tempa' index;\MessageBreak + \jobname.\@tempa\space has already + been opened for output. You \MessageBreak + should put the \string\disableindex\space command + before\MessageBreak + the declaration of the `\@tempa' index}% + }% + }% +} +\newif\if@newindex + +\def\newindex{% + \@tempswafalse + \@ifnextchar[{\@tempswatrue\x@newindex}{\x@newindex[thepage]}% +} + +\def\x@newindex[#1]{% + \@ifstar {\@tempswafalse\y@newindex{#1}} + {\y@newindex{#1}}% +} + +\def\y@newindex#1#2{% + \@ifundefined{idx@#2}% + {\@newindextrue\def@index{#1}{#2}}% + {% + \@latexerr{Index type `\string#2' already defined}\@ehc + \expandafter\@gobble\@gobbletwo + }% +} + +\def\renewindex{% + \@tempswafalse + \@ifnextchar[{\@tempswatrue\x@renewindex}{\x@renewindex[thepage]}% +} + +\def\x@renewindex[#1]{% + \@ifstar {\@tempswafalse\y@renewindex{#1}} + {\y@renewindex{#1}}% +} + +\def\y@renewindex#1#2{% + \@ifundefined{idx@#2}% + {% + \@newindextrue + \@latexerr{Index type `\string#2' not defined}\@ehc + }% + {\@newindexfalse}% + \def@index{#1}{#2}% +} +\@onlypreamble\newindex +\@onlypreamble\renewindex +\@onlypreamble\disableindex +\def\def@index#1#2#3#4{% + \@namedef{idx@#2}{#3:#4:#1}% + \expandafter\let\csname if@immediate@#2\endcsname\if@tempswa + \if@filesw + \if@newindex + \expandafter\newtoks\csname idxtitle@#2\endcsname + \fi + \@ifundefined{disable@#2}{% + \if@newindex + \expandafter\newwrite\csname tf@#2\endcsname + \else + \immediate\closeout\@nameuse{tf@#2}% + \fi + \immediate\openout\@nameuse{tf@#2}\jobname.#3 % + \PackageInfo{index}{Writing index file \jobname.#3}% + } + {\PackageInfo{index}{Index `#2' disabled -- not opening + \jobname.#3}}% + \fi + \expandafter\csname idxtitle@#2\endcsname +} +\def\@second#1:#2:#3\@nil{#2} + +\def\@third#1:#2:#3\@nil{#3} +\def\@nearverbatim{\expandafter\strip@prefix\meaning} +\edef\makeindex{% + \noexpand\newindex{default}{idx}{ind}{\indexname}% +} +\newif\if@silentindex\@silentindextrue + +\newif\if@addtoindex\@addtoindextrue + +\newif\ifproofmode\proofmodefalse +\def\index{\protect\p@index} + +\def\p@index{% + \if@silentindex\@bsphack\fi + \@ifstar{\@silentindexfalse\@xindex}{\@silentindextrue\@xindex}% +} + +\def\@xindex{\@ifnextchar[{\@index}{\@index[default]}} +\def\@index[#1]{% + \ifx\index\@gobble + \@addtoindexfalse + \fi + \def\@tempf{% + \begingroup + \@sanitize + \@@index{#1}% + }% + \if@addtoindex + \@ifundefined{idx@#1}% + {% + \def\@tempf{% + \@latexerr{Index type `\string#1' undefined}% + \@ehc + \@silentindextrue + \@gobble + }% + }% + {}% + \fi + \@tempf +} + +\def\@@index#1#2{% + \endgroup + \if@addtoindex + \if@filesw\@wrindex{#1}{#2}\fi + \ifproofmode\@showidx{#2}\fi + \fi + \if@silentindex + \expandafter\@esphack + \else + \@silentindextrue#2% + \fi +} + +\def\@wrindex#1#2{% + \begingroup + \def\@tempa{#2}% + \edef\@tempb{\@nameuse{idx@#1}}% + \edef\@tempb{\expandafter\@third\@tempb\@nil}% + \csname if@immediate@#1\endcsname \else + \expandafter\let\csname\@tempb\endcsname\relax + \fi + \edef\@tempa{% + \write\@auxout{% + \string\@writefile{#1}{% + \string\indexentry{\@nearverbatim\@tempa}% + {\@nameuse{\@tempb}}% + }% + }% + }% + \expandafter\endgroup\@tempa + \if@nobreak\ifvmode\nobreak\fi\fi +} +\providecommand{\seename}{see} + +\providecommand*{\see}[2]{\emph{\seename} #1} + +\@ifclassloaded{article}{% + + \renewenvironment{theindex}{% + \edef\indexname{\the\@nameuse{idxtitle@\@indextype}}% + \if@twocolumn + \@restonecolfalse + \else + \@restonecoltrue + \fi + \columnseprule \z@ + \columnsep 35\p@ + \twocolumn[% + \section*{\indexname}% + \ifx\index@prologue\@empty\else + \index@prologue + \bigskip + \fi + ]% + \@mkboth{\MakeUppercase\indexname}% + {\MakeUppercase\indexname}% + \thispagestyle{plain}% + \parindent\z@ + \parskip\z@ \@plus .3\p@\relax + \let\item\@idxitem + }{% + \if@restonecol + \onecolumn + \else + \clearpage + \fi + } +}{% + \renewenvironment{theindex}{% + \edef\indexname{\the\@nameuse{idxtitle@\@indextype}}% + \if@twocolumn + \@restonecolfalse + \else + \@restonecoltrue + \fi + \columnseprule \z@ + \columnsep 35\p@ + \twocolumn[% + \@makeschapterhead{\indexname}% + \ifx\index@prologue\@empty\else + \index@prologue + \bigskip + \fi + ]% + \@mkboth{\MakeUppercase\indexname}% + {\MakeUppercase\indexname}% + \thispagestyle{plain}% + \parindent\z@ + \parskip\z@ \@plus .3\p@\relax + \let\item\@idxitem + }{% + \if@restonecol + \onecolumn + \else + \clearpage + \fi + } +} + +\def\printindex{\@ifnextchar[{\@printindex}{\@printindex[default]}} + +\def\@printindex[#1]{% + \@ifnextchar[{\@print@index[#1]}{\@print@index[#1][]}% +} + +\long\def\@print@index[#1][#2]{% + \def\@indextype{#1}% + \long\def\index@prologue{#2}% + \@ifundefined{idx@#1}% + {\@latexerr{Index type `\string#1' undefined}\@ehc}% + {% + \edef\@tempa{\@nameuse{idx@#1}}% + \edef\@tempa{% + \noexpand\@input@{\jobname.\expandafter\@second\@tempa\@nil}% + }% + \@tempa + }% +} +\def\@indexstar@{\index*} +\def\idx@activehat{% + \relax + \ifmmode\expandafter\sp\else\expandafter\@indexstar@\fi +} + +\def\idx@activebar{% + \relax + \ifmmode\expandafter\sb\else\expandafter\index\fi +} +\newif\if@shortindexing + +\begingroup + + \catcode`\^\active + \catcode`\_\active + + \gdef\shortindexingon{% + \@shortindexingtrue + \chardef\old@idxhatcode\catcode`\^\relax + \chardef\old@idxbarcode\catcode`\_\relax + \catcode`\^\active + \catcode`\_\active + \let\old@idxhat ^% + \let\old@idxbar _% + \let^\idx@activehat + \let_\idx@activebar + } + + \gdef\shortindexingoff{% + \if@shortindexing + \@shortindexingfalse + \let^\old@idxhat + \let_\old@idxbar + \catcode`\^\old@idxhatcode + \catcode`\_\old@idxbarcode + \fi + } + +\endgroup +\newinsert\@indexbox + +\dimen\@indexbox\maxdimen +\begingroup + \catcode`\@\active + \expandafter\gdef\csname\string @sanitizeat\endcsname + {\def @{\char`\@}} +\endgroup +\newtoks\indexproofstyle + +\indexproofstyle{\footnotesize\reset@font\ttfamily} + +\def\@showidx#1{% + \insert\@indexbox{% + \@sanitizeat + \the\indexproofstyle + \hsize\marginparwidth + \hangindent\marginparsep \parindent\z@ + \everypar{}\let\par\@@par \parfillskip\@flushglue + \lineskip\normallineskip + \baselineskip .8\normalbaselineskip\sloppy + \raggedright \leavevmode + \vrule \@height .7\normalbaselineskip \@width \z@\relax#1\relax + \vrule \@height\z@ \@depth.3\normalbaselineskip \@width\z@\relax + }% + \ifhmode\penalty\@M \hskip\z@skip\fi +} + +\def\@leftidx{\hskip-\marginparsep \hskip-\marginparwidth} + +\def\@rightidx{\hskip\columnwidth \hskip\marginparsep} + +\def\@mkidx{% + \vbox to \z@{% + \rlap{% + \if@twocolumn + \if@firstcolumn \@leftidx \else \@rightidx \fi + \else + \if@twoside + \ifodd\c@page \@rightidx \else \@leftidx \fi + \else + \@rightidx + \fi + \fi + \box\@indexbox + }% + \vss + }% +} + +\def\raggedbottom{% + \def\@textbottom{\vskip\z@ plus.0001fil}% + \let\@texttop\@mkidx +} + +\def\flushbottom{\let\@textbottom\relax \let\@texttop\@mkidx} + +\let\@texttop\@mkidx +\CheckCommand\addtocontents[2]{% + \protected@write\@auxout + {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble}% + {\string\@writefile{#1}{#2}}% +} + +\renewcommand{\addtocontents}[2]{% + \protected@write\@auxout + {\let\label\@gobble \let\glossary\@gobble}% + {\string\@writefile{#1}{#2}}% +} +\let\old@starttoc\@starttoc + +\renewcommand{\@starttoc}[1]{% + \begingroup + \@addtoindexfalse + \old@starttoc{#1}% + \endgroup +} +\CheckCommand*{\markboth}[2]{% + \begingroup + \let\label\relax \let\index\relax \let\glossary\relax + \unrestored@protected@xdef\@themark {{#1}{#2}}% + \@temptokena \expandafter{\@themark}% + \mark{\the\@temptokena}% + \endgroup + \if@nobreak\ifvmode\nobreak\fi\fi} +\CheckCommand*{\markright}[1]{% + \begingroup + \let\label\relax \let\index\relax \let\glossary\relax + \expandafter\@markright\@themark {#1}% + \@temptokena \expandafter{\@themark}% + \mark{\the\@temptokena}% + \endgroup + \if@nobreak\ifvmode\nobreak\fi\fi} + +\renewcommand{\markboth}[2]{% + \begingroup + \let\label\relax \let\glossary\relax + \unrestored@protected@xdef\@themark {{#1}{#2}}% + \@temptokena \expandafter{\@themark}% + \mark{\the\@temptokena}% + \endgroup + \if@nobreak\ifvmode\nobreak\fi\fi} + +\renewcommand{\markright}[1]{% + \begingroup + \let\label\relax \let\glossary\relax + \expandafter\@markright\@themark {#1}% + \@temptokena \expandafter{\@themark}% + \mark{\the\@temptokena}% + \endgroup + \if@nobreak\ifvmode\nobreak\fi\fi} +\endinput +%% +%% End of file `index.sty'. -- cgit v1.2.3