diff options
author | Karl Berry <karl@freefriends.org> | 2009-10-08 22:33:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-10-08 22:33:26 +0000 |
commit | 43f76defc822924473d9111705a67904cfd1276b (patch) | |
tree | 317933fa983e75ee54d175231513a7be6bfbf8c6 /Master | |
parent | b676d1c3d9ca7308407a66f16654586bc0259090 (diff) |
getfiledate 1.0 (7oct09)
git-svn-id: svn://tug.org/texlive/trunk@15701 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.pdf | bin | 113045 -> 117059 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.tex | 102 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/getfiledate/getfiledate.sty | 76 |
3 files changed, 109 insertions, 69 deletions
diff --git a/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.pdf b/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.pdf Binary files differindex 6246098c406..ad75071b8cf 100644 --- a/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.pdf +++ b/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.pdf diff --git a/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.tex b/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.tex index 634f2cf5500..147523a9e43 100644 --- a/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.tex +++ b/Master/texmf-dist/doc/latex/getfiledate/getfiledate-guide.tex @@ -35,6 +35,7 @@ \new\def\styb#1{\TC{teal}{\texttt{#1}}} \new\def\cmda#1{\stya{\string#1}} \new\def\cmdb#1{\styb{\string#1}} +\new\def\cmdc#1{\stya{#1\string\hsize}} \def\ie{i.e.\xspace} \newcounter{examplecnt}[section] \new\def\example{% @@ -91,7 +92,7 @@ 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{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. +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 filenames. The \cmda{\getfiledate} macro sets the various options. The \cmdb{\documentclass} and \cmda{\usepackage\{getfiledate\}} options lists may, however, be used to set options that apply throughout the document. \section{Package options\label{sec:PackageOptions}} The package options are listed in Table~\ref{tab:Package-options} below. @@ -103,10 +104,10 @@ The package options are listed in Table~\ref{tab:Package-options} below. \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\\ +\bf Option & \bf Default & \bf Meaning\\ \endfirsthead \multicolumn{3}{|l|}{\emph{Continued from last page}}\\ -\bfseries Option&\bfseries Default&\bfseries Meaning\\ +\bf Option & \bf Default & \bf Meaning\\ \endhead \multicolumn{3}{|r|}{\emph{Continued on next page}}\\ \endfoot @@ -123,12 +124,12 @@ The package options are listed in Table~\ref{tab:Package-options} below. +datecolor+ & +blue+ & The color of filedate.\\ +inlinespace+ & +1em+ & The horizontal separation between the marker and the filedate.\\ +separator+ & +\textbullet+ & The marker between the filedate and filetime.\\ -+separatorcolor+ & +black+ & The color of the separator.\\ ++sepcolor+ & +black+ & The color of the separator.\\ +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 \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.\\ ++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} @@ -156,16 +157,19 @@ The prefix and postfix can be turned off as follows: which gives -\small\getfiledate[putprefix=false]{misc-test1.tex}\normalsize +\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. +The setting \begin{gfdverbatim} \getfiledate[putprefix,marker={$\star$}]{dir/filename.ext} \end{gfdverbatim} -which gives +gives \small \getfiledate[putprefix,marker={$\star$}]{misc-test1.tex} @@ -175,14 +179,14 @@ which gives 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}} +\new\def\mrule{\rule[.2ex]{.5cm}{3pt}} \getfiledate[putprefix,marker={$\star$}, postfix=\mrule]{dir/filename.ext} \end{gfdverbatim} to get -\new\def\mrule{\rule[.5ex]{1cm}{2pt}} +\new\def\mrule{\rule[.2ex]{.5cm}{3pt}} \small \getfiledate[putprefix,marker={$\star$},postfix=\mrule]{misc-test1.tex} \normalsize @@ -209,37 +213,80 @@ The outcome of this is ]{misc-test1.tex} \normalsize -If you don't need the \stya{marker}, you can set \stya{marker=\{\}} as follows +If you don't need the \stya{marker}, you can simply enter \stya{marker} without value as follows + \begin{gfdverbatim} \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(xmagenta20),align=center + separator=$\spadesuit$,sepcolor=green,|color(red)marker|color(xmagenta20),align=center ]{misc-test1.tex} \end{gfdverbatim} + to get + \getfiledate[head=\baselineskip, foot=\baselineskip,width=.6\hsize, prefix=The date of final changes to file, - marker={},filenamecolor=xgreen10,datecolor=orange, + marker,filenamecolor=xgreen10,datecolor=orange, inlinespace=.5em,align=center,boxed=false, - separator=$\spadesuit$,separatorcolor=green + separator=$\spadesuit$,sepcolor=green +]{misc-test1.tex} + +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). + +\example + +Unlike the case of the \stya{marker}, if you don't need the \stya{separator}, you would have to enter \stya{separator=\{\}} or simply \stya{separator=} as follows + +\begin{gfdverbatim} +\getfiledate[head=\baselineskip,foot=\baselineskip, + width=.6\hsize,filenamecolor=xgreen10, + prefix=The date of final changes to file, + datecolor=orange,inlinespace=.5em,boxed=false, + |color(red)separator=,|color(xmagenta20)sepcolor=green,marker,align=center ]{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). +\end{gfdverbatim} -The user should note the following: +to get +\getfiledate[head=\baselineskip, + foot=\baselineskip,width=.6\hsize, + prefix=The date of final changes to file, + marker,filenamecolor=xgreen10,datecolor=orange, + inlinespace=.5em,align=center,boxed=false, + separator=,sepcolor=green +]{misc-test1.tex} + +The same trick can be applied to some other keys. If you simply remove the \stya{separator} from the key-value list, the \stya{separator} will retain the last value you assigned to it rather than the default value (which is \cmda{\textbullet}). If in the subsequent calls to \cmda{\getfiledate}, you need the \stya{separator}, you would have to specify it or (to use the default value) simply enter \stya{separator} without value. + +\textbf{Notes}: The user should note the following: \begin{itemize} -\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 inclusion of the \stya{width} (\cmdc{0.6}) in the above example. The \stya{width} will maintain this value until it is changed again, as in the following examples. + +\item If you enter \stya{putprefix=false} and you want the outcome centered, you should remember to set the right \stya{width}. For example, the following will not be centered, simply because the value of \stya{width} is \cmdc{0.8}: + + \begin{gfdverbatim} + \getfiledate[putprefix=false,align=center, + width=0.8\hsize,separator]{dir/filename.ext} + \end{gfdverbatim} + + which gives + + \getfiledate[putprefix=false,align=center,width=0.8\hsize,separator]{misc-test1.tex} + + Setting \cmdc{width=.3} gives the desired result: + + \getfiledate[putprefix=false,align=center,width=0.3\hsize,separator]{misc-test1.tex} + \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 \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 \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}. +\item Some of the package options (\eg, \stya{putprefix}, \stya{notime}) can be submitted globally via the options list of \cmdb{\documentclass}. \end{itemize} \example @@ -248,7 +295,7 @@ The example in this section was obtained with the following settings: \getfiledate[head=0ex,foot=\baselineskip, prefix,width=\hsize,markercolor=magenta,filenamecolor=red, datecolor=violet,inlinespace=.5em,marker=$\triangleright$, - separator=$\clubsuit$,separatorcolor=xbgreen1 + separator=$\clubsuit$,sepcolor=xbgreen1 ]{misc-test2.tex} \end{gfdverbatim} @@ -257,17 +304,17 @@ The outcome is: foot=1ex,width=\hsize,prefix, markercolor=magenta,filenamecolor=red,datecolor=violet, inlinespace=.5em,marker=$\triangleright$, - separator=$\clubsuit$,separatorcolor=red!55!green!65 + separator=$\clubsuit$,sepcolor=red!55!green!65 ]{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[head=\baselineskip,foot=2\baselineskip, +\getfiledate[head=\baselineskip,foot=\baselineskip, markercolor=red!65,filenamecolor=blue, datecolor=orange,inlinespace=.5em,marker={$\star$}, - separator=$\Diamond$,separatorcolor=red + separator=$\Diamond$,sepcolor=red ]{misc-test3.tex} \end{gfdverbatim} @@ -275,24 +322,25 @@ The outcome is: \getfiledate[head=\baselineskip, foot=\baselineskip,markercolor=red!65,filenamecolor=blue, datecolor=orange,inlinespace=.5em,marker={$\star$}, - separator=$\Diamond$,separatorcolor=red + separator=$\Diamond$,sepcolor=red ]{misc-test3.tex} \example + The example in this section was obtained with the following settings: \begin{gfdverbatim} \getfiledate[head=\baselineskip,foot=2ex, - markercolor=cyan,filenamecolor=blue,datecolor=orange, + filenamecolor=blue,datecolor=orange, inlinespace=.5em,marker={$\blacktriangleright$}, - markercolor=cyan,separator=$\heartsuit$,separatorcolor -]{misc-test4.tex}|color(black) % Use default separatorcolor + markercolor=cyan,separator=$\heartsuit$,sepcolor +]{misc-test4.tex}|color(black) % Use default sepcolor \end{gfdverbatim} The outcome is: \getfiledate[head=\baselineskip,foot=2ex, markercolor=cyan,filenamecolor=blue,datecolor=orange, inlinespace=.5em,marker={$\blacktriangleright$}, - markercolor=cyan,separator=$\heartsuit$,separatorcolor + separator=$\heartsuit$,sepcolor ]{misc-test4.tex} \example diff --git a/Master/texmf-dist/tex/latex/getfiledate/getfiledate.sty b/Master/texmf-dist/tex/latex/getfiledate/getfiledate.sty index 987d18bc3bf..0a8b452581e 100644 --- a/Master/texmf-dist/tex/latex/getfiledate/getfiledate.sty +++ b/Master/texmf-dist/tex/latex/getfiledate/getfiledate.sty @@ -11,7 +11,7 @@ % (c) Ahmed Musa 2009 % %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% \ProvidesPackage{getfiledate} - [2009/03/05 v1.0 Get date of last modification of existing file] + [2009/10/05 v1.0 Get date of last modification of existing file] \NeedsTeXFormat{LaTeX2e} \RequirePackage{etoolbox} \RequirePackage{ltxnew} @@ -21,35 +21,18 @@ \RequirePackage{boxedminipage} \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\let\gfd@alignright\relax +\new\let\gfd@alignleft\relax \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@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\relax} -\define@cmdkey[gfd]{getfiledate}[gfd@]{marker}[$\blacktriangleright$]{} +\define@cmdkey[gfd]{getfiledate}[gfd@]{file}[nofile.tex]{} +\define@cmdkey[gfd]{getfiledate}[gfd@]{width}[\hsize]{} +\define@cmdkey[gfd]{getfiledate}[gfd@]{marker}[]{} \define@cmdkey[gfd]{getfiledate}[gfd@]{markercolor}[blue]{} \define@cmdkey[gfd]{getfiledate}[gfd@]{filenamecolor}[blue]{} \define@cmdkey[gfd]{getfiledate}[gfd@]{datecolor}[blue]{} @@ -60,39 +43,47 @@ \define@cmdkey[gfd]{getfiledate}[gfd@]{framerule}[0.4pt]{} \define@cmdkey[gfd]{getfiledate}[gfd@]{separator}[\textbullet]{} \define@cmdkey[gfd]{getfiledate}[gfd@]{framecolor}[black]{} -\define@cmdkey[gfd]{getfiledate}[gfd@]{separatorcolor}[black]{} +\define@cmdkey[gfd]{getfiledate}[gfd@]{sepcolor}[black]{} +\define@cmdkey[gfd]{getfiledate}[gfd@]{separator}[\textbullet]{} \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@alignright{\hfil}% + \def\gfd@alignleft{\hfil}% \or - \def\gfd@align@right{\hfill}% - \let\gfd@align@left\relax + \def\gfd@alignright{\hfill}% + \let\gfd@alignleft\relax \or - \let\gfd@align@right\relax - \def\gfd@align@left{\hfill}% + \let\gfd@alignright\relax + \def\gfd@alignleft{\hfill}% \or - \let\gfd@align@right\relax - \let\gfd@align@left\relax + \let\gfd@alignright\relax + \let\gfd@alignleft\relax \fi }{% \gfd@err{Inadmissible value '#1' for align} } \DeclareOptionX*{\gfd@warn{Unknown option '\CurrentOption' ignored}} -\ExecuteOptionsX[gfd]<getfiledate>{} +\ExecuteOptionsX[gfd]<getfiledate>[notime,boxed]{% + align=center,head,foot,prefix,postfix,marker,markercolor, + filenamecolor,datecolor,inlinespace,file,width,framesep, + framerule,framecolor,sepcolor,separator,putprefix +} \ProcessOptionsX*[gfd]<getfiledate>\relax +\begingroup \ifcsdef{pdffilemoddate}{}{% \gfd@err{Missing command \string\pdffilemoddate}{% Use pdfTeX 1.30.0 or later version} - \expandafter\endinput + \aftergroup\endinput } +\endgroup \newcommand\getfiledate[2][]{% \setkeys[gfd]{getfiledate}{#1}% \setkeys[gfd]{getfiledate}{file={#2}}% \par\vspace{\gfd@head}% \begingroup - \gfd@align@right% + \gfd@alignright% + \mbox{% \ifgfd@boxed \let\gfd@marker\@empty \def\gfd@inlinespace{\z@} @@ -106,7 +97,8 @@ \else \noindent\gfd@tempa{\gfd@file}% \fi - \gfd@align@left% + }% + \gfd@alignleft% \endgroup \par\vspace{\gfd@foot}% } @@ -120,22 +112,22 @@ } \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% \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% + \space\T@C{\gfd@sepcolor}{\gfd@separator}\space% \T@C{\gfd@datecolor}{#4:#5:#6}\ignorespaces }.% } \@killglue% } +\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@marker@a{% \T@C{\gfd@markercolor}{\gfd@marker}% \leavevmode\hskip\gfd@inlinespace plus\z@ minus\z@\relax |