A document (typical of many) has a header which displays a timestamp in the form of a text string (“25 December 2013”). The timestamp string originates in a file "update" which is loaded with \input.
I attempted to construct a minimal working example, but the example (three files) does not work as I expected it to work.
% this is a listing of example.cls
\ProvidesPackage{example}
\LoadClassWithOptions{book}
\newcommand{\timestamp}[1]{#1}
\newcommand{\revision}{ \timestamp}
% this is a listing of example.tex
\documentclass[letterpaper]{example}
\begin{document}
This line represents the document header: \revision
\input{update} % update data from external file
Now the header should reflect the update: \revision
\end{document}
% this is a listing of "update"
% the date string should update the document header:
\timestamp{25 December 2013}
This line represents update text, which typically consists of dozens of lines.
After much searching and reading, I still do not understand which LaTeX mechanism – such as \savebox or \renewcommand – is appropriate for this task. Also, I am confused regarding the proper location for the definitions of \timestamp and \revision – should they be defined in the class file (example.cls), in the main document file (example.tex), or in the file (update) which periodically updates the main document file? My inclination is to define as much as possible in the class file, because there are over a thousand document files.
