From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/crossreference/README | 38 +++++ .../contrib/crossreference/crossreference.dtx | 173 +++++++++++++++++++++ .../contrib/crossreference/crossreference.ins | 23 +++ .../contrib/crossreference/crossreference.pdf | Bin 0 -> 58551 bytes 4 files changed, 234 insertions(+) create mode 100644 macros/latex/contrib/crossreference/README create mode 100644 macros/latex/contrib/crossreference/crossreference.dtx create mode 100644 macros/latex/contrib/crossreference/crossreference.ins create mode 100644 macros/latex/contrib/crossreference/crossreference.pdf (limited to 'macros/latex/contrib/crossreference') diff --git a/macros/latex/contrib/crossreference/README b/macros/latex/contrib/crossreference/README new file mode 100644 index 0000000000..8686863cc8 --- /dev/null +++ b/macros/latex/contrib/crossreference/README @@ -0,0 +1,38 @@ +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. + + +UNPACKING + To unpack the dtx archive use the installation batch file. + + latex crossreference.ins + + This will generate crossreference.sty, crossreference.drv and + xrefexample.tex. + +FILES + crossreference.sty - The packge to use + crossreference.drv - The documentation driver + xrefexample.tex - Example of how to use the package. + +PACKAGE DOCUMENTATION + To generate the package documentation run latex on the + crossreference.dtx file: + + latex crossreference.dtx + + or run latex on the generated driver file: + + latex crossreference.drv + + This will generate the file crossreference.dvi which contains + the documentation. diff --git a/macros/latex/contrib/crossreference/crossreference.dtx b/macros/latex/contrib/crossreference/crossreference.dtx new file mode 100644 index 0000000000..1f786686ac --- /dev/null +++ b/macros/latex/contrib/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/macros/latex/contrib/crossreference/crossreference.ins b/macros/latex/contrib/crossreference/crossreference.ins new file mode 100644 index 0000000000..73ed52b8f1 --- /dev/null +++ b/macros/latex/contrib/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/macros/latex/contrib/crossreference/crossreference.pdf b/macros/latex/contrib/crossreference/crossreference.pdf new file mode 100644 index 0000000000..994dc87301 Binary files /dev/null and b/macros/latex/contrib/crossreference/crossreference.pdf differ -- cgit v1.2.3