diff options
author | Karl Berry <karl@freefriends.org> | 2009-08-20 15:19:11 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-08-20 15:19:11 +0000 |
commit | 2676ec53a3a60a68a924d6024cc89454d458970c (patch) | |
tree | 0e36f7280852d84eb89f93843ed409ad831356bc /Master/texmf-dist/tex/latex/getfiledate | |
parent | a4b9e95309a563c5cf369f93add6957b76230bba (diff) |
getfiledate update (8aug09)
git-svn-id: svn://tug.org/texlive/trunk@14780 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/getfiledate')
-rw-r--r-- | Master/texmf-dist/tex/latex/getfiledate/getfiledate.sty | 100 |
1 files changed, 55 insertions, 45 deletions
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 |