Situation
I have to make a cover template for a document. At the end of the page, I have to add the revision number with other useful info like this example:
\begin{tabular}{lccl}
Revision 0 & 06-11-2014 & Initial Release & John Smith \\
Revision 1 & 06-12-2014 & Changed something & Joe Blow \\
...
\end{tabular}
Objective
In the TEX document, the user would have to add their revision like this:
\AddRevision{06-11-2014}{Initial Release}{John Smith}
\AddRevision{06-12-2014}{Changed something}{Joe Blow}
...
\createFrontPage
When generating the PDF, this should automatically generate the tabular above. Note that the revision's number is automatically increase by 1 at each AddRevision.
What I have tried
I'm not familiar with Latex macros, so this is what I have for the moment. I just don't know if I'm close to the solution or if I'm doing totally wrong. Here's the code in my CLS file:
\newCounter{RowCounter}
\def\AddRev#1,#2,#3{\RevDate{#1}, \RevDesc{#2}, \RevAuthor{#3} \stepCounter{RowCounter}}
\newCounter{i}
\newcommand{\RevisionRows}
{
\forloop{i}{0}{\value{i} < \value{RowCounter}}
{
Revision \arabic{i} & \RevDate & \RevDesc & \RevAuthor \\
}
}
\newcommand{\createFrontPage}
{
% some stuff
\begin{tabular}{lccl}
\RevisionRows
\end{tabular}
}
Questions
Is my objective possible ? If yes, What am I doing wrong ? What's the best and clean solution ? Any suggestions are welcome.
Thanks a lot for your help.