summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/rcs-multi
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/rcs-multi
Initial commit
Diffstat (limited to 'macros/latex/contrib/rcs-multi')
-rw-r--r--macros/latex/contrib/rcs-multi/Makefile141
-rw-r--r--macros/latex/contrib/rcs-multi/README59
-rw-r--r--macros/latex/contrib/rcs-multi/example.pdfbin0 -> 57937 bytes
-rw-r--r--macros/latex/contrib/rcs-multi/example.tex162
-rw-r--r--macros/latex/contrib/rcs-multi/rcs-multi.dtx1031
-rw-r--r--macros/latex/contrib/rcs-multi/rcs-multi.ins67
-rw-r--r--macros/latex/contrib/rcs-multi/rcs-multi.pdfbin0 -> 671863 bytes
7 files changed, 1460 insertions, 0 deletions
diff --git a/macros/latex/contrib/rcs-multi/Makefile b/macros/latex/contrib/rcs-multi/Makefile
new file mode 100644
index 0000000000..6bb293819d
--- /dev/null
+++ b/macros/latex/contrib/rcs-multi/Makefile
@@ -0,0 +1,141 @@
+# $Id: Makefile 1452 2009-10-20 14:53:34Z martin $
+
+PACKAGE = rcs-multi
+PACKAGE_STY = ${PACKAGE}.sty
+PACKAGE_DTX = ${PACKAGE}.dtx
+PACKAGE_SCR =
+PACKAGE_DOC = $(PACKAGE_DTX:.dtx=.pdf) example.pdf
+PACKAGE_SRC = ${PACKAGE_DTX} ${PACKAGE}.ins Makefile example.tex
+PACKFILES = ${PACKAGE_SRC} ${PACKAGE_DOC} README
+
+TEXAUX = *.aux *.log *.glo *.ind *.idx *.out *.svn *.svx *.svt *.toc *.ilg *.gls *.hd *.fdb_latexmk
+INSGENERATED = ${PACKAGE_STY}
+GENERATED = ${INSGENERATED} ${PACKAGE}.pdf ${PACKAGE}.zip ${PACKAGE}.tar.gz ${TESTDIR}/test*.pdf
+ZIPFILE = ${PACKAGE}-${ZIPVERSION}.zip
+TDSZIPFILE = ${PACKAGE}-${ZIPVERSION}.tds.zip
+
+TESTDIR = tests
+TESTS = $(patsubst %.tex,%,$(subst ${TESTDIR}/,,$(wildcard ${TESTDIR}/test?.tex ${TESTDIR}/test??.tex))) # look for all test*.tex file names and remove the '.tex'
+TESTARGS = -output-directory ${TESTDIR}
+
+LATEX_OPTIONS = -interaction=batchmode
+LATEX = pdflatex ${LATEX_OPTIONS}
+
+TEXMFDIR = ${HOME}/texmf
+
+RED = \033[01;31m
+GREEN = \033[01;32m
+WHITE = \033[00m
+
+CP = cp -v
+MV = mv -v
+RMDIR = rm -rf
+MKDIR = mkdir -p
+
+.PHONY: all doc package clean fullclean example testclean ${TESTS} tds ${CHECK_LOG}
+
+###############################################################################
+
+all: package doc example
+new: fullclean all
+
+doc: ${PACKAGE_DOC}
+
+package: ${PACKAGE_STY} ${PACKAGE_SCR}
+
+%.pdf: %.dtx
+ ${LATEX} $*.dtx
+ -makeindex -s gind.ist -o $*.ind $*.idx
+ -makeindex -s gglo.ist -o $*.gls $*.glo
+ ${LATEX} $*.dtx
+ ${LATEX} $*.dtx
+
+${PACKAGE}.pdf: ${PACKAGE}.sty
+
+${INSGENERATED}: ${PACKAGE_DTX} ${PACKAGE}.ins
+ yes | latex ${PACKAGE}.ins
+
+clean:
+ rm -f ${TEXAUX} $(addprefix ${TESTDIR}/, ${TEXAUX})
+
+fullclean: clean
+ rm -f ${GENERATED} *~ *.backup
+ rm -f ${PACKAGE}*.zip
+ rm -rf tds/
+
+
+zip: ${PACKFILES}
+ @${MAKE} --no-print-directory ${ZIPFILE}
+
+zip: ZIPVERSION=$(shell grep "Package: ${PACKAGE} " ${PACKAGE}.log | \
+ sed -e "s/.*Package: ${PACKAGE} ....\/..\/..\s\+\(v\S\+\).*/\1/")
+
+tdszip: ZIPVERSION=$(shell grep "Package: ${PACKAGE} " ${PACKAGE}.log | \
+ sed -e "s/.*Package: ${PACKAGE} ....\/..\/..\s\+\(v\S\+\).*/\1/")
+
+${PACKAGE}%.zip: ${PACKFILES}
+ @test -n "${IGNORE_CHECKSUM}" || grep -L '\* Checksum passed \*' ${PACKAGE_DTX:.dtx=.log} | wc -l | grep -q '^0$$'
+ -pdfopt ${PACKAGE}.pdf opt_${PACKAGE}.pdf && mv opt_${PACKAGE}.pdf ${PACKAGE}.pdf
+ ${RM} $@
+ zip $@ ${PACKFILES}
+ @echo
+ @echo "ZIP file $@ created!"
+
+release: fullclean package doc example tests zip
+
+###############################################################################
+
+# Make sure TeX finds the input files in TESTDIR
+tests ${TESTS}: export TEXINPUTS:=${TEXINPUTS}:${TESTDIR}
+tests ${TESTS}: LATEX_OPTIONS=
+
+testclean:
+ @${RM} $(foreach ext, aux log out pdf svn svx, tests/test*.${ext})
+
+tests: package testclean
+ @echo "Running tests: ${TESTS}:"
+ @${MAKE} -e -i --no-print-directory ${TESTS} \
+ TESTARGS="-interaction=batchmode -output-directory=${TESTDIR}"\
+ TESTPLOPT="-q"\
+ > /dev/null
+
+${TESTS}: % : ${TESTDIR}/%.tex package testclean
+ @-${LATEX} -interaction=nonstopmode ${TESTARGS} $< 1>/dev/null 2>/dev/null
+ @if (${LATEX} ${TESTARGS} $< && (test ! -e ${TESTDIR}/$*.pl || ${TESTDIR}/$*.pl ${TESTPLOPT})); \
+ then /bin/echo -e "${GREEN}$@ succeeded${WHITE}" >&2; \
+ else /bin/echo -e "${RED}$@ failed!!!!!!${WHITE}" >&2; fi
+
+###############################################################################
+
+tds: .tds
+
+.tds: ${PACKAGE_STY} ${PACKAGE_DOC} ${PACKAGE_SRC}
+ @grep -q '\* Checksum passed \*' ${PACKAGE}.log
+ ${RMDIR} tds
+ ${MKDIR} tds/
+ ${MKDIR} tds/tex/ tds/tex/latex/ tds/tex/latex/${PACKAGE}/
+ ${MKDIR} tds/doc/ tds/doc/latex/ tds/doc/latex/${PACKAGE}/
+ ${MKDIR} tds/source/ tds/source/latex/ tds/source/latex/${PACKAGE}/
+ -test -n "${PACKAGE_SCR}" && ${MKDIR} tds/scripts/ tds/scripts/${PACKAGE}/
+ ${CP} ${PACKAGE_STY} tds/tex/latex/${PACKAGE}/
+ ${CP} ${PACKAGE_DOC} tds/doc/latex/${PACKAGE}/
+ -${CP} ${PACKAGE_SRC} tds/source/latex/${PACKAGE}/
+ -test -n "${PACKAGE_SCR}" && ${CP} ${PACKAGE_SCR} tds/scripts/${PACKAGE}/
+ @touch $@
+
+tdszip: ${TDSZIPFILE}
+
+${TDSZIPFILE}: .tds
+ ${RM} ${TDSZIPFILE}
+ cd tds && zip -r ../${TDSZIPFILE} .
+
+###############################################################################
+
+install: .tds
+ test -d "${TEXMFDIR}" && ${CP} -a tds/* "${TEXMFDIR}/" && texhash ${TEXMFDIR}
+
+uninstall:
+ test -d "${TEXMFDIR}" && ${RM} -rv "${TEXMFDIR}/tex/latex/${PACKAGE}" \
+ "${TEXMFDIR}/doc/latex/${PACKAGE}" "${TEXMFDIR}/source/latex/${PACKAGE}" \
+ "${TEXMFDIR}/scripts/${PACKAGE}" && texhash ${TEXMFDIR}
+
diff --git a/macros/latex/contrib/rcs-multi/README b/macros/latex/contrib/rcs-multi/README
new file mode 100644
index 0000000000..b7b00f7c56
--- /dev/null
+++ b/macros/latex/contrib/rcs-multi/README
@@ -0,0 +1,59 @@
+--------------------------------------------------------------
+ rcs-multi
+ version 0.1, Mar 23rd, 2009
+--------------------------------------------------------------
+
+This package lets you typeset keywords of the version
+control system RCS inside your LaTeX files anywhere
+you like. Like the very similar package 'svn-multi' the usage of
+multiple files for one LaTeX document is well supported.
+
+Copyright (C) 2009 Martin Scharrer
+E-mail: martin@scharrer-online.de
+WWW: http://www.scharrer-online.de/latex/rcs-multi/
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3c
+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.3c or later is part of all distributions of LaTeX
+version 2008/05/04 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Martin Scharrer.
+
+
+
+Tiny example:
+~~~~~~~~~~~~~
+Put the following RCS keyword at the start of all your LaTeX files of
+your document:
+
+\rcsid{$Id$}
+
+RCS will expand the keyword the next time the files are committed and
+then the RCS information can be typeset using
+ \rcsauthor, \rcsrev, \rcsdate, \rcshour, ...
+which will hold the information of the latest comitted file
+anywhere in your multi-file LaTeX document.
+
+Also per-file macros exist:
+ \rcsfileauthor, \rcsfilerev, ...
+which hold the keyword values of the current file.
+
+
+INSTALL:
+~~~~~~~~
+From the .dtx file (if you don't get the .sty files directly):
+==================
+Unpack the zip file and run 'make'.
+You also can do it manually:
+ [pdf]latex rcs-multi.ins # for the style file and perl script
+ [pdf]latex rcs-multi.dtx # for the documentation
+2x[pdf]latex example-main # for the example
+
+Place the .sty file rcs-multi.sty into your TEXMF tree, e.g. in
+ $TEXMF/tex/latex/rcs-multi
+
diff --git a/macros/latex/contrib/rcs-multi/example.pdf b/macros/latex/contrib/rcs-multi/example.pdf
new file mode 100644
index 0000000000..14ab250ca1
--- /dev/null
+++ b/macros/latex/contrib/rcs-multi/example.pdf
Binary files differ
diff --git a/macros/latex/contrib/rcs-multi/example.tex b/macros/latex/contrib/rcs-multi/example.tex
new file mode 100644
index 0000000000..827d7949b4
--- /dev/null
+++ b/macros/latex/contrib/rcs-multi/example.tex
@@ -0,0 +1,162 @@
+\documentclass[12pt]{report}
+\usepackage{rcs-multi}
+% Version control information:
+\rcsid{$Id: example.tex,v 1.2 2009/03/23 19:07:46 martin Exp martin $}
+% or, alternatively, with full path:
+\rcsid{$Header: /home/martin/src/latex/rcs-multi/dev/example.tex,v 1.2 2009/03/23 19:07:46 martin Exp martin $}
+
+% Other keywords can be read using:
+\rcskwsave{$Author: martin $}
+\rcskwsave{$Date: 2009/03/23 19:07:46 $}
+\rcskwsave{$Name: $}
+% The `Log' keyword is not supported.
+\rcskwsave{$Locker: martin $}
+\rcskwsave{$RCSfile: example.tex,v $}
+\rcskwsave{$Revision: 1.2 $}
+\rcskwsave{$Source: /home/martin/src/latex/rcs-multi/dev/example.tex,v $}
+\rcskwsave{$State: Exp $}
+% Their values can be typeset using \rcskw{Author}, \rcskw{Date}, etc.
+
+\usepackage{hyperref}
+%\usepackage{url}
+
+\usepackage{fancyhdr}
+\renewcommand{\headrulewidth}{0.4pt}
+\renewcommand{\footrulewidth}{0.4pt}
+\setlength{\headheight}{14.5pt}
+% This will display the last changed date and revision of the current chapter.
+% Change to `\rcsdate -- \rcsrev' if you like to have the document revision.
+\newcommand{\rcsfooter}{Last Changed: \rcsfiledate -- r\rcsfilerev}
+
+\pdfinfo{%
+ /CreationDate (D:\rcspdfdate)
+}
+
+\rcsRegisterAuthor{johnd}{John Doe}
+\rcsRegisterAuthor{maryd}{Mary Doe}
+\rcsRegisterAuthor{martin}{Martin S.}
+\rcsRegisterRevision{1.2}{Version~1}
+
+
+%% The two 'filecontents' environments are used to produce two example chapters.
+%% Normally they are separated files from the beginning but they are packed into
+%% this main file to only have one example TeX file in the CTAN ZIP file.
+\begin{filecontents}{example_chap1.tex}
+% Version control information:
+\rcsid{$Header: /home/martin/src/latex/rcs-multi/dev/example_chap1.tex,v 1.3 2009/03/23 19:20:18 martin Exp $}
+
+\chapter{Example Chapter 1}
+
+\section*{Version}
+\subsection*{This chapter}
+% \url is needed because there is an underscore in the name
+% The package 'underscore' seems not to work properly, so the 'hyperref'
+% package is used which is not the best solution. Avoid underscore in LaTeX filenames.
+Filename: \rcsnolinkurl{\rcsfilename}\\*
+URL: \url{\rcsfileurl}\\*
+% Something like \href{\rcskw{HeadURL}}{Download} works also!
+\textbf{Last change}\\*
+Revision: \rcsfilerev\\*
+Date: \rcsfiledate\\*
+Year: \rcsfileyear\\*
+Time: \rcsfilehour:\rcsfileminute:\rcsfilesecond\\*
+Author: \rcsfileauthor\\*
+
+\enlargethispage{\baselineskip}
+\subsection*{Whole document}
+Main Filename: \rcsnolinkurl{\rcsmainfilename}\\*
+Main URL: \url{\rcsmainurl}\\*
+\textbf{Last change}\\*
+Filename: \rcsnolinkurl{\rcsname}\\*
+URL: \url{\rcsurl}\\*
+Revision: \rcsrev\\*
+Date: \rcsdate\\*
+Year: \rcsyear\\*
+Time: \rcshour:\rcsminute:\rcssecond\\*
+Author: \rcsauthor\\*
+% [...]
+
+\section{Tests}
+\rcsRegisterRevision{2.1}{Test}
+
+Registered author name: \rcsFullAuthor{\rcsfileauthor}\\*
+Registered revision name: \rcsFullRevision{\rcsfilerev}\\*
+Registered author name (*): \rcsFullAuthor*{\rcsfileauthor}\\*
+Registered revision name (*): \rcsFullRevision*{\rcsfilerev}\\*
+
+\subsubsection*{Behaviour if value is not registered:}
+Not registered user name: \rcsFullAuthor{someusername}\\*
+Not registered revision name: \rcsFullRevision{1.4}\\*
+Not registered user name (*): \rcsFullAuthor*{someusername}\\*
+Not registered revision name (*): \rcsFullRevision*{1.4}\\*
+
+
+\end{filecontents}
+
+\begin{filecontents}{example_chap2.tex}
+% Version control information:
+\rcsid{$Header: /home/martin/src/latex/rcs-multi/dev/example_chap2.tex,v 1.2 2009/03/23 19:10:56 martin Exp martin $}
+
+\chapter{Example Chapter 2}
+
+\section*{Version}
+\subsection*{This chapter}
+% \url is needed because there is an underscore in the name
+% The package 'underscore' seems not to work properly, so the 'hyperref'
+% package is used which is not the best solution. Avoid underscore in LaTeX filenames.
+Filename: \rcsnolinkurl{\rcsfilename}\\
+URL: \url{\rcsfileurl}\\
+% Something like \href{\rcskw{HeadURL}}{Download} works also!
+\textbf{Last change}\\
+Revision: \rcsfilerev\\
+Date: \rcsfiledate\\
+Year: \rcsfileyear\\
+Time: \rcsfilehour:\rcsfileminute:\rcsfilesecond\\
+Author: \rcsfileauthor\\
+
+\enlargethispage{\baselineskip}
+\subsection*{Whole document}
+Main Filename: \rcsnolinkurl{\rcsmainfilename}\\
+Main URL: \url{\rcsmainurl}\\
+\textbf{Last change}\\
+Filename: \rcsnolinkurl{\rcsname}\\
+URL: \url{\rcsurl}\\
+Revision: \rcsrev\\
+Date: \rcsdate\\
+Year: \rcsyear\\
+Time: \rcshour:\rcsminute:\rcssecond\\
+Author: \rcsauthor
+\end{filecontents}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\listfiles
+\begin{document}
+
+\begin{titlepage}
+ \hbox{}
+ \pdfbookmark{Title Page}{titlepage}
+ \vspace{8ex}
+ {\huge Title\par}
+ \vspace{2ex}
+ {\large \noindent This is an example document for the \texttt{rcs-multi}
+ package. Please also look at the LaTeX source code of this
+ document.}
+ \vfill
+ \flushleft\sffamily
+ Version control information:\\
+ Head Filename: \rcsnolinkurl{\rcsmainfilename}\\
+ Head URL: \rcsnolinkurl{\rcsmainfileurl}\\
+ Last changed file (name): \rcsnolinkurl{\rcsname}\\
+ Last changed file (URL): \rcsnolinkurl{\rcsurl}\\
+ Last changed date: \rcsdate\\
+ Last changes revision: \rcsrev\\
+ Version: \rcsFullRevision*{\rcsrev}\\
+ Last changed by: \rcsFullAuthor*{\rcsauthor}\\
+\end{titlepage}
+
+% Include chapters
+\include{example_chap1}
+\include{example_chap2}
+%\include{example_chap3}
+
+\end{document}
diff --git a/macros/latex/contrib/rcs-multi/rcs-multi.dtx b/macros/latex/contrib/rcs-multi/rcs-multi.dtx
new file mode 100644
index 0000000000..51f709710f
--- /dev/null
+++ b/macros/latex/contrib/rcs-multi/rcs-multi.dtx
@@ -0,0 +1,1031 @@
+% \iffalse meta-comment
+% Copyright (C) 2009 by Martin Scharrer <martin@scharrer-online.de>
+% http://www.scharrer-online.de/latex/
+% -----------------------------------------------------------------
+%
+% 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.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Martin Scharrer.
+%
+% This work consists of the file rcs-multi.dtx and the derived file
+% rcs-multi.sty.
+% $Id: rcs-multi.dtx 2436 2011-04-02 19:11:17Z martin $
+% \fi
+% \iffalse
+%<*package|driver|wrapper>
+\def\filedate$#1: #2 #3 #4-#5-#6 #7 ${%
+ \def\filedate{#4/#5/#6}%
+ \def\filerev{#3}%
+}
+\filedate$Id: rcs-multi.dtx 2436 2011-04-02 19:11:17Z martin $
+\def\fileversion{v0.1a}
+%</package|driver|wrapper>
+%<*driver>
+\ProvidesFile{rcs-multi.dtx}
+ [\filedate\space\fileversion\space RCS Keywords for multi-file LaTeX documents]
+
+\documentclass{ydoc}
+\usepackage{rcs-multi}
+\usepackage{xspace}
+\newcommand{\ie}{i.e.\@\xspace}
+\newcommand{\eg}{e.g.\@\xspace}
+
+\def\karg#1{\texttt{\$#1\$}}
+\def\kmarg#1{\texttt{\$}\meta{#1}\texttt{\$}}
+\def\rcsmulti{\pkg{rcsmulti}\xspace}
+
+\let\csi\cs
+\def\cs#1{\Macro{#1}\relax}
+
+\usepackage{graphicx}
+
+\EnableCrossrefs
+%\DisableCrossrefs
+\CodelineIndex
+%\PageIndex
+\RecordChanges
+%\OnlyDescription
+\begin{document}
+ \DocInput{rcs-multi.dtx}%
+ \PrintChanges
+ %\clearpage
+ \PrintIndex
+\end{document}
+%</driver>
+%<*package>
+% \fi
+%
+% \CheckSum{616}
+%
+% {\makeatother
+% \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 \~}
+% }
+% \changes{v0.1}{2009/03/23}{Initial version forked from rcs-multi v2.0}
+%
+% ^^A \GetFileInfo{rcs-multi.dtx}
+%
+% \DoNotIndex{\newcommand,\newenvironment,\AtBeginDocument,\AtEndDocument}
+% \DoNotIndex{\def,\let,\edef,\xdef,\item,\space,\write,\jobname,\relax,\!}
+% \DoNotIndex{\closeout,\csname,\DeclareRobustCommand,\else,\empty,\newwrite}
+% \DoNotIndex{\endcsname,\expandafter,\fi,\Hurl,\hyper@normalise,\@ifnextchar}
+% \DoNotIndex{\ifnum,\@ifundefined,\ifx,\immediate,\InputIfFileExists,\ }
+% \DoNotIndex{\newcount,\noexpand,\openout,\PackageWarning,\@percentchar}
+% \DoNotIndex{\@sanitize,\@makeother,\@iwrcs,\%,\_,\&,\^,\$,\#,\ ,\\,\if@filesw}
+% \DoNotIndex{\gdef,\begingroup,\endgroup,\catcode}
+% \DoNotIndex{\^,\ ,\_,\(,\),\$,\&,\#,\@ampersamchar,\AtEndOfPackage}
+% \DoNotIndex{\@backslashchar,\begin,\bgroup,\chapter,\day}
+% \DoNotIndex{\DeclareOption,\do,\dospecials,\@dottedtocline,\egroup}
+% \DoNotIndex{\end,\ExecuteOptions,\filedate,\fileversion,\@for}
+% \DoNotIndex{\futurelet,\g@addto@macro,\global,\@gobbletwo,\hline}
+% \DoNotIndex{\hspace,\if@restonecol,\if@twocolumn,\ignorespaces}
+% \DoNotIndex{\makeatletter,\MakeUppercase,\@mkboth,\month,\@namedef}
+% \DoNotIndex{\NeedsTeXFormat,\newif,\onecolumn,\orig@fink@prepare}
+% \DoNotIndex{\orig@fink@restore,\PackageError,\ProcessOptions}
+% \DoNotIndex{\ProvidesPackage,\renewcommand,\RequirePackage}
+% \DoNotIndex{\@restonecolfalse,\@restonecoltrue,\section,\strut}
+% \DoNotIndex{\tableofcontents,\tableofrevisions,\texttt,\today}
+% \DoNotIndex{\twocolumn,\@undefined,\url,\year}
+% \DoNotIndex{\textwidth,\the,\string,\raggedright,\providecommand,\small,\toks@}
+% \DoNotIndex{\medskipamount,\long,\leftskip,\clearpage,\advance,\addtolength}
+% \DoNotIndex{\DeclareBoolOption,\DeclareStringOption,\DeclareVoidOption}
+% \DoNotIndex{\ProcessKeyvalOptions,\SetupKeyvalOptions}
+% \DoNotIndex{\@firstoftwo,\@secondoftwo,\@gobble}
+%
+% \author{Martin Scharrer}
+% \email{martin@scharrer-online.de}
+% \maketitle
+%
+% \section{Introduction}
+% This package allows to typeset version control (VC) information provided by
+% RCS\footnote{RCS homepage: \url{http://www.gnu.org/software/rcs/}} keywords
+% (\eg |$||Id: ... $|) in \LaTeX\ documents which can contain of multiple |.tex|
+% files included using |\include| or |\input|. It is based on the
+% \pkg{svn-multi} which macros have been renamed and modified to support RCS.
+%
+% This package reads the keywords of all files and provides the VC information
+% of of the most recent changed file of the document to the user through a set
+% of macros. This information is written to the auxiliary |.aux| file during the
+% first \LaTeX\ run and read back at the next which introduces the same delay
+% known from the table of contents. The standard \LaTeX{} switch |\nofiles| can
+% be used to suppress the file generation.
+%
+% \subsection{Scope of Keywords}
+% This package provides the RCS keyword data in two different scopes:
+% document-global and file-local.
+%
+% \subsubsection*{Document Global}
+% The document global macros, like \cs{rcsrev}, return the latest version
+% control information (keyword data) for the whole multi-file document, \ie the
+% information of the latest changed file of the document. To collect, sort and
+% provide this information is the main functionality of this package.
+%
+% \subsubsection*{Local to Current File}
+% There are also file-local macros, \eg \cs{rcsfilerev}, which return the
+% version control information of the current file, \ie the file they are used
+% in. It is assumed here that every file using this macros calls first the macro
+% \cs{rcsid}. See section~\ref{sec:usage:id} for more details about this macro.
+% Please note that the file-local macros technically actually return the
+% \emph{last registered} information from the last \cs{rcsid}.
+%
+%
+% \section{Usage}
+% The version control information are provided by RCS keywords which
+% first need to be read in by dedicated macros and can then be typeset using
+% different macros.
+%
+% \subsection{Including RCS Keywords}\label{sec:usage:id}
+% RCS keywords are included using \cs{rcsid}. This macro should be written very
+% early in each file, \ie in the preamble of the main document soon after
+% |\documentclass| and |\usepackage{rcs-multi}| and as first in \emph{every}
+% subfile before an |\chapter| or similar macro. It does not create any output.
+% See section~\ref{sec:kwaccess} to learn how to typeset the keyword values.
+%
+% \DescribeMacro{rcsid}{\karg{Id}}
+% \DescribeMacro{rcsid}{\karg{Header}}
+% The macro is for the |Id| keyword and must be written like shown. A trailing
+% colon with or without spaces after the keyword name (`|Id|') is also valid but
+% \textbf{everything else} except a valid RCS string will cause a \TeX{} parse
+% error. The difference between |Id| and |Header| is that the latter includes
+% the full URL/path and not only the filename.
+%
+% \DescribeMacro{rcs}{\kmarg{keyword}}
+% This macro let you typeset rcs keywords directly. The dollars will be stripped
+% and the rest is typeset as normal text.
+%
+% \DescribeMacro{rcskwsave}{\kmarg{keyword}}
+% This macro lets you include and save any keyword you like. The keyword can be
+% already expanded or not (no value and only ``|:|'' or nothing after the key
+% name). This macro is also used internally and does not create any output.
+% Please note that the argument is read verbatim and that there should be no
+% space between the macro and the argument's left brace.
+%
+%
+% \subsection{Typesetting the Keyword Values}\label{sec:kwaccess}
+% The following macros can be used to typeset the keyword values anywhere in the
+% document. Please note that not all \LaTeX{} fonts have all special
+% characters, \eg `|_|' is not provided in the standard roman font. To proper
+% typeset file names and URLs containing these letters you can use either
+% teletype font (|\texttt|) or use |{\urlstyle{rm}\rcsnolinkurl{...}}| which
+% requires the \pkg{hyperref} package.
+%
+% \DescribeMacro{rcsrev}
+% \DescribeMacro{rcsdate}
+% \DescribeMacro{rcsauthor}
+% These macros hold the keyword values of the whole document, \ie of the most
+% recent revision. They can be used everywhere in every file of the \LaTeX{}
+% document, after |\usepackage{rcs-multi}| of course. Please see
+% section~\ref{sec:date} how to typeset parts of the date.
+%
+% \DescribeMacro{rcsfilerev}
+% \DescribeMacro{rcsfiledate}
+% \DescribeMacro{rcsfileauthor}
+% These macros hold the keyword values of the current \LaTeX{} file, but only if
+% it contains a \cs{rcsid} or \cs{rcsidlong} macro. Otherwise the macros hold
+% either zero values or the values of the last file dependent on whether an
+% option is enabled which enabled the \pkg{fink} package. Please see
+% section~\ref{sec:date} how to typeset parts of the date. See \cs{rcskw} below
+% for all other keywords.
+%
+% \DescribeMacro{rcsmainfilename}
+% The macro \cs{rcsmainfilename} hold the filename of the main \LaTeX{file}.
+% It can be used to typeset this information anywhere in the document which
+% might be more descriptive as the name of the current file (which can be
+% typeset with \cs{rcskw}|{HeadURL}| or \cs{rcskw}|{Filename}| after \cs{rcsid}
+% or \cs{rcsidlong}, respectively). ^^A TODO: Change to correct names!
+%
+% \DescribeMacro{rcssetmainfile}
+% This will declare the current file as the main LaTeX file by defining the
+% above macros. It will automatically be called at the end of the preamble so
+% the user normally doesn't have to use it by him- or herself as long it isn't
+% needed in the preamble.\par Please note that this macro changes the definition
+% of \cs{rcsmainfilename} directly without going over the auxiliary file.
+% Calling it in several files will make this two macros inconsistent.
+%
+% \DescribeMacro{rcskw}{<keyword name>}
+% All keywords saved with \cs{rcsid} or \cs{rcskwsave} can be typeset by this
+% macro which is a holdover from a very early version of this
+% package when multiple files where not supported. It takes one argument which
+% must be a RCS keyword name. It then returns the current value of this
+% keyword or nothing (|\relax|) when the keyword was not set yet.
+% Examples:\\
+% \indent\indent |\textsl{Revision: \rcskw{Revision}}|\\
+% \indent\indent |URL: \url{\rcskw{HeadURL}}|\\ ^^A TODO: Change name!
+% In the second example |\url| (\pkg{hyperref} package) is used to add a hyperlink
+% and to avoid problems with underscores (|_|) inside the URL. \rcsmulti is
+% also providing a macro \cs{rcsnolinkurl} which works like |\url| but doesn't
+% adds an hyperlink. See the description of this macro for more details.
+%
+% If the given keyword doesn't exists a package warning is given to allow
+% spelling errors to be tracked down. This doesn't work well when \cs{rcskw} is
+% used inside |\url|. In this case the warning code will be typeset(!) verbatim
+% into the document by |\url|.
+%
+% \DescribeMacro{rcskwdef}{<keyword name>}{<value>}
+% This macro is used to define the keyword values. This is normally only called
+% internally but could be used by the user to override single keywords. The
+% values can then be typeset by \cs{rcskw}. Note that this macro has no
+% influence on the calculation of the latest revision.
+%
+% \subsection{Accessing Date Values}\label{sec:date}
+% \begin{DescribeMacrosTab}{ll}
+% \Macro{rcsyear} & \Macro{rcsfileyear} \\
+% \Macro{rcsmonth} & \Macro{rcsfilemonth} \\
+% \Macro{rcsday} & \Macro{rcsfileday} \\
+% \Macro{rcshour} & \Macro{rcsfilehour} \\
+% \Macro{rcsminute} & \Macro{rcsfileminute} \\
+% \Macro{rcssecond} & \Macro{rcsfilesecond} \\
+% \end{DescribeMacrosTab}
+% Whenever the date information is read, \ie by
+% \cs{rcskwsave}|{Date}| or \cs{rcsid}, the following macros are set to the
+% appropriate date parts for the
+% current file (the |\rcsfile...| versions) and for the whole document.
+%
+%
+% \DescribeMacro{rcstime}
+% \DescribeMacro{rcsfiletime}
+% This macros return the time part of the date only and simply return the
+% corresponding hour, minute and second macros with a colon as separator.
+%
+% \DescribeMacro{rcspdfdate}
+% Returns the last changed date of the whole document in a format needed for
+% |\pdfinfo|. Can be used like this:\\
+% \hbox{}\hfill|\pdfinfo{ /CreationDate (D:\rcspdfdate) }|\hfill\hbox{}\\
+% to set the PDF creation date to the last changed date if you use |pdflatex| to
+% compile your \LaTeX{} document.
+%
+% \DescribeMacro{rcstoday}
+% \DescribeMacro{rcsfiletoday}
+% These macros typeset the document-global or current-file, respectively, using
+% the format of |\today| which depends on the used language.
+% To adjust the language of your document use the \pkg{babel} package.
+%
+% \subsection{Using Full Author Names}
+% If you like to have the full author\footnote{This means RCS authors,
+% \eg the persons who commit changes into the rcs repository.} names, not only
+% the usernames, in your document you can use the following macros. First you
+% have to register all authors of the document with \cs{rcsRegisterAuthor} and
+% then you can write \eg |\rcsFullAuthor{\rcsauthor}| or
+% |\rcsFullAuthor{\rcsfileauthor}|.
+%
+% \DescribeMacro{rcsRegisterAuthor}{<author>}{<full name>}
+% This macro registers \meta{full name} as full name for \meta{author} (a
+% RCS username) for later use with \cs{rcsFullAuthor}.
+%
+% \DescribeMacro{rcsFullAuthor}{<author name or macror>}
+% \DescribeMacro{rcsFullAuthor*}{<author name or macro>}
+% Takes the username as argument and returns the full name if it was registered
+% first with \Macro\rcsRegisterAuthor, otherwise it returns the given username.
+% The star version returns the username in parentheses after the full name.
+% This is normally used in one of the following forms:
+% \begin{macroquote}
+% \rcsFullAuthor{\AlsoMacro\rcsauthor} \\
+% \rcsFullAuthor{\AlsoMacro\rcsfileauthor}
+% \end{macroquote}
+%
+% \subsection{Using Full Revision Names}
+% Like the author's also revision names/tags can be registered and used later.
+% These macros were implemented on user request and have the drawback that you
+% have to guess the next revision number of your document in order to get
+% correct results when you like to tag the to-be-checked-in revision. Please
+% note that this has nothing to do with the normal tagging.
+%
+% \DescribeMacro{rcsRegisterRevision}{<revision number>}{<tag name>}
+% This registers \meta{tag name} as tag name for \meta{revision number} for
+% later use with \cs{rcsFullRevision}.
+%
+% \DescribeMacro{rcsFullRevision}{<revision number or macro>}
+% \DescribeMacro{rcsFullRevision*}{<revision number or macro>}
+% Takes a revision number coming from a macro like \cs{rcsrev}, \cs{rcsfilerev}
+% or a number as argument and returns the full name if it was registered first
+% with \cs{rcsRegisterRevision}, otherwise it returns ``Revision \meta{revision
+% number}''. The star version returns also the revision number leaded by `r' in
+% parentheses after the tag name, \eg |Name (1.2)|.
+%
+% \subsection{Verbatim URLs with and without Hyperlinks}
+% \DescribeMacro{rcsnolinkurl}{<macro with returns special text>}
+% This macro allows you to write |\rcsnolinkurl{\rcskw{HeadURL}}| and get the
+% Head URL typeset verbatim. However |\url{|\cs{rcskw}|{HeadURL}}|
+% (\pkg{hyperref} package) gives you the same result with a hyperlink. Both
+% macros require the \pkg{hyperref} package which is not automatically loaded by
+% \rcsmulti. Please load it manually when you like to use \cs{rcsnolinkurl}.
+%
+% Please note that you can't use \pkg{hyperref}'s |\nolinkurl| because it won't
+% expand \cs{rcskw}.
+%
+% \StopEventually{}
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \clearpage
+% \section{Implementation}
+% \subsection{Package Header}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{rcs-multi}
+ [\filedate\space\fileversion\space RCS Keywords for multi-file LaTeX documents]
+% \end{macrocode}
+
+% \subsection{General Internal Macros}
+% Some internal used macro which don't fit in any other section.
+%
+% \begin{macro}{\rcs@ifempty}[1]{string}
+% Tests if the given argument is empty. If so the first of the next two token
+% will be expanded, the second one otherwise.
+% \begin{macrocode}
+\def\rcs@ifempty#1{%
+ \begingroup
+ \edef\rcs@temp{#1}%
+ \ifx\rcs@temp\empty
+ \endgroup
+ \expandafter
+ \@firstoftwo
+ \else
+ \endgroup
+ \expandafter
+ \@secondoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcs@ifequal}[2]{string a}{string b}
+% Tests if the given arguments are identical, \eg same strings. If so the first
+% of the next two token will be expanded, the second one otherwise.
+% \begin{macrocode}
+\def\rcs@ifequal#1#2{%
+ \begingroup
+ \edef\rcs@stringa{#1}%
+ \edef\rcs@stringb{#2}%
+ \ifx\rcs@stringa\rcs@stringb
+ \endgroup
+ \expandafter
+ \@firstoftwo
+ \else
+ \endgroup
+ \expandafter
+ \@secondoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcs@ifvalidrev}[1]{macro name}
+% Checks if the given macro (by name) is a valid revision, \ie defined and
+% greater than zero.
+% \begin{macrocode}
+\def\rcs@ifvalidrev#1{%
+ \begingroup
+ \@ifundefined{#1}%
+ {\def\rcs@temp{-1}}%
+ {\expandafter\edef
+ \expandafter\rcs@temp\expandafter{\csname #1\endcsname}}%
+ \ifnum\rcs@temp>-1\relax
+ \endgroup
+ \expandafter
+ \@firstoftwo
+ \else
+ \endgroup
+ \expandafter
+ \@secondoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+
+% \subsection{Definition of init values}
+% \begin{macrocode}
+% Init values
+\def\rcsrev{0.0} \def\@rcs@rev{0.0}
+\def\rcsdate{} \def\@rcs@date{}
+\def\rcsauthor{} \def\@rcs@author{}
+\def\rcsyear{0000} \def\@rcs@year{0000}
+\def\rcsmonth{00} \def\@rcs@month{00}
+\def\rcsday{00} \def\@rcs@day{00}
+\def\rcshour{00} \def\@rcs@hour{00}
+\def\rcsminute{00} \def\@rcs@minute{00}
+\def\rcssecond{00} \def\@rcs@second{00}
+\def\rcsname{} \def\@rcs@name{}
+\def\rcsurl{} \def\@rcs@url{}
+\def\rcsmainfilename{}
+\def\rcsmainurl{\rcsmainfilename}
+\def\rcs@temp{}
+\def\rcs@lastkw{}
+
+\def\rcsfilerev{0.0}
+\def\rcsfiledate{}
+\def\rcsfileauthor{}
+\def\rcsfileyear{0000}
+\def\rcsfilemonth{00}
+\def\rcsfileday{00}
+\def\rcsfilehour{00}
+\def\rcsfileminute{00}
+\def\rcsfilesecond{00}
+\def\rcsfileurl{}
+\def\rcsfilename{}
+% \end{macrocode}
+%
+
+% \subsection{Time and \textit{Today} macros}
+%
+% \begin{macro}{\rcstime}
+% \begin{macro}{\rcsfiletime}
+% This macros simple use the hour, minute and second macros.
+% \begin{macrocode}
+\def\rcstime{\rcshour:\rcsminute:\rcssecond}
+\def\rcsfiletime{\rcsfilehour:\rcsfileminute:\rcsfilesecond}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+
+% These macros use the |\today| macro to typeset the current date using the
+% local language settings. Thanks and credit goes to Manuel P\'egouri\'e-Gonnard
+% for suggesting this feature and for providing some code.
+% \begin{macro}{\rcstoday}
+% \begin{macrocode}
+\newcommand*{\rcstoday}{%
+ \begingroup
+ \year\rcsyear \month\rcsmonth \day\rcsday
+ \relax \today
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\rcsfiletoday}
+% \begin{macrocode}
+\newcommand*{\rcsfiletoday}{%
+ \begingroup
+ \year\rcsfileyear \month\rcsfilemonth \day\rcsfileday
+ \relax \today
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+
+% \subsection{Id macro}
+% \begin{macro}{\rcsid}
+% Calls \cs{rcskwsave} with |\@rcsidswtrue| so that the Id keyword will be
+% parsed at the end of \cs{rcskwsave}.
+% \begin{macrocode}
+\newcommand*{\rcsid}{%
+ \@rcsidswtrue
+ \rcskwsave
+}
+\newif\if@rcsidsw
+\@rcsidswfalse
+% \end{macrocode}
+% \end{macro}
+%
+
+% \begin{macro}{\rcs@scanId}[6]{file name}{revision}{date (YYYY-MM-DD)}{time
+% (HH:MM:SS)}{author (username)}{rest}
+% Scans rcs Id (after it got parsed by \cs{rcskwsave}). Awaits only Id value
+% without leading `|Id:|' and a trailing |\relax| as end marker. It calls
+% \cs{@rcs@scandate} to extract the date information and \cs{@rcs@updateid} to
+% update global Id values and also sets the appropriate keywords.
+% \begin{macrocode}
+\def\rcs@scanId#1,v #2 #3 #4 #5 #6\relax{%
+ \@rcs@scandate{#3 #4}%
+ \@rcs@updateid{#2}{#3 #4}{#5}{#1}%
+ \rcskwdef{Filename}{#1}%
+ \rcskwdef{Date}{#3 #4}%
+ \rcskwdef{Revision}{#2}%
+ \rcskwdef{Author}{#5}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+
+% \begin{macro}{\@rcs@updateid}[4]{rev}{date}{author (username)}{url}
+% We first define the expanded arguments to variables for the user. The
+% expansion is needed because the arguments content is mostly generic like
+% |\rcs@value| which can change very soon after this macro.
+% \begin{macrocode}
+\def\@rcs@updateid#1#2#3#4{%
+ \xdef\rcsfilerev{#1}%
+ \xdef\rcsfiledate{#2}%
+ \xdef\rcsfileauthor{#3}%
+ \xdef\rcsfileurl{#4}%
+ \rcs@getfilename\rcsfileurl
+% \end{macrocode}
+% Then we check if the revision is non-empty (not yet expanded by RCS?)
+% and larger then the current maximum value |\@rcs@rev|. If yes we save all
+% value to save them in the .aux-file later.
+% \begin{macrocode}
+ \ifx\rcsfiledate\empty\else
+ \begingroup
+ \edef\@tempa{\@rcs@year\@rcs@month\@rcs@day}
+ \edef\@tempb{\rcsfileyear\rcsfilemonth\rcsfileday}
+ \ifnum\@tempa<\@tempb
+ \rcs@update
+ \else\ifnum\@tempa=\@tempb
+ \edef\@tempa{\@rcs@hour\@rcs@minute\@rcs@second}
+ \edef\@tempb{\rcsfilehour\rcsfileminute\rcsfilesecond}
+ \ifnum\@tempa<\@tempb
+ \rcs@update
+ \fi
+ \fi\fi
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+
+% \begin{macro}{\rcs@updateid}
+% Updates the max-hold macros with the values of the current file VC
+% information.
+% \begin{macrocode}
+\def\rcs@update{%
+ \xdef\@rcs@rev{\rcsfilerev}%
+ \xdef\@rcs@date{\rcsfiledate}%
+ \xdef\@rcs@author{\rcsfileauthor}%
+ \xdef\@rcs@year{\rcsfileyear}%
+ \xdef\@rcs@month{\rcsfilemonth}%
+ \xdef\@rcs@day{\rcsfileday}%
+ \xdef\@rcs@hour{\rcsfilehour}%
+ \xdef\@rcs@minute{\rcsfileminute}%
+ \xdef\@rcs@second{\rcsfilesecond}%
+ \xdef\@rcs@name{\rcsfilename}%
+ \xdef\@rcs@url{\rcsfileurl}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+
+% \begin{macro}{\rcs@catcodes}
+% Changes all \TeX-special character to category ``other''. The newline aka
+% return is changed to category ``ignore'' so line breaks are not taken as part
+% of the verbatim arguments.
+% \begin{macrocode}
+\def\rcs@catcodes{%
+ \let\do\@makeother
+ \dospecials
+ \catcode`\^^M9
+ \catcode`\ 10
+ \catcode`\{1
+ \catcode`\}2
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcs@gdefverb}[1]{macro}
+% \begin{macrocode}
+\def\rcs@gdefverb#1{%
+ \begingroup
+ \def\rcs@temp{#1}%
+ \begingroup
+ \rcs@catcodes
+ \rcs@gdefverb@
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcs@defverb@}[1]{verbatim stuff}
+% \begin{macrocode}
+\def\rcs@gdefverb@#1{%
+ \endgroup
+ \expandafter\gdef\rcs@temp{#1}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+
+% \subsection{Keyword Macros}
+% \begin{macro}{\rcskwsave}
+% Enabled verbatim mode and uses a sub macro to read the arguments afterwards.
+% \begin{macrocode}
+\def\rcskwsave{%
+ \begingroup
+ \rcs@catcodes
+ \rcskwsave@readargs
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcskwsave@readargs}[1]{\$kw: value\$}
+% Reads full argument, calls parse submacro and ends catcode changes.
+% If \cs{rcskwsave} was called by \cs{rcsid} scans the id keyword by calling the
+% scan macro.
+% \begin{macrocode}
+\gdef\rcskwsave@readargs#1{%
+ \rcskwsave@read#1\relax
+ \endgroup
+ \if@rcsidsw
+ \rcs@ifequal{\rcs@lastkw}{Id}%
+ {\ifx\rcskwId\empty\else
+ \expandafter
+ \rcs@scanId\rcskwId\relax
+ \@rcsidswfalse
+ \fi}{%
+ \rcs@ifequal{\rcs@lastkw}{Header}%
+ {\ifx\rcskwHeader\empty\else
+ \expandafter
+ \rcs@scanId\rcskwHeader\relax
+ \@rcsidswfalse
+ \fi}{}%
+ }%
+ \fi
+ \ignorespaces
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcskwsave@read}[1]{keyword line without surrounding \$ \$}
+% Reads the full keyword and strips the dollars.
+% \begin{macrocode}
+\begingroup
+\catcode`\$=12
+\gdef\rcskwsave@read $#1$\relax{%
+ \rcs@checkcolon#1:\relax
+}
+\endgroup
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcskwsave@parse}[2]{key}{value}
+% Parse the keyword and save it away.
+% \begin{macrocode}
+\begingroup
+\catcode`\$=11
+\gdef\rcskwsave@parse$#1:#2${%
+ \expandafter\xdef\csname rcskw#1\endcsname{#2}%
+}%
+\endgroup
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcskwdef}[2]{key}{value}
+% \begin{macrocode}
+\newcommand{\rcskwdef}[2]{%
+ \gdef\rcs@lastkw{#1}%
+ \expandafter\xdef\csname rcskw#1\endcsname{#2}%
+}
+% \end{macrocode}
+% Example: |\rcskwdef{Rev}{2.3}| will define |\rcskwRev| as `|2.3|'.
+% \end{macro}
+
+% We define default values for normal keywords. Keyword |Filename| is the name
+% given by |Id| and not a real keyword.
+% \begin{macrocode} ^^A TODO: check if needed
+\rcskwdef{Rev}{0.0}
+\rcskwdef{Date}{}
+\rcskwdef{Author}{}
+\rcskwdef{Filename}{}
+\rcskwdef{HeadURL}{}
+% \end{macrocode}
+
+% \begin{macro}{\rcskw}[1]{keyword name}
+% Macro to get keyword value. Just calls \cs{rcskw}\meta{ARGUMENT} where
+% the argument interpreted as text. So \eg |\rcskw{Date}| is the same as
+% |rcskwDate| but this could be changed later so always use this interface
+% to get the keyword values.
+%
+% \changes{v1.2}{2007/06/22}{Added warning when a wrong, maybe
+% misspelled, keyword is given.}
+% \begin{macrocode}
+\newcommand{\rcskw}[1]{%
+ \@ifundefined{rcskw#1}%
+ {\PackageWarning{rcs-multi}{RCS keyword '#1' not defined (typo?)}}%
+ {\csname rcskw#1\endcsname}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+
+% \subsection{Keyword check and strip macros}
+% The following macros are used to test whether the given keywords are fully
+% expanded or not.
+% RCS supports unexpanded keywords as input with or without colon and
+% with or without trailing space(s), \ie a:~|$KW$|, b:~|$KW:$| or c:~|$KW: $|.
+% To avoid \LaTeX{} syntax errors in this pre-commit state the keyword is
+% checked by the following macros. Unexpanded keywords result in an empty value.
+% Also leading and trailing spaces are removed.
+%
+% \begin{macro}{\rcs@checkcolon}[2]{key}{potential value, might be empty}
+% Checks if the keyword contains a colon. It is called by \cs{rcskwsave@read}
+% with a trailing |:\relax| so that \#2 will be empty if there is no earlier
+% colon or will hold the value with this trailing colon otherwise.
+% The first case means that the keyword is unexpanded without colon (case a)
+% which leads to an empty value. In the second case \cs{rcs@stripcolon} is
+% called to strip the colon and surrounding spaces. The final value is
+% returned by |\rcs@value|.
+% \begin{macrocode}
+\def\rcs@checkcolon#1:#2\relax{%
+ \rcs@ifempty{#2}%
+ {\rcskwdef{#1}{}}%
+ {\rcs@stripcolon#2\relax\rcskwdef{#1}{\rcs@value}}%
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcs@stripcolon}[1]{potential value}
+% Strips the previous added colon (for \cs{rcs@checkcolon}).
+% The remaining argument is checked if it's empty (case b) or only a space
+% (case c). Otherwise the keyword is expanded and \cs{rcs@stripspace} is
+% called to strip the spaces.
+% \begin{macrocode}
+\def\rcs@stripcolon#1:\relax{%
+ \rcs@ifempty{#1}%
+ {\gdef\rcs@value{}}%
+ {\rcs@ifequal{#1}{ }%
+ {\gdef\rcs@value{}}%
+ {\rcs@stripspace#1\relax\relax}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcs@stripspace}[2]{first character}{rest of string}
+% Strips leading space if present and calls \cs{rcs@striptrailingspace} to
+% strip the trailing space.
+% \begin{macrocode}
+\def\rcs@stripspace#1#2\relax{%
+ \rcs@ifequal{#1}{ }%
+ {\gdef\rcs@value{#2}}%
+ {\rcs@striptrailingspace#1#2\relax}%
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcs@striptrailingspace}[1]{string}
+% Strips trailing space using the macros parameter text. Must be called with
+% |\relax| as end marker.
+% \begin{macrocode}
+\def\rcs@striptrailingspace#1 \relax{%
+ \gdef\rcs@value{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+
+
+% \subsection{Date Macros}
+% \begin{macro}{\@rcs@scandate}[1]{date}
+% Scans data information in Id keyword and saves them in macros.
+% \begin{macrocode}
+\def\@rcs@scandate#1{\@rcs@scandate@#1\empty\relax}
+
+\def\@rcs@scandate@#1/#2/#3 #4:#5:#6#7#8\relax{%
+ \gdef\rcsfileyear{#1}%
+ \gdef\rcsfilemonth{#2}%
+ \gdef\rcsfileday{#3}%
+ \gdef\rcsfilehour{#4}%
+ \gdef\rcsfileminute{#5}%
+ \gdef\rcsfilesecond{#6#7}%
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcspdfdate}
+% Returns date in a format needed for |\pdfinfo|.
+% \begin{macrocode}
+\def\rcspdfdate{%
+ \rcsyear\rcsmonth\rcsday
+ \rcshour\rcsminute\rcssecond00'00'%
+}
+% \end{macrocode}
+% \end{macro}
+
+% \subsection{Mainfile Makros}
+% \begin{macro}{\rcssetmainfile}
+% Saves the current filename and URL to macros.
+% Will be called automatically in the preamble.
+% \changes{v1.2}{2007/06/22}{New macro}
+% \begin{macrocode}
+\newcommand{\rcssetmainfile}{%
+ \xdef\rcsmainfilename{\rcsfilename}%
+ \xdef\rcsmainfileurl{\rcsfileurl}%
+}
+\AtBeginDocument{\rcssetmainfile}
+% \end{macrocode}
+% \end{macro}
+
+% \subsection{Register and FullName Macros}
+% \begin{macro}{\rcsRegisterAuthor}[2]{author username}{Full Name}
+% Saves the author's name by defining |rcs@author@|\meta{username} to it.
+% \begin{macrocode}
+\newcommand{\rcsRegisterAuthor}[2]{%
+ \expandafter\def\csname rcs@author@#1\endcsname{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcsFullAuthor}
+% \begin{macro}{\rcsFullAuthor*}
+% We test if the starred or the normal version is used and call the
+% appropriate submacro |rcsFullAuthor@star| or |rcsFullAuthor@normal|.
+% \changes{v1.2}{2007/06/22}{Macro now returns the username if the full name
+% was not registered.}
+% \begin{macrocode}
+\newcommand{\rcsFullAuthor}{%
+ \@ifnextchar{*}%
+ {\rcsFullAuthor@star}%
+ {\rcsFullAuthor@normal}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\rcsFullAuthor@star}[1]{username}
+% Both submacros are calling |rcsFullAuthor@| but with different arguments.
+% The star macro also removes the star of course.
+% \begin{macrocode}
+\def\rcsFullAuthor@star*#1{%
+ \edef\rcs@temp{#1}%
+ \rcsFullAuthor@{\rcs@temp}{~(\rcs@temp)}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rcsFullAuthor@normal}[1]{username}
+% \begin{macrocode}
+\def\rcsFullAuthor@normal#1{%
+ \edef\rcs@temp{#1}%
+ \rcsFullAuthor@{\rcs@temp}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rcsFullAuthor@}[2]{username}{previous defined trailing string}
+% |rcsFullAuthor@| now sets the author's full name. Note that |#2| is empty
+% when the normal version is called.
+% \begin{macrocode}
+\def\rcsFullAuthor@#1#2{%
+ \@ifundefined{rcs@author@#1}%
+ {#1}%
+ {\csname rcs@author@#1\endcsname #2}%
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcsRegisterRevision}[2]{revision number}{tag name}
+% Saves the revision's name or tag by defining
+% |rcs@revision@|\meta{revisionnumber} to it.
+% \changes{v1.2}{2007/06/22}{New macro}
+% \begin{macrocode}
+\newcommand{\rcsRegisterRevision}[2]{%
+ \expandafter\def\csname rcs@revision@#1\endcsname{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcsFullRevision}
+% \begin{macro}{\rcsFullRevision*}
+% We test if the starred or the normal version is used and call the
+% appropriate submacro |rcsFullRevision@star| or |rcsFullRevision@normal|.
+% \changes{v1.2}{2007/06/22}{New macro}
+% \begin{macrocode}
+\newcommand{\rcsFullRevision}{%
+ \@ifnextchar{*}%
+ {\rcsFullRevision@star}%
+ {\rcsFullRevision@normal}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\rcsFullRevision@star}[1]{revision number}
+% Both submacros are calling |rcsFullRevision@| but with different arguments.
+% The star macro also removes the star of course.
+% \begin{macrocode}
+\def\rcsFullRevision@star*#1{%
+ \edef\rcs@temp{#1}%
+ \rcsFullRevision@{\rcs@temp}{~(r\rcs@temp)}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rcsFullRevision@normal}[1]{revision number}
+% \begin{macrocode}
+\def\rcsFullRevision@normal#1{%
+ \edef\rcs@temp{#1}%
+ \rcsFullRevision@{\rcs@temp}{}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rcsFullRevision@}[2]{revision number}{previous defined trailing
+% string}
+% |rcsFullRevision@| now sets the revision name. Note that |#2| is empty
+% when the normal version is called.
+% \begin{macrocode}
+\def\rcsFullRevision@#1#2{%
+ \@ifundefined{rcs@revision@#1}%
+ {Revision #1}%
+ {\csname rcs@revision@#1\endcsname #2}%
+}
+% \end{macrocode}
+% \end{macro}
+
+% \subsection{Other macros}
+% This section contains macros which don't fit in any other section.
+%
+% \begin{macro}{\rcs}
+% Strips the |$ $| around the keyword. A space must be before the final dollar.
+% \begin{macrocode}
+\providecommand{\rcs}[1]{\@revs#1}
+\def\@rcs$#1 ${#1}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcsnolinkurl}[1]{URL}
+% This code is taken from the \pkg{hyperref} package and is the definition of
+% |\url| just without the part which creates the actual hyperlink. This needs
+% of course the \pkg{hyperref} package. A warning is given if it isn't loaded.
+% \changes{v1.2}{2007/06/22}{New macro}
+% \begin{macrocode}
+%% Adapted from the \url macro of the `hyperref` package.
+\DeclareRobustCommand*{\rcsnolinkurl}{%
+ \@ifundefined{hyper@normalise}%
+ {\PackageWarning{rcs-multi}{Package hyperref is needed for \noexpand
+ \rcsnolinkurl.}}%
+ {\hyper@normalise\rcsnolinkurl@}%
+}%
+\def\rcsnolinkurl@#1{\Hurl{#1}}%
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rcs@getfilename}[1]{URL}
+% This macro expands the content using the temporary macro and sets it in front
+% of the \csi{rcs@getfilename} sub-macro together with |/{}| to make sure the
+% macro does not break at values without directories. A |\relax| is used as
+% end marker.
+% \begin{macrocode}
+\def\rcs@getfilename#1{%
+ \begingroup
+ \edef\rcs@temp{#1}%
+ \expandafter\@rcs@getfilename\rcs@temp/{}\relax
+}%
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\@rcs@getfilename}[2]{URL part before first slash}{URL part after
+% first slash}
+% Splits the content at the first slash (|/|) and checks if the remainder is
+% empty. If so the end marker got reached and the part before the slash is the
+% filename which is returned. Otherwise the macro recursively calls itself to
+% split the remainder.
+% \begin{macrocode}
+\def\@rcs@getfilename#1/#2\relax{%
+ \rcs@ifempty{#2}%
+ {\endgroup\gdef\rcsfilename{#1}}%
+ {\@rcs@getfilename#2\relax}%
+}%
+% \end{macrocode}
+% \end{macro}
+
+% \subsection{Write to Auxiliary file}
+%
+
+% \begin{macro}{\rcs@writeaux}
+% This macro writes the |.aux| auxiliary file and is called from a
+% |\AtEndDocument| macro later on.
+% \begin{macrocode}
+\def\rcs@writeaux{%
+ \immediate\write\@mainaux{^^J%
+ \noexpand\gdef\noexpand\rcsrev{\@rcs@rev}^^J%
+ \noexpand\gdef\noexpand\rcsdate{\@rcs@date}^^J%
+ \noexpand\gdef\noexpand\rcsauthor{\@rcs@author}^^J%
+ \noexpand\gdef\noexpand\rcsyear{\@rcs@year}^^J%
+ \noexpand\gdef\noexpand\rcsmonth{\@rcs@month}^^J%
+ \noexpand\gdef\noexpand\rcsday{\@rcs@day}^^J%
+ \noexpand\gdef\noexpand\rcshour{\@rcs@hour}^^J%
+ \noexpand\gdef\noexpand\rcsminute{\@rcs@minute}^^J%
+ \noexpand\gdef\noexpand\rcssecond{\@rcs@second}^^J%
+ \noexpand\rcs@gdefverb\noexpand\rcsname{\@rcs@name}^^J%
+ \noexpand\rcs@gdefverb\noexpand\rcsurl{\@rcs@url}^^J%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+
+
+
+% At the end of document the values are written to the auxiliary file.
+% \begin{macrocode}
+\AtEndDocument{%
+ \if@filesw
+ \ifx\@rcs@date\empty\else
+ \rcs@writeaux
+ \fi
+ \fi
+}
+% \end{macrocode}
+%
+% \Finale
+\endinput
diff --git a/macros/latex/contrib/rcs-multi/rcs-multi.ins b/macros/latex/contrib/rcs-multi/rcs-multi.ins
new file mode 100644
index 0000000000..69075e6682
--- /dev/null
+++ b/macros/latex/contrib/rcs-multi/rcs-multi.ins
@@ -0,0 +1,67 @@
+%% Copyright (C) 2009 by Martin Scharrer <martin@scharrer-online.de>
+%%
+%% 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.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Martin Scharrer.
+%%
+%% This work consists of the file rcs-multi.dtx and the derived file
+%% rcs-multi.sty.
+%%
+%% $Id: rcs-multi.ins 626 2009-03-23 13:48:17Z martin $
+
+
+\input docstrip.tex
+\keepsilent
+
+\usedir{tex/latex/rcs-multi}
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2009 by Martin Scharrer <martin@scharrer-online.de>
+
+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.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Martin Scharrer.
+
+This work consists of the file rcs-multi.dtx and the derived file rcs-multi.sty.
+
+\endpreamble
+
+\generate{\file{rcs-multi.sty}{\from{rcs-multi.dtx}{package}}}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* rcs-multi.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file rcs-multi.dtx *}
+\Msg{* through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+\endbatchfile
+
+% vim: ft=tex
diff --git a/macros/latex/contrib/rcs-multi/rcs-multi.pdf b/macros/latex/contrib/rcs-multi/rcs-multi.pdf
new file mode 100644
index 0000000000..af5b2e6cda
--- /dev/null
+++ b/macros/latex/contrib/rcs-multi/rcs-multi.pdf
Binary files differ