summaryrefslogtreecommitdiff
path: root/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-RCS.html
blob: d8ef63eaa2c213974daf818b2886b0dadb1f5721 (plain)
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
63
64
65
66
67
68
69
70
71
72
73
<head>
<title>UK TeX FAQ -- question label RCS</title>
</head><body>
<h3>Version control using RCS, CVS or the like</h3>
<p/>If you use RCS, CVS, <i>Subversion</i>,
<i>Bazaar</i> or <i>Git</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.543 $ % or any RCS keyword
\RCS$Date: 2008/06/21 18:54:02 $
...
\date{Revision \RCSRevision, \RCSDate}
</pre>

</blockquote><p>
<p/>If you&rsquo;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>{&lt;<i>foo</i>&gt;}</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/>Another alternative for <i>Subversion</i> users 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&rsquo;t much to
choose between the two packages: you should read the packages&rsquo;
documentation to see which suits you best.
<p/>An alternative script-based approach to version control has been taken
by the <i>vc</i> bundle, that in certain situations might work more
reliably than any of the packages mentioned above.  The <i>vc</i>
bundle supports <i>Bazaar</i>, <i>Git</i> and
<i>Subversion</i> usage and works with both LaTeX and
Plain TeX.  Note that <i>vc</i> is the only option that
currently claims to support <i>Bazaar</i>- and
<i>Git</i>-controlled repositories.
<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>)
<dt><tt><i>vc</i></tt><dd><a href="ftp://cam.ctan.org/tex-archive/support/vc.zip">support/vc</a> (<a href="ftp://cam.ctan.org/tex-archive/support/vc.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/support/vc/">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>