| 1 |
\documentclass[12pt]{report} |
| 2 |
\usepackage{rcs-multi} |
| 3 |
% Version control information: |
| 4 |
\rcsid{$Id: example.tex,v 1.2 2009/03/23 19:07:46 martin Exp martin $} |
| 5 |
% or, alternatively, with full path: |
| 6 |
\rcsid{$Header: /home/martin/src/latex/rcs-multi/dev/example.tex,v 1.2 2009/03/23 19:07:46 martin Exp martin $} |
| 7 |
|
| 8 |
% Other keywords can be read using: |
| 9 |
\rcskwsave{$Author: martin $} |
| 10 |
\rcskwsave{$Date: 2009/03/23 19:07:46 $} |
| 11 |
\rcskwsave{$Name: $} |
| 12 |
% The `Log' keyword is not supported. |
| 13 |
\rcskwsave{$Locker: martin $} |
| 14 |
\rcskwsave{$RCSfile: example.tex,v $} |
| 15 |
\rcskwsave{$Revision: 1.2 $} |
| 16 |
\rcskwsave{$Source: /home/martin/src/latex/rcs-multi/dev/example.tex,v $} |
| 17 |
\rcskwsave{$State: Exp $} |
| 18 |
% Their values can be typeset using \rcskw{Author}, \rcskw{Date}, etc. |
| 19 |
|
| 20 |
\usepackage{hyperref} |
| 21 |
%\usepackage{url} |
| 22 |
|
| 23 |
\usepackage{fancyhdr} |
| 24 |
\renewcommand{\headrulewidth}{0.4pt} |
| 25 |
\renewcommand{\footrulewidth}{0.4pt} |
| 26 |
\setlength{\headheight}{14.5pt} |
| 27 |
% This will display the last changed date and revision of the current chapter. |
| 28 |
% Change to `\rcsdate -- \rcsrev' if you like to have the document revision. |
| 29 |
\newcommand{\rcsfooter}{Last Changed: \rcsfiledate -- r\rcsfilerev} |
| 30 |
|
| 31 |
\pdfinfo{% |
| 32 |
/CreationDate (D:\rcspdfdate) |
| 33 |
} |
| 34 |
|
| 35 |
\rcsRegisterAuthor{johnd}{John Doe} |
| 36 |
\rcsRegisterAuthor{maryd}{Mary Doe} |
| 37 |
\rcsRegisterAuthor{martin}{Martin S.} |
| 38 |
\rcsRegisterRevision{1.2}{Version~1} |
| 39 |
|
| 40 |
|
| 41 |
%% The two 'filecontents' environments are used to produce two example chapters. |
| 42 |
%% Normally they are separated files from the beginning but they are packed into |
| 43 |
%% this main file to only have one example TeX file in the CTAN ZIP file. |
| 44 |
\begin{filecontents}{example_chap1.tex} |
| 45 |
% Version control information: |
| 46 |
\rcsid{$Header: /home/martin/src/latex/rcs-multi/dev/example_chap1.tex,v 1.3 2009/03/23 19:20:18 martin Exp $} |
| 47 |
|
| 48 |
\chapter{Example Chapter 1} |
| 49 |
|
| 50 |
\section*{Version} |
| 51 |
\subsection*{This chapter} |
| 52 |
% \url is needed because there is an underscore in the name |
| 53 |
% The package 'underscore' seems not to work properly, so the 'hyperref' |
| 54 |
% package is used which is not the best solution. Avoid underscore in LaTeX filenames. |
| 55 |
Filename: \rcsnolinkurl{\rcsfilename}\\* |
| 56 |
URL: \url{\rcsfileurl}\\* |
| 57 |
% Something like \href{\rcskw{HeadURL}}{Download} works also! |
| 58 |
\textbf{Last change}\\* |
| 59 |
Revision: \rcsfilerev\\* |
| 60 |
Date: \rcsfiledate\\* |
| 61 |
Year: \rcsfileyear\\* |
| 62 |
Time: \rcsfilehour:\rcsfileminute:\rcsfilesecond\\* |
| 63 |
Author: \rcsfileauthor\\* |
| 64 |
|
| 65 |
\enlargethispage{\baselineskip} |
| 66 |
\subsection*{Whole document} |
| 67 |
Main Filename: \rcsnolinkurl{\rcsmainfilename}\\* |
| 68 |
Main URL: \url{\rcsmainurl}\\* |
| 69 |
\textbf{Last change}\\* |
| 70 |
Filename: \rcsnolinkurl{\rcsname}\\* |
| 71 |
URL: \url{\rcsurl}\\* |
| 72 |
Revision: \rcsrev\\* |
| 73 |
Date: \rcsdate\\* |
| 74 |
Year: \rcsyear\\* |
| 75 |
Time: \rcshour:\rcsminute:\rcssecond\\* |
| 76 |
Author: \rcsauthor\\* |
| 77 |
% [...] |
| 78 |
|
| 79 |
\section{Tests} |
| 80 |
\rcsRegisterRevision{2.1}{Test} |
| 81 |
|
| 82 |
Registered author name: \rcsFullAuthor{\rcsfileauthor}\\* |
| 83 |
Registered revision name: \rcsFullRevision{\rcsfilerev}\\* |
| 84 |
Registered author name (*): \rcsFullAuthor*{\rcsfileauthor}\\* |
| 85 |
Registered revision name (*): \rcsFullRevision*{\rcsfilerev}\\* |
| 86 |
|
| 87 |
\subsubsection*{Behaviour if value is not registered:} |
| 88 |
Not registered user name: \rcsFullAuthor{someusername}\\* |
| 89 |
Not registered revision name: \rcsFullRevision{1.4}\\* |
| 90 |
Not registered user name (*): \rcsFullAuthor*{someusername}\\* |
| 91 |
Not registered revision name (*): \rcsFullRevision*{1.4}\\* |
| 92 |
|
| 93 |
|
| 94 |
\end{filecontents} |
| 95 |
|
| 96 |
\begin{filecontents}{example_chap2.tex} |
| 97 |
% Version control information: |
| 98 |
\rcsid{$Header: /home/martin/src/latex/rcs-multi/dev/example_chap2.tex,v 1.2 2009/03/23 19:10:56 martin Exp martin $} |
| 99 |
|
| 100 |
\chapter{Example Chapter 2} |
| 101 |
|
| 102 |
\section*{Version} |
| 103 |
\subsection*{This chapter} |
| 104 |
% \url is needed because there is an underscore in the name |
| 105 |
% The package 'underscore' seems not to work properly, so the 'hyperref' |
| 106 |
% package is used which is not the best solution. Avoid underscore in LaTeX filenames. |
| 107 |
Filename: \rcsnolinkurl{\rcsfilename}\\ |
| 108 |
URL: \url{\rcsfileurl}\\ |
| 109 |
% Something like \href{\rcskw{HeadURL}}{Download} works also! |
| 110 |
\textbf{Last change}\\ |
| 111 |
Revision: \rcsfilerev\\ |
| 112 |
Date: \rcsfiledate\\ |
| 113 |
Year: \rcsfileyear\\ |
| 114 |
Time: \rcsfilehour:\rcsfileminute:\rcsfilesecond\\ |
| 115 |
Author: \rcsfileauthor\\ |
| 116 |
|
| 117 |
\enlargethispage{\baselineskip} |
| 118 |
\subsection*{Whole document} |
| 119 |
Main Filename: \rcsnolinkurl{\rcsmainfilename}\\ |
| 120 |
Main URL: \url{\rcsmainurl}\\ |
| 121 |
\textbf{Last change}\\ |
| 122 |
Filename: \rcsnolinkurl{\rcsname}\\ |
| 123 |
URL: \url{\rcsurl}\\ |
| 124 |
Revision: \rcsrev\\ |
| 125 |
Date: \rcsdate\\ |
| 126 |
Year: \rcsyear\\ |
| 127 |
Time: \rcshour:\rcsminute:\rcssecond\\ |
| 128 |
Author: \rcsauthor |
| 129 |
\end{filecontents} |
| 130 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 131 |
|
| 132 |
\listfiles |
| 133 |
\begin{document} |
| 134 |
|
| 135 |
\begin{titlepage} |
| 136 |
\hbox{} |
| 137 |
\pdfbookmark{Title Page}{titlepage} |
| 138 |
\vspace{8ex} |
| 139 |
{\huge Title\par} |
| 140 |
\vspace{2ex} |
| 141 |
{\large \noindent This is an example document for the \texttt{rcs-multi} |
| 142 |
package. Please also look at the LaTeX source code of this |
| 143 |
document.} |
| 144 |
\vfill |
| 145 |
\flushleft\sffamily |
| 146 |
Version control information:\\ |
| 147 |
Head Filename: \rcsnolinkurl{\rcsmainfilename}\\ |
| 148 |
Head URL: \rcsnolinkurl{\rcsmainfileurl}\\ |
| 149 |
Last changed file (name): \rcsnolinkurl{\rcsname}\\ |
| 150 |
Last changed file (URL): \rcsnolinkurl{\rcsurl}\\ |
| 151 |
Last changed date: \rcsdate\\ |
| 152 |
Last changes revision: \rcsrev\\ |
| 153 |
Version: \rcsFullRevision*{\rcsrev}\\ |
| 154 |
Last changed by: \rcsFullAuthor*{\rcsauthor}\\ |
| 155 |
\end{titlepage} |
| 156 |
|
| 157 |
% Include chapters |
| 158 |
\include{example_chap1} |
| 159 |
\include{example_chap2} |
| 160 |
%\include{example_chap3} |
| 161 |
|
| 162 |
\end{document} |