1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<head>
<title>UK TeX FAQ -- question label RCS</title>
</head><body>
<h3>Version control using RCS, CVS or <i>Subversion</i></h3>
<p>If you use RCS, CVS or <i>Subversion</i> to maintain
your (La)TeX documents under version control, you may need some
mechanism for including the version details in your document, in such
a way that they can be typeset (that is, rather than just hiding them
inside a comment).
<p>The most complete solution for RCS and CVS is to use the
(LaTeX) package <i>rcs</i>, which allows you to parse and
display the contents of RCS keyword fields in an extremely
flexible way. The package <i>rcsinfo</i> is simpler, but does most
of what you want, and some people prefer it; it is explicitly
compatible with <i>LaTeX2HTML</i>.
<p>If, however, you need a solution which works without using external
packages, or which will work in Plain TeX, then you can use the
following minimal solution:
<blockquote>
<pre>
\def\RCS$#1: #2 ${\expandafter\def\csname RCS#1\endcsname{#2}}
\RCS$Revision: 1.426 $ % or any RCS keyword
\RCS$Date: 2006/12/18 09:59:16 $
...
\date{Revision \RCSRevision, \RCSDate}
</pre>
</blockquote><p>
<p>If you’ve entered the brave new world of <i>subversion</i>, the
package <i>svn</i> may be for you. It has explicit cleverness
about dealing with dates:
<blockquote>
<code>\</code><code>documentclass</code><code>{<<i>foo</i>>}</code><br>
<code>...</code><br>
<code>\</code><code>usepackage{svn}</code><br>
<code>\</code><code>SVNdate</code><code> $Date$</code><br>
<code>\</code><code>author{...}</code><br>
<code>\</code><code>title{...}</code><br>
<code>...</code><br>
<code>\</code><code>begin{document}</code><br>
<code>\</code><code>maketitle</code><br>
<code>...</code><br>
<code>\</code><code>end{document}</code>
</blockquote><p>
will (once <i>subversion</i> has committed a copy of the document)
cause <code>\</code><code>maketitle</code> use the date that has been written into the
<code>$Date$</code> keyword.
<p>The alternative is the <i>svninfo</i> package, which has much the
same mechanisms as does <i>svn</i> but with a rather different
focus. <i>Svninfo</i> does the date trick that <i>svn</i>
performs (controlled by a package option), and can set up page
foot-lines using <a href="FAQ-fancyhdr.html">package <i>fancyhdr</i></a>.
There isn’t much to choose between the two packages: you should read
the packages’ documentation to see which you find best.
<dl>
<dt><tt><i>rcs.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/rcs.zip">macros/latex/contrib/rcs</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/rcs.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/rcs/">browse</a>)
<dt><tt><i>rcsinfo.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/rcsinfo.zip">macros/latex/contrib/rcsinfo</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/rcsinfo.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/rcsinfo/">browse</a>)
<dt><tt><i>svn.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/svn.zip">macros/latex/contrib/svn</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/svn.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/svn/">browse</a>)
<dt><tt><i>svninfo.sty</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/svninfo.zip">macros/latex/contrib/svninfo</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/svninfo.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/svninfo/">browse</a>)
</dl>
<p><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=RCS">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=RCS</a>
</body>
|