| 1 |
%% $Id: zwgetfdate.tex 203 2008-06-14 18:56:59Z zw $ |
| 2 |
\input utf8-t1 % encTeX required |
| 3 |
\documentclass[11pt]{article} |
| 4 |
\usepackage{zwgetfdate} |
| 5 |
% The following package will be made available soon. |
| 6 |
\usepackage[footskip=30pt]{zwpagelayout} |
| 7 |
\usepackage[T1]{fontenc} |
| 8 |
\usepackage{lmodern,array} |
| 9 |
\usepackage[protrusion=false,expansion=true,stretch=8,shrink=24,step=4]{microtype} |
| 10 |
{\lccode`\!`\\ |
| 11 |
\lowercase{\gdef\Bslash{!}}} |
| 12 |
\DeclareRobustCommand\cmd[1]{\texttt{\Bslash#1}} |
| 13 |
\mubytein 0 % important due to bug in url.sty |
| 14 |
\usepackage[pdftitle=Get the File/Package Date, pdfauthor=Zdenek\ Wagner, |
| 15 |
bookmarks,bookmarksopenlevel=2,bookmarksopen]{hyperref} |
| 16 |
\mubytein 1 \mubyteout 3 \mubytelog 3 |
| 17 |
\begin{document} |
| 18 |
\title{Get the File/Package Date} |
| 19 |
\author{Zdeněk Wagner\\\url{http://icebearsoft.euweb.cz}} |
| 20 |
\date{Package date: \DateOfPackage{zwgetfdate}} |
| 21 |
\maketitle |
| 22 |
|
| 23 |
\begin{abstract}\noindent |
| 24 |
This package is useful for just a small group of developers who write documentation. Its purpose is |
| 25 |
to get the date of a file or a package as specified in the \cmd{ProvidesFile} or |
| 26 |
\cmd{ProvidesPackage}, respectively. |
| 27 |
\end{abstract} |
| 28 |
|
| 29 |
\tableofcontents |
| 30 |
|
| 31 |
\section{Motivation} |
| 32 |
File identification is a fundamental problem. If something does not work in your computer but works |
| 33 |
elsewhere, it usually means that you have a different version of some file(s). \LaTeX\ enables checking |
| 34 |
the correct release date of a file or package using an optional argument. You can easily display |
| 35 |
the list as well as dates of files used in your document by the \cmd{listfiles} command. The date |
| 36 |
thus seems to be more important than the file's version number. |
| 37 |
|
| 38 |
Once we can identify the date of the file or package, we want to be sure that we read the correct |
| 39 |
documentation. The developer usually creates a private packaging script which takes the right files from |
| 40 |
his/her repository. The file to be documented is the one that is currently installed. It seems thus |
| 41 |
natural if the date is taken automatically from the file. |
| 42 |
|
| 43 |
The package serves this very purpose. It intercepts the standard \LaTeX\ macros \cmd{ProvidesFile} and |
| 44 |
\cmd{ProvidesPackage} and remembers their dates. These dates can be later queried. |
| 45 |
|
| 46 |
\section{Usage} |
| 47 |
The package is loaded by the following command: |
| 48 |
|
| 49 |
\medskip |
| 50 |
\verb;\usepackage{zwgetfdate}; |
| 51 |
|
| 52 |
\medskip |
| 53 |
The package then stores the dates of files and packages loaded \emph{after} itself including its |
| 54 |
own date. |
| 55 |
|
| 56 |
The package defines two commands. They try to find the date of the specified file or package and |
| 57 |
output it. If the date is not found (the file/package was not loaded or does not contain |
| 58 |
identification), warning is written both to the terminal and the log file but nothing is printed. |
| 59 |
Remember that this is not a diagnostic package, you should know what you use in your document. |
| 60 |
|
| 61 |
\subsection{Command \cmd{DateOfPackage}} |
| 62 |
This command returns the date of a package. It was used in the title of the document, command |
| 63 |
\verb;\DateOfPackage{zwgetfdate}; showed the date of the package being documented. This document |
| 64 |
also makes use of the \textsc{hyperref} package. Using \verb;\DateOfPackage{hyperref}; we can see |
| 65 |
that the package used for typesetting this manual was of \DateOfPackage{hyperref}. |
| 66 |
|
| 67 |
\subsection{Command \cmd{DateOfFile}} |
| 68 |
This command returns the date of the file. Remember that \verb;\DateOfFile{zwgetfdate.sty}; will |
| 69 |
display nothing because \textsc{zwgetfdate} is loaded and identified as a package, not as an |
| 70 |
ordinary file. However, this document is typeset in the T1 encoding and thus file |
| 71 |
\texttt{t1enc.def} is loaded. Command \verb;\DateOfFile{t1enc.def}; will show that its date is |
| 72 |
\DateOfFile{t1enc.def}. |
| 73 |
|
| 74 |
\section{License} |
| 75 |
The package can be used and distributed according to the LaTeX Project Public License version~1.3 or later the |
| 76 |
text of which can be found at the \texttt{License.txt} file in the \texttt{doc} directory or at |
| 77 |
\url{http://www.latex-project.org/lppl.txt} |
| 78 |
|
| 79 |
\end{document} |