From b313f9e3e15c8ccce23ad24e48d5e959c4de96fa Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 11 Jan 2006 23:52:01 +0000 Subject: trunk/Master/texmf-dist/source/latex/crossreference git-svn-id: svn://tug.org/texlive/trunk@205 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/crossreference/crossreference.drv | 36 +++++ .../source/latex/crossreference/crossreference.dtx | 173 +++++++++++++++++++++ .../source/latex/crossreference/crossreference.ins | 23 +++ .../source/latex/crossreference/xrefexample.xref | 3 + 4 files changed, 235 insertions(+) create mode 100644 Master/texmf-dist/source/latex/crossreference/crossreference.drv create mode 100644 Master/texmf-dist/source/latex/crossreference/crossreference.dtx create mode 100644 Master/texmf-dist/source/latex/crossreference/crossreference.ins create mode 100644 Master/texmf-dist/source/latex/crossreference/xrefexample.xref (limited to 'Master/texmf-dist/source/latex/crossreference') diff --git a/Master/texmf-dist/source/latex/crossreference/crossreference.drv b/Master/texmf-dist/source/latex/crossreference/crossreference.drv new file mode 100644 index 00000000000..80725b17fa7 --- /dev/null +++ b/Master/texmf-dist/source/latex/crossreference/crossreference.drv @@ -0,0 +1,36 @@ +%% +%% This is file `crossreference.drv', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% crossreference.dtx (with options: `driver') +%% +%% Crossreferencing for technical documents. +%% +%% Copyright 2001 Vincent Filby (vfilby@acm.org), all rights reserved. +%% +%% This program may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.2 +%% 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.2 or later is part of all distributions of LaTeX +%% version 1999/12/01 or later. +%% +%% This program consists of the files; crossreference.dtx, crossreference.ins +%% and README. +%% +\def\fileversion{1.0} +\def\filedate{2001/05/19} +\def\docdate{2001/05/19} +\documentclass{ltxdoc} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\begin{document} + \DocInput{crossreference.dtx} \PrintIndex \PrintChanges +\end{document} +\endinput +%% +%% End of file `crossreference.drv'. diff --git a/Master/texmf-dist/source/latex/crossreference/crossreference.dtx b/Master/texmf-dist/source/latex/crossreference/crossreference.dtx new file mode 100644 index 00000000000..1f786686ace --- /dev/null +++ b/Master/texmf-dist/source/latex/crossreference/crossreference.dtx @@ -0,0 +1,173 @@ +\def\fileversion{1.0} +\def\filedate{2001/05/19} +\def\docdate{2001/05/19} +% +% \changes{v1.0}{19 May 200}{First Release} +% +% \MakeShortVerb{\|} +% \title{Cross-referencing technical Documents with \texttt{crossreference}} +% \author{Vince Filby} +% \maketitle +% \begin{abstract} +% This is the instruction manual for using +% \texttt{crossreference}. +% \end{abstract} +% +% \section{Introduction} +% This package allows authors to maintain a crossreference section in technical +% documents easily and efficiently without having to worry about reordering, +% removing or otherwise altering the crossreference numbers because they are +% automatically generated. +% +% This package was originally designed to maintain the crossreference section +% of software requirements document and a software design document. +% +% \section{Documentation Driver} +% This code will generate the documentation. Since +% it is the first peice of code in this file, the documentation +% can obtained by simply processing this file with \LaTeXe +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\begin{document} + \DocInput{crossreference.dtx} \PrintIndex \PrintChanges +\end{document} +% +% \end{macrocode} +% \section{User Interface} +% This section defines everything that an average user should know. +% +% \begin{macrocode} +%<*crossreference> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{crossreference}[\filedate\space\fileversion\space +Crossreferencing for technical documents (V. Filby)] +\newcounter{xref} +% \end{macrocode} +% \DescribeMacro{\crossreferences} +% The command|\crossreferences| will print out the crossreference table. +% The format is simple and uses the "list of figures" table of contents style. +% You can change the format of the table by changing this macro. If you +% choose to use a tabular format you will have to change the output lines +% to include \&'s. +% \begin{macrocode} +\newcommand\crossreferences{% + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse + \fi + \@starttoc{xref} + \if@restonecol\twocolumn\fi +} +% \end{macrocode} +% +% \DescribeMacro{\addxref} +% The command |\addxref| will add a a line to the crossreference +% table containing the number, label and section label. +% +% \begin{macrocode} +\newcommand{\addxref}[1]{% + \protected@write{\@auxout}{}{\protect\@writefile{xref}{ + \string\contentsline{figure}{\string\numberline {\thexref}{\string\ignorespaces{#1}}}{\@currentlabel} + }} + \xreflabel{#1} + \stepcounter{xref} +} +% \end{macrocode} +% +% \DescribeMacro{\xref} +% The command |\xref| can be used to refer to an item that has been +% added to the crossreference table. +% \begin{macrocode} +\newcommand{\xref}[1]{~[REF \pageref{#1}]} +% \end{macrocode} +% +% \section{Definitions} +% This section contains the internal counters and macros that are used +% to keep track of the crossreference labels. +% \begin{macrocode} +\def\G@refundefinedtrue{% + \gdef\@refundefined{% + \@latex@warning@no@line{There were undefined references}}} +\let\@refundefined\relax + +\def\@setref#1#2#3{% + \ifx#1\relax + \protect\G@refundefinedtrue + \nfss@text{\reset@font\bfseries ??}% + \@latex@warning{Reference `#3' on page \thepage \space + undefined}% + \else + \expandafter#2#1\null + \fi} + +\def\ref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoftwo{#1}} + +\def\pageref#1{\expandafter\@setref\csname r@#1\endcsname + \@secondoftwo{#1}} +\def\@newl@bel#1#2#3{% + \@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}} + +\def\newlabel{\@newl@bel r} +\@onlypreamble\@newl@bel + +\let \@multiplelabels \relax + +\def\xreflabel#1{\@bsphack + \protected@write\@auxout{}% + {\string\newlabel{#1}{{#1}{\thexref}}}% + \@esphack} + +\def\refstepcounter#1{\stepcounter{#1}% + \protected@edef\@currentlabel + {\csname p@#1\endcsname\csname the#1\endcsname}% +} + +\def\@currentlabel{} +% +% \end{macrocode} +% +% \section{Example Document} +% This is a sample document to show how to use the crossreference system +% when you unpacked the dtx it should have generated this file called +% xrefexample.tex +% \begin{macrocode} +%<*example> +\documentclass{article} + +\usepackage{crossreference} + +\begin{document} + +\section{Animals} +\addxref{Animals} +Animals can eat other animals\xref{Animals} or plants\xref{Plants}. + +\section{Plants} +\addxref{Plants} +Plants are mostly green and are eaten by Animals\xref{Animals}. + +\section{Books and Writings} +\addxref{Books and Writings} +Books and writings are general not read by animals\xref{Animals} or plants\xref{Plants}. + +\section{Humans} +Humans can read books and writings\xref{Books and Writings}. +\newpage +\section{Cross-References} +\crossreferences + +\end{document} +\endinput +% +% \end{macrocode} +% \Finale diff --git a/Master/texmf-dist/source/latex/crossreference/crossreference.ins b/Master/texmf-dist/source/latex/crossreference/crossreference.ins new file mode 100644 index 00000000000..73ed52b8f19 --- /dev/null +++ b/Master/texmf-dist/source/latex/crossreference/crossreference.ins @@ -0,0 +1,23 @@ +\def\batchfile{crossreference.ins} +\input docstrip.tex +\preamble + +Crossreferencing for technical documents. + +Copyright 2001 Vincent Filby (vfilby@acm.org), all rights reserved. + +This program may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.2 +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.2 or later is part of all distributions of LaTeX +version 1999/12/01 or later. + +This program consists of the files; crossreference.dtx, crossreference.ins +and README. + +\endpreamble +\generateFile{crossreference.sty} {t}{\from{crossreference.dtx}{crossreference}} +\generateFile{crossreference.drv} {t}{\from{crossreference.dtx}{driver}} +\generateFile{xrefexample.tex} {t}{\from{crossreference.dtx}{example}} diff --git a/Master/texmf-dist/source/latex/crossreference/xrefexample.xref b/Master/texmf-dist/source/latex/crossreference/xrefexample.xref new file mode 100644 index 00000000000..296e954687b --- /dev/null +++ b/Master/texmf-dist/source/latex/crossreference/xrefexample.xref @@ -0,0 +1,3 @@ + \contentsline {figure}{\numberline {0}{\ignorespaces {Animals}}}{1} + \contentsline {figure}{\numberline {1}{\ignorespaces {Plants}}}{2} + \contentsline {figure}{\numberline {2}{\ignorespaces {Books and Writings}}}{3} -- cgit v1.2.3