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.
\
To provide a \version
command like \author
, you'd do:
\let\theversion=\relax
\providecommand{\version}[1]{\renewcommand{\theversion}{#1}}
If you're not using a titlepage
environment, you can redefine \maketitle
itself. Look in article.cls
(or whatever class file you're using), copy-and-paste, and insert \theversion
whereever and however you want. If you want to check for a version number before putting in the title, do something like:
\def\maketitle{%
% ... stuff copied from original class file...
\ifx\theversion\relax
% do nothing if there is no version defined
\else\bfseries\theversion% set the version
\fi
If you don't need it in the title per se you could add it as a footnote to the date (both of those properties related to the freshness of the resource so it makes some sense to put them together.
\title{My article}
\version{v1.2}
\date{\today\thanks{\theversion}}