On 31/05/2010 1:03 PM, Rainer Dorsch wrote:
Am Wednesday 26 May 2010 23:20:48 schrieb Julien Rioux:
On 26/05/2010 1:17 PM, Rainer Dorsch wrote:
Hello,
we maintain our LyX document in subversion. From time to time, I
distribute a pdf. I would like to include the subversion revision number
in the document. Is there a easy way to do that?
Thanks
Rainer
In the preamble:
\usepackage{svn}
\SVN $Revision$
In the document, inside a TeX code box:
\SVNRevision
See also this thread:
http://www.mail-archive.com/[email protected]/msg78371.html
and:
http://jtauber.com/blog/2006/03/28/subversion_keywords_in_latex_documents/
Hi Julien,
I thought that works well, but now after understanding keyword substitution in
subversion in more detail, I found that it does not work very well (or I did
not fully understand the svn package):
We have a document with multiple child documents. There are few changes in the
top-level document. SVN replaces the $Revision$ during checkin only, when a
file is modified. Since the top-level file is modified rarely, I see rarely
updates on $Revision$.
The svn manual clearly describes that svnversion should be used for this
purpose
http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html
Is there a way to insert the output of an external command (svnversion) during
compile time into a LyX document (it would not hurt to let also LyX display
the result ;-) ?
Thanks,
Rainer
Hi,
There is a way to insert the output of an external command, but I am not
too familiar with it. For example, there is a "date command" in Tools >
Preference > File Handling > Converters; it is used to insert today's
date. The usage is: Insert > External material and then select Date for
the Template.
With "date command" as your starting point you could try to create a new
type of external material "svn revision" which would call svnversion,
although for the purpose you describe, I would instead look into the
LaTeX package svnmulti. Untested but worth a try.
Cheers,
Julien