From 2676ec53a3a60a68a924d6024cc89454d458970c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 20 Aug 2009 15:19:11 +0000 Subject: getfiledate update (8aug09) git-svn-id: svn://tug.org/texlive/trunk@14780 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/getfiledate/README | 5 +- .../doc/latex/getfiledate/getfiledate-guide.pdf | Bin 99645 -> 113045 bytes .../doc/latex/getfiledate/getfiledate-guide.tex | 286 ++++++++++++++------- .../tex/latex/getfiledate/getfiledate.sty | 100 +++---- 4 files changed, 244 insertions(+), 147 deletions(-) diff --git a/Master/texmf-dist/doc/latex/getfiledate/README b/Master/texmf-dist/doc/latex/getfiledate/README index 87c2665d30b..178979d9396 100644 --- a/Master/texmf-dist/doc/latex/getfiledate/README +++ b/Master/texmf-dist/doc/latex/getfiledate/README @@ -1,5 +1,6 @@ The 'getfiledate' package fetches from the system the date of last -modification or opening of a resident file. +modification or opening of a resident file and displays the result +using a user-friendly interface. This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or @@ -7,6 +8,6 @@ any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later. -Ahmed Musa 2009 +Ahmed Musa (c) 2009 End of README file. diff --git a/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.pdf b/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.pdf index 35ad45bcb74..6246098c406 100644 Binary files a/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.pdf and b/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.pdf differ diff --git a/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.tex b/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.tex index 8d535cb32a3..634f2cf5500 100644 --- a/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.tex +++ b/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.tex @@ -2,7 +2,7 @@ % This is file getfiledate-guide.tex, the documentation for the % % getfiledate package. % % % -% For illustration only: may not be run % +% DON'T RUN: For demonstration only. % % % % (c) Ahmed Musa 2009 % %+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% @@ -10,46 +10,57 @@ \usepackage[scaled=0.9]{helvet} \usepackage{getfiledate} \usepackage[left=3.5cm,right=3.5cm,top=3.5cm,bottom=3.5cm]{geometry} +\usepackage{fancyvrb,shortvrb} \usepackage{array,longtable,colortbl} -\usepackage{calc} \usepackage{multicol} -\usepackage{shortvrb,fancyvrb} \usepackage{parskip} \usepackage{xspace} +\usepackage{fancyhdr} \usepackage{lastpage} \usepackage{hyperref} \usepackage{doipubmed} -\interactionmode=1 -\xglobal\definecolorset{rgb}{x}{1}{agreen,0.00,0.59,0.00;% - bgreen,0.84,0.84,0.00;blue,0.50,0.00,1.00;amagenta,0.50,0.00,0.50;% - bmagenta,0.50,0.00,1.00} +\new\let\TC\textcolor +\xglobal\definecolorset{rgb}{x}{0}{green1,0.00,0.59,0.00;% + green2,0.84,0.84,0.00;blue1,0.50,0.00,1.00;magenta1,0.50,0.00,0.50;% + magenta2,0.50,0.00,1.00} \hypersetup{colorlinks=true,linkcolor=red,pdfpagemode=UseThumbs, - implicit=true,breaklinks=true,citecolor=purple} + implicit=true,breaklinks=true,citecolor=purple,pdfview=FitH, + pdfstartview=FitH} \CustomVerbatimEnvironment{gfdverbatim}{Verbatim}{numbers=left, numberblanklines=false,firstnumber=last,frame=single, rulecolor=\color{orange},framerule=2pt, - framesep=2pt,fillcolor=\color{violet!55},formatcom=\color{xbmagenta1}, - xrightmargin=0pc,commandchars=\(\),commentchar=\?} -\newcommand*\tezt[1]{\textcolor{xagreen1}{\texttt{#1}}} -\newcommand*\temt[1]{\textcolor{teal}{\texttt{#1}}} + framesep=2pt,fillcolor=\color{violet!55},formatcom=\color{xmagenta20}, + xrightmargin=0pc,commandchars=\|\(\),commentchar=\?} +\new\def\stya#1{\TC{xgreen10}{\texttt{#1}}} +\new\def\styb#1{\TC{teal}{\texttt{#1}}} +\new\def\cmda#1{\stya{\string#1}} +\new\def\cmdb#1{\styb{\string#1}} \def\ie{i.e.\xspace} \newcounter{examplecnt}[section] -\newcommand\example{% +\new\def\example{% \refstepcounter{examplecnt} - \par\vspace*{.5\baselineskip} - \textcolor{purple}{\textbf{Example~\thesection.\theexamplecnt}} - \par% + \endgraf\vspace*{.5\baselineskip} + \TC{purple}{\textbf{Example~\thesection.\theexamplecnt}} + \endgraf% } -\date{\textcolor{purple}{June 10, 2009}\vadjust{\kern2ex\hrule}} -\def\helv{\fontfamily{phv}\selectfont\color{xamagenta1}} +\date{\TC{purple}{\today}\vadjust{\kern2ex\hrule}} +\new\def\helv{\fontfamily{phv}\selectfont\color{xmagenta10}} \def\eg{e.g.\xspace} \def\ie{i.e.\xspace} \def\etc{etc.\xspace} -\pagestyle{plain} +\fancyhf{} +\fancyhfoffset[R,L]{\dimexpr\marginparsep+\marginparwidth} +\lhead{\helv The \texttt{\TC{blue}{getfiledate}} Package} +\rhead{\helv Page~\thepage~of~\pageref*{LastPage}} +\renew\def\headrule{\color{blue}\hrule height1pt width\headwidth\relax + \vspace{2pt}\hrule height1pt width\headwidth\vspace{-2pt}} +\renew\def\footrule{\color{green}\hrule height1pt width\headwidth\relax + \vspace{2pt}\hrule height1pt width\headwidth\vspace{2pt}} +\pagestyle{fancyplain} \begin{document} \MakeShortVerb{\+} -\title{{\bfseries The \textcolor{blue}{\texttt{getfiledate}} Package}\\[1ex] +\title{{\bfseries The \TC{blue}{\texttt{getfiledate}} Package}\\[1ex] Version 1.0} \author{Ahmed Musa\\[.5ex]University of Central Lancashire\\ Preston, United Kingdom\\[1ex]\url{a.musa@rocketmail.com} @@ -58,13 +69,18 @@ Version 1.0} \columnseprule=0.5pt\premulticols=2cm \begin{multicols}{2} - \bgroup\small\tableofcontents\egroup + \small\tableofcontents\normalsize \end{multicols} \bigskip -\begin{abstract} -\noindent The \tezt{getfiledate} package fetches from the system the date of last modification or opening of a resident file. It is based on an idea by Heiko Oberdiek \citeurl{oberdiek@uni-freiburg.de} that appeared in February 2009 on the discussion/newsgroup website \url{comp.text.tex}, namely, using the \tezt{\string\pdffilemoddate} command of pdf\TeX. This package creates a user-friendly interface for obtaining and presenting the needed filedate in several formats. -\end{abstract} +\begin{center} +\fboxsep3pt\fboxrule2.5pt +\fcolorbox{red}{yellow}{\fcolorbox{xmagenta20}{gray!15}{% +\parbox{\dimexpr\hsize-4\fboxsep-4\fboxrule}{% +\hfil\fcolorbox{cyan}{white}{\hspace{1cm}\textbf{Summary}\hspace{1cm}}\hfill\\[.5ex] +The \stya{getfiledate} package fetches from the system the date of last modification or opening of a resident file. It is based on an idea by Heiko Oberdiek \citeurl{oberdiek@uni-freiburg.de} that appeared in February 2009 on the discussion/newsgroup website \url{comp.text.tex}, namely, using the \cmda{\pdffilemoddate} command of pdf\TeX. This package creates a user-friendly interface for obtaining and presenting the needed filedate in several formats. +}}} +\end{center} \section{User interface} The package may be loaded without options as in @@ -75,16 +91,16 @@ or with options as in \begin{gfdverbatim} \usepackage[option=value]{getfiledate} \end{gfdverbatim} -The options include the filename for which you want to print the date of last modification. The options and their default values are described in section~\ref{PackageOptions}. It is advisable to first load the package by \tezt{\string\usepackage\{getfiledate\}} and then use the macro \tezt{\string\getfiledate} to dynamically determine and print the date of last modification of the filename. This macro sets the various options. +The options include the filename for which you want to print the date of last modification. The options and their default values are described in section~\ref{sec:PackageOptions}. It is advisable to first load the package by \cmda{\usepackage\{getfiledate\}} and then use the macro \cmda{\getfiledate} to dynamically determine and print the date of last modification of the filename. This macro sets the various options. -\section{Package options\label{PackageOptions}} +\section{Package options\label{sec:PackageOptions}} The package options are listed in Table~\ref{tab:Package-options} below. \begingroup \small \rowcolors{3}{yellow!20}{gray!25} \extrarowheight2pt -\begin{longtable}{m{3cm}m{3.5cm}m{\hsize-8cm}} +\begin{longtable}{m{3cm}m{3.5cm}m{\dimexpr\hsize-8cm}} \caption{Package options\label{tab:Package-options}}\\ \rowcolor{green!55} \bfseries Option&\bfseries Default&\bfseries Meaning\\ @@ -96,11 +112,12 @@ The package options are listed in Table~\ref{tab:Package-options} below. \endfoot \endlastfoot +file+ & +getfiledate.sty+ & The file for which the date of last modification is required.\\ -+prefix+ & The date of last modification of file & The prefix of filedate.\\ ++prefix+ & The date of last modification of file & The prefix of filename.\\ ++postfix+ & +was+ & The postfix of filename, not that of filedate. It has been necessary to provide both prefix and postfix following user requests.\\ +width+ & +\hsize+ & The width of the parbox or boxedminipage containing the filedate.\\ +head+ & +0ex+ & The vertical separation between the paragraph before the filedate and the filedate itself. When this option is passed to package without value, its default becomes the +\baselineskip+.\\ +foot+ & +0ex+ & The vertical skip between the filedate's line and the paragraph after filedate. When this option is passed to package without value, its default becomes the +\baselineskip+.\\ -+marker+ & +\blacktriangle-+ +right+ & The mark before the filedate, on the same line with the filedate.\\ ++marker+ & +\blacktriangle-+ +right+ & The mark before the filename, on the same line with the filedate.\\ +markercolor+ & +blue+ & The color of the marker.\\ +filenamecolor+ & +blue+ & The color of the filename.\\ +datecolor+ & +blue+ & The color of filedate.\\ @@ -110,7 +127,9 @@ The package options are listed in Table~\ref{tab:Package-options} below. +framecolor+ & +black+ & The color of the boxrule for the boxedminipage.\\ +framesep+ & +3pt+ & The +\fboxsep+ for the boxedminipage.\\ +framerule+ & +0.4pt+ & The +\fboxrule+ for the boxedminipage.\\ -+align+ & +justified+ & Alignment of the boxedminipage (possible values are \tezt{center}, \tezt{left}, \tezt{right} and \tezt{justified}).\\ ++align+ & +justified+ & Alignment of the boxedminipage (possible values are \stya{center}, \stya{left}, \stya{right} and \stya{justified}).\\ ++putprefix+ & +false+ & The boolean switch for placing prefix and postfix before the filedate. If this option is not entered in the call to \cmda{\getfiledate}, no prefix and no postfix will be inserted (even if the user specifies prefix and postfix in the call to \cmda{\getfiledate}). This option has been necessitated by users who just want to get filedate without any prefix, postfix or filename.\\ ++notime+ & +false+ & The boolean switch for turning the display of time on or off.\\ +boxed+ & +false+ & The boolean switch for enclosing the filedate in a box. If the user simply enters this option without value, it will be assumed to be +true+. If it doesn't appear in the options list, its value is +false+. \end{longtable} \endgroup @@ -118,194 +137,261 @@ The package options are listed in Table~\ref{tab:Package-options} below. \section{Examples} \example -The simplest example is to use the \tezt{\string\getfiledate} macro in the following way: +The simplest example is to use the \cmda{\getfiledate} macro in the following way: \begin{gfdverbatim} -\getfiledate{file={dir/filename.ext}} +\getfiledate[putprefix]{dir/filename.ext} \end{gfdverbatim} -for which the default values of the package options will be used. For the sample file \temt{test1.tex}, the outcome of this will be: +for which the default values of the package options will be used. For the sample file \styb{misc-test1.tex}, the outcome of this will be: -\getfiledate{file={test1.tex}} +\small +\getfiledate[putprefix]{misc-test1.tex} +\normalsize + +\bigskip +The prefix and postfix can be turned off as follows: + +\begin{gfdverbatim} +\getfiledate[putprefix=false]{dir/filename.ext} +\end{gfdverbatim} + +which gives + +\small\getfiledate[putprefix=false]{misc-test1.tex}\normalsize + +\bigskip +If the user needs the prefix and postfix in subsequent calls to \cmda{\getfiledate}, he has to turn them on again---through \stya{putprefix} as follows. Once turned on, they remain in effect until switched off later. + +\begin{gfdverbatim} +\getfiledate[putprefix,marker={$\star$}]{dir/filename.ext} +\end{gfdverbatim} + +which gives + +\small +\getfiledate[putprefix,marker={$\star$}]{misc-test1.tex} +\normalsize \bigskip -You can, however, use package options to customize the format of the result. The following examples illustrate the most important issues in using this package. +The ability to change both the prefix and postfix automatically provides a +babel+ (\ie, multilingual) support. For example, if I want the postfix to be \cmdb{\mrule}, I can simply enter + +\begin{gfdverbatim} +\new\def\mrule{\rule[.5ex]{1cm}{2pt}} +\getfiledate[putprefix,marker={$\star$}, + postfix=\mrule]{dir/filename.ext} +\end{gfdverbatim} + +to get + +\new\def\mrule{\rule[.5ex]{1cm}{2pt}} +\small +\getfiledate[putprefix,marker={$\star$},postfix=\mrule]{misc-test1.tex} +\normalsize + +\bigskip +You can use all package options to customize the format of the result. The following examples illustrate the most important issues in using this package. \example -The example in this section was obtained with the following settings. There are values specified for \tezt{head} and \tezt{foot}. +The example in this section was obtained with the following settings. There are values specified for \stya{head} and \stya{foot}. \begin{gfdverbatim} -\getfiledate{file={test1.tex},head=.1\baselineskip, - foot=2\baselineskip,markercolor=magenta,filenamecolor=purple, - datecolor=orange,inlinespace=.5em,marker=$\blacktriangleright$, - separator -} +\getfiledate[putprefix,postfix,head=.1\baselineskip, + foot=2\baselineskip,markercolor=magenta, + filenamecolor=purple,datecolor=orange, + inlinespace=.5em,marker=$\blacktriangleright$,separator +]{misc-test1.tex} \end{gfdverbatim} -The outcome of this is: -\getfiledate{file={test1.tex},head=.1\baselineskip, - foot=2\baselineskip, +The outcome of this is +\small +\getfiledate[putprefix,postfix, + head=.1\baselineskip,foot=2\baselineskip, markercolor=magenta,filenamecolor=purple,datecolor=orange, inlinespace=.5em,marker=$\blacktriangleright$,separator -} +]{misc-test1.tex} +\normalsize -If you don't need the \tezt{marker}, you can set \tezt{marker=\{\}} as follows +If you don't need the \stya{marker}, you can set \stya{marker=\{\}} as follows \begin{gfdverbatim} -\getfiledate{file={test1.tex},head=\baselineskip, - foot=\baselineskip,width=.6\hsize,filenamecolor=xagreen1, +\getfiledate[head=\baselineskip, + foot=\baselineskip,width=.6\hsize,filenamecolor=xgreen10, prefix=The date of final changes to file, datecolor=orange,inlinespace=.5em,boxed=false, separator=$\spadesuit$,separatorcolor=green, - |color(red)marker={}|color(xbmagenta1),align=center -} + |color(red)marker={}|color(xmagenta20),align=center +]{misc-test1.tex} \end{gfdverbatim} -to get: -\getfiledate{file={test1.tex},head=\baselineskip, +to get +\getfiledate[head=\baselineskip, foot=\baselineskip,width=.6\hsize, prefix=The date of final changes to file, - marker={},filenamecolor=xagreen1,datecolor=orange, + marker={},filenamecolor=xgreen10,datecolor=orange, inlinespace=.5em,align=center,boxed=false, separator=$\spadesuit$,separatorcolor=green -} -If you simply remove \tezt{marker} from the key-value list, the \tezt{marker} will retain the last value you set for it rather than the default value (which is nil). +]{misc-test1.tex} +The same trick can be applied to other keys. If you simply remove \stya{marker} from the key-value list, the \stya{marker} will retain the last value you assigned to it rather than the default value (which is nil). -The user should note: +The user should note the following: \begin{itemize} -\item The inclusion of the \tezt{width} (\tezt{=0.6\string\hsize}) in the above example. The \tezt{width} will maintain this value until it is changed again, as in the following example. +\item The inclusion of the \stya{width} (\stya{=0.6\string\hsize}) in the above example. The \stya{width} will maintain this value until it is changed again, as in the following examples. +\item The assignment to keys can be localized by enclosing the \cmda{\getfiledate} command in a group (\eg, \cmdb{\bgroup} ... \cmdb{\egroup}). -\item The change of \tezt{prefix} here. The default value of \tezt{prefix} is \tezt{The date of last modification of file}. The \tezt{prefix} will maintain this value until it is changed in the next call (see the next example). +\item The change of \stya{prefix} here. The default value of \stya{prefix} is \stya{The date of last modification of file}. The \stya{prefix} will maintain this value until it is changed in the next call (see the next example). +\item The ability to change the \stya{prefix} and \stya{postfix} provides a babel (\ie, multilingual) support, since the user can specify suitable values of these keys. -\item The use of the key-value \tezt{align=center} above. The key \tezt{align} can assume values of \tezt{center}, \tezt{left}, \tezt{right}, and \tezt{justified}. Any other value for \tezt{align} will be rejected by the package. +\item The use of the key-value \stya{align=center} above. The key \stya{align} can assume values of \stya{center}, \stya{left}, \stya{right}, and \stya{justified}. Any other value for \stya{align} will be rejected by the package. +\item Some of the package options (\eg, \stya{notime}) can be submitted via the options list of \cmdb{\documentclass}. \end{itemize} \example The example in this section was obtained with the following settings: \begin{gfdverbatim} -\getfiledate{file={test2.tex},head=0ex,foot=\baselineskip, +\getfiledate[head=0ex,foot=\baselineskip, prefix,width=\hsize,markercolor=magenta,filenamecolor=red, datecolor=violet,inlinespace=.5em,marker=$\triangleright$, separator=$\clubsuit$,separatorcolor=xbgreen1 -} +]{misc-test2.tex} \end{gfdverbatim} The outcome is: -\getfiledate{file={test2.tex},head=0ex, +\getfiledate[head=0ex, foot=1ex,width=\hsize,prefix, markercolor=magenta,filenamecolor=red,datecolor=violet, inlinespace=.5em,marker=$\triangleright$, separator=$\clubsuit$,separatorcolor=red!55!green!65 -} -Here we simply passed the \tezt{prefix} without value so that its default value was used. +]{misc-test2.tex} +Here we simply passed the \stya{prefix} without value so that its default value was used. \example The example in this section was obtained with the following settings: \begin{gfdverbatim} -\getfiledate{file={test3.tex},head=\baselineskip, - foot=2\baselineskip,markercolor=red!65,filenamecolor=blue, +\getfiledate[head=\baselineskip,foot=2\baselineskip, + markercolor=red!65,filenamecolor=blue, datecolor=orange,inlinespace=.5em,marker={$\star$}, separator=$\Diamond$,separatorcolor=red -} +]{misc-test3.tex} \end{gfdverbatim} The outcome is: -\getfiledate{file={test3.tex},head=\baselineskip, +\getfiledate[head=\baselineskip, foot=\baselineskip,markercolor=red!65,filenamecolor=blue, datecolor=orange,inlinespace=.5em,marker={$\star$}, separator=$\Diamond$,separatorcolor=red -} +]{misc-test3.tex} \example The example in this section was obtained with the following settings: \begin{gfdverbatim} -\getfiledate{file={test4.tex},head=\baselineskip,foot=2ex, +\getfiledate[head=\baselineskip,foot=2ex, markercolor=cyan,filenamecolor=blue,datecolor=orange, inlinespace=.5em,marker={$\blacktriangleright$}, markercolor=cyan,separator=$\heartsuit$,separatorcolor -}|color(black) % Use default separatorcolor +]{misc-test4.tex}|color(black) % Use default separatorcolor \end{gfdverbatim} The outcome is: -\getfiledate{file={test4.tex},head=\baselineskip,foot=2ex, +\getfiledate[head=\baselineskip,foot=2ex, markercolor=cyan,filenamecolor=blue,datecolor=orange, inlinespace=.5em,marker={$\blacktriangleright$}, markercolor=cyan,separator=$\heartsuit$,separatorcolor -} +]{misc-test4.tex} \example The example in this section was obtained with the following settings: \begin{gfdverbatim} -\getfiledate{file={test5.tex},head=1ex,foot=1ex, +\getfiledate[head=1ex,foot=1ex, markercolor=purple,filenamecolor=blue, datecolor=orange,inlinespace=.5em, marker={$\blacktriangleright$},separator={} -}|color(black) % The separator is nil here. +]{misc-test5.tex}|color(black) % The separator is nil here. \end{gfdverbatim} The outcome of this is: -\getfiledate{file={test5.tex},head=1ex,foot=1ex, +\getfiledate[head=1ex,foot=1ex, markercolor=purple,filenamecolor=blue,datecolor=orange, inlinespace=.5em,marker={$\blacktriangleright$}, separator={} -} +]{misc-test5.tex} \example -Instead of keeping \tezt{head} and \tezt{foot}, you may instead decide to frame your result, as follows: +Instead of keeping \stya{head} and \stya{foot}, you may instead decide to frame your result, as follows: \begin{gfdverbatim} -\getfiledate{file={test5.tex},head=.5\baselineskip, +\getfiledate[head=.5\baselineskip, foot=.5\baselineskip,width=12.5cm,framesep=5pt,framerule=.4pt, align=center,markercolor=purple,filenamecolor=blue, datecolor=orange,marker={$\blacktriangleright$}, separator=$\heartsuit$,boxed -}|color(black) % marker has no effect here. +]{misc-test5.tex}|color(black) % marker has no effect here. \end{gfdverbatim} The outcome is: -\getfiledate{file={test5.tex},head=.5\baselineskip,foot=.5\baselineskip, +\getfiledate[head=.5\baselineskip,foot=.5\baselineskip, width=12.5cm,framesep=3pt,framerule=.4pt,align=center, markercolor=purple,filenamecolor=blue,datecolor=orange, marker={$\blacktriangleright$},separator=$\heartsuit$, boxed -} +]{misc-test5.tex} -The boolean option \tezt{boxed} has the default value of \tezt{true} when listed in the key-value list. If you set the key \tezt{boxed(=true)} in one call to the \tezt{\string\getfiledate} macro, and you don't want the filedate to be boxed subsequently, you have to turn it off (\ie, enter \tezt{boxed=false}) in the next call to \tezt{\string\getfiledate}. The choice \tezt{boxed(=true)} automatically turns off \tezt{marker} irrespective of whether or not you have submitted a value to this key in \tezt{\string\getfiledate} macro. In the above example, the reader will notice that the setting \tezt{marker=\string\blacktriangleright} has no effect on the outcome. +The boolean option \stya{boxed} has the default value of \stya{true} when listed in the key-value list. If you set the key \stya{boxed(=true)} in one call to the \cmda{\getfiledate} macro, and you don't want the filedate to be boxed subsequently, you have to turn it off (\ie, enter \stya{boxed=false}) in the next call to \cmda{\getfiledate}. The choice \stya{boxed(=true)} automatically turns off \stya{marker} irrespective of whether or not you have submitted a value to this key in \cmda{\getfiledate} macro. In the above example, the reader will notice that the setting \stya{marker=\string\blacktriangleright} has no effect on the outcome. -For the boxed filedates, you can set the options \tezt{framesep} and \tezt{framerule} (equivalents of \LaTeX's native \temt{\string\fboxsep} and \temt{\string\fboxrule}) as follows: +For the boxed filedates, you can set the options \stya{framesep} and \stya{framerule} (equivalents of \LaTeX's native \cmdb{\fboxsep} and \cmdb{\fboxrule}) as follows: \begin{gfdverbatim} -\getfiledate{file={test5.tex},head=\baselineskip, +\getfiledate[head=\baselineskip, foot=1ex,marker={$\blacktriangleright$},markercolor=purple, filenamecolor=blue,width=.9\hsize,datecolor=orange, inlinespace=.5em,align=left,boxed,separator=$\blacklozenge$, - |color(red)framesep=5pt,framerule=2pt|color(xbmagenta1) -} |color(black) % marker has no effect here. + |color(red)framesep=5pt,framerule=2pt|color(xmagenta20) +]{misc-test5.tex} |color(black) % marker has no effect here. \end{gfdverbatim} The outcome of this is: -\getfiledate{file={test5.tex},head=\baselineskip,foot=1ex, +\getfiledate[head=\baselineskip,foot=1ex, markercolor=purple,filenamecolor=blue,datecolor=orange, inlinespace=.5em,marker={$\blacktriangleright$},width=.9\hsize, align=left,boxed,framesep=5pt,framerule=2pt,separator=$\blacklozenge$ -} +]{misc-test5.tex} -The default values of \tezt{framesep} and \tezt{framerule} are 3pt and 0.4pt (\LaTeX's native values for \temt{\string\fboxsep} and \temt{\string\fboxrule}). The user should note that the keys \tezt{framesep} and \tezt{framerule} should, of course, be submitted without backslashes (\eg, \tezt{framesep=5pt} and \tezt{framerule=2pt}). +The default values of \stya{framesep} and \stya{framerule} are 3pt and 0.4pt (\LaTeX's native values for \cmdb{\fboxsep} and \cmdb{\fboxrule}). The user should note that the keys \stya{framesep} and \stya{framerule} should, of course, be submitted without backslashes (\eg, \stya{framesep=5pt} and \stya{framerule=2pt}). -You can change the box color as in +You can change the box frame color as in \begin{gfdverbatim} -\getfiledate{file={test5.tex},head=\baselineskip, +\getfiledate[head=\baselineskip, foot=\baselineskip,markercolor=purple,filenamecolor=blue, datecolor=orange,width=8cm,align=right,boxed,framesep=5pt, - framerule=2pt,separator=$\Diamond$,|color(red)framecolor=green|color(xbmagenta1) -} + framerule=2pt,separator=$\Diamond$,|color(red)framecolor=green|color(xmagenta20) +]{misc-test5.tex} \end{gfdverbatim} The outcome of this is: -\getfiledate{file={test5.tex},head=\baselineskip,foot=\baselineskip, +\getfiledate[head=\baselineskip,foot=\baselineskip, markercolor=purple,filenamecolor=blue,datecolor=orange,width=8cm, inlinespace=.5em,marker={$\blacktriangleright$},align=right, boxed,framesep=5pt,framerule=2pt,separator=$\Diamond$, framecolor=green -} +]{misc-test5.tex} + +This frame color will remain in force until it is changed again. The default value of \stya{framecolor} is \stya{black}. + +\example + +The display of time can be avoided by using the switch \stya{notime}, as follows. +\begin{gfdverbatim} +\getfiledate[notime,head=\baselineskip,foot=1ex, + markercolor=purple,filenamecolor=blue,datecolor=orange, + inlinespace=.5em,marker={$\blacktriangleright$},width=.8\hsize, + align=center,boxed,framecolor=olive!25 +]{misc-test5.tex} +\end{gfdverbatim} + +The outcome of this is: +\getfiledate[notime,head=\baselineskip,foot=1ex, + markercolor=purple,filenamecolor=blue,datecolor=orange, + inlinespace=.5em,marker={$\blacktriangleright$},width=.8\hsize, + align=center,boxed,framecolor=olive!25 +]{misc-test5.tex} + +Notice here that the immediate past values of \stya{framerule} and \stya{framesep} are still in effective. -This box color will remain in force until it is changed again. The default value of \tezt{framecolor} is \tezt{black}. +\section{Postamble} +The record of filedates can be logged in a file (say, \cmdb{\jobname.fds}), but I haven't encountered a real need for it. -\vfil -\centering\fboxrule=2pt\fcolorbox{red}{xbgreen1}{\textbf{Bye}} -\vfil \end{document} \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/getfiledate/getfiledate.sty b/Master/texmf-dist/tex/latex/getfiledate/getfiledate.sty index ea5db858889..987d18bc3bf 100644 --- a/Master/texmf-dist/tex/latex/getfiledate/getfiledate.sty +++ b/Master/texmf-dist/tex/latex/getfiledate/getfiledate.sty @@ -14,36 +14,41 @@ [2009/03/05 v1.0 Get date of last modification of existing file] \NeedsTeXFormat{LaTeX2e} \RequirePackage{etoolbox} +\RequirePackage{ltxnew} \RequirePackage{xkeyval} -\RequirePackage[table]{xcolor} +\@ifpackageloaded{xcolor}{}{\RequirePackage[table]{xcolor}} \RequirePackage{amssymb} \RequirePackage{boxedminipage} -\def\gfd@err#1#2{\PackageError{getfiledate}{#1}{#2}} -\def\gfd@warn#1{\PackageWarningNoLine{getfiledate}{#1}} -\def\gfd@head{0ex} -\def\gfd@foot{0ex} -\def\gfd@prefix{The date of last modification of file} -\def\gfd@marker{$\blacktriangleright$} -\def\gfd@markercolor{blue} -\def\gfd@filenamecolor{blue} -\def\gfd@datecolor{blue} -\def\gfd@inlinespace{1em} -\def\gfd@file{getfiledate.sty} -\let\gfd@align@right\relax -\let\gfd@align@left\relax -\newdimen\gfd@width\gfd@width=\hsize -\newdimen\gfd@width@tmp\gfd@width@tmp=\z@ -\def\gfd@framesep{3pt} -\def\gfd@framerule{0.4pt} -\def\gfd@framecolor{black} -\def\gfd@separatorcolor{black} -\let\gfd@separator\textbullet -\let\T@C\textcolor -\define@boolkey[gfd]{getfiledate}[gfd@]{boxed}[true]{} +\new\long\def\gfd@err#1#2{\PackageError{getfiledate}{#1}{#2}} +\new\long\def\gfd@warn#1{\PackageWarningNoLine{getfiledate}{#1}} +\new\def\gfd@head{0ex} +\new\def\gfd@foot{0ex} +\new\def\gfd@prefix{The date of last modification of file} +\new\def\gfd@postfix{was} +\new\def\gfd@marker{$\blacktriangleright$} +\new\def\gfd@markercolor{blue} +\new\def\gfd@filenamecolor{blue} +\new\def\gfd@datecolor{blue} +\new\def\gfd@inlinespace{1em} +\new\def\gfd@file{getfiledate.sty} +\new\let\gfd@align@right\relax +\new\let\gfd@align@left\relax +\new\dimen\gfd@width\gfd@width=\hsize +\new\dimen\gfd@width@tmp\gfd@width@tmp=\z@ +\new\def\gfd@framesep{3pt} +\new\def\gfd@framerule{0.4pt} +\new\def\gfd@framecolor{black} +\new\def\gfd@separatorcolor{black} +\new\let\gfd@separator\textbullet +\new\let\T@C\textcolor +\providecommand\space{ } +\define@boolkeys[gfd]{getfiledate}[gfd@]{% + boxed,putprefix,notime}[true]{} \define@cmdkey[gfd]{getfiledate}[gfd@]{prefix}[% The date of last modification of file]{} +\define@cmdkey[gfd]{getfiledate}[gfd@]{postfix}[was]{} \define@cmdkey[gfd]{getfiledate}[gfd@]{file}{} -\define@key[gfd]{getfiledate}{width}[\hsize]{\gfd@width=#1} +\define@key[gfd]{getfiledate}{width}[\hsize]{\gfd@width=#1\relax} \define@cmdkey[gfd]{getfiledate}[gfd@]{marker}[$\blacktriangleright$]{} \define@cmdkey[gfd]{getfiledate}[gfd@]{markercolor}[blue]{} \define@cmdkey[gfd]{getfiledate}[gfd@]{filenamecolor}[blue]{} @@ -59,14 +64,14 @@ \define@choicekey*+[gfd]{getfiledate}{align}[\gfd@val\gfd@nr]% {center,right,left,justified}[justified]{% \ifcase\gfd@nr\relax - \def\gfd@align@right{\hfil} - \def\gfd@align@left{\hfil} + \def\gfd@align@right{\hfil}% + \def\gfd@align@left{\hfil}% \or - \def\gfd@align@right{\hfill} + \def\gfd@align@right{\hfill}% \let\gfd@align@left\relax \or \let\gfd@align@right\relax - \def\gfd@align@left{\hfill} + \def\gfd@align@left{\hfill}% \or \let\gfd@align@right\relax \let\gfd@align@left\relax @@ -82,27 +87,26 @@ Use pdfTeX 1.30.0 or later version} \expandafter\endinput } -\long\def\getfiledate#1{% - \setkeys[gfd]{getfiledate}{#1} +\newcommand\getfiledate[2][]{% + \setkeys[gfd]{getfiledate}{#1}% + \setkeys[gfd]{getfiledate}{file={#2}}% \par\vspace{\gfd@head}% \begingroup - \gfd@align@right + \gfd@align@right% \ifgfd@boxed \let\gfd@marker\@empty \def\gfd@inlinespace{\z@} - \fboxsep=\gfd@framesep - \fboxrule=\gfd@framerule - \gfd@width@tmp=\gfd@width - \advance\gfd@width@tmp by 2\fboxsep - \advance\gfd@width@tmp by 2\fboxrule - \color{\gfd@framecolor} + \fboxsep=\gfd@framesep% + \fboxrule=\gfd@framerule% + \gfd@width@tmp=\dimexpr\gfd@width+2\fboxsep+2\fboxrule\relax + \color{\gfd@framecolor}% \begin{boxedminipage}{\gfd@width@tmp}% \normalcolor\gfd@tempa{\gfd@file}\relax \end{boxedminipage}% \else \noindent\gfd@tempa{\gfd@file}% \fi - \gfd@align@left + \gfd@align@left% \endgroup \par\vspace{\gfd@foot}% } @@ -112,23 +116,29 @@ \gfd@tempb\expandafter\@gobbletwo\pdffilemoddate{#1} D:00000000000000\@nil{#1}% }{\gfd@err{File '#1' does not exist or wrong path}{% - Please enter correct filename or path}} + Please enter correct filename and path}} } \newcommand\gfd@tempb[8]{\gfd@tempc{#1#2#3#4}{#5#6}{#7#8}} \newcommand\gfd@tempc[9]{\gfd@tempd{#1}{#2}{#3}{#4#5}{#6#7}{#8#9}} +\def\gfd@prefix@a#1{% + \ifcsempty{gfd@marker}{}{\gfd@marker@a}\relax + \gfd@prefix\space\T@C{\gfd@filenamecolor}{#1}\space\gfd@postfix\space% +} \def\gfd@tempd#1#2#3#4#5#6#7\@nil#8{% \parbox{\gfd@width}{% \@killglue\noindent% - \ifcsempty{gfd@marker}{}{\gfd@marker@a}\relax - \gfd@prefix\space\T@C{\gfd@filenamecolor}{#8}\space - was\space\T@C{\gfd@datecolor}{#1-#2-#3}\space\T@C{\gfd@separatorcolor}{% - \gfd@separator}\space\T@C{\gfd@datecolor}{#4:#5:#6}.% + \ifbool{gfd@putprefix}{\gfd@prefix@a{#8}}{}\ignorespaces + \T@C{\gfd@datecolor}{#1-#2-#3}% + \ifbool{gfd@notime}{}{% + \space\T@C{\gfd@separatorcolor}{\gfd@separator}\space% + \T@C{\gfd@datecolor}{#4:#5:#6}\ignorespaces + }.% } - \@killglue + \@killglue% } \def\gfd@marker@a{% \T@C{\gfd@markercolor}{\gfd@marker}% - \hskip\gfd@inlinespace plus\z@ minus\z@\relax + \leavevmode\hskip\gfd@inlinespace plus\z@ minus\z@\relax } \endinput -- cgit v1.2.3