Alex Rivera | Logout

Add a version number to the title of a LaTeX document

Asked 2010-04-13T23:50:14.837
22

The title section of my LaTeX documents usually look like

\title{Title}
\author{Me}
%\date{}      %// Today's date will appear when this is commented out.

\begin{document}
\maketitle

I'd really like to add another line in the title section for a version number:

\title{Title}
\author{Me}
\version{v1.2}
%\date{}      %// Today's date will appear when this is commented out.

\begin{document}
\maketitle

It doesn't necessarily have to be a command named version, but how can I get a version number to appear after the date (which is after the author)? I can manually set the version number.

So:

Title

Me

4/13/2010

v1.2

Edit
Report

1 Answer

6

For many version control systems, the checkin and checkout programs will expand certain strings in the documents into metadata the version control system has about the system, including the version number.

If you include these strings in the body of Tex definitions, then you can use them in your documents.

It's hard to say more without knowing which version control system you are using, but CTAN has the vc bundle, and rcs.sty is nice to use, for folks still using not only non-distributed, but not even concurrent VC...

Once you've got the strings (oh, I see you said manual entry is OK), you can then typeset this using

\title{Title\\\normalsize Version \versionnumber}

If you really want the author in between, then you can't use \title and \author together in the usual way - you should put your name on another line in the \title command.

answered 2010-04-14T07:47:44.437

Your Answer