summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/svninfo/svninfo.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-04-02 18:57:27 +0000
committerKarl Berry <karl@freefriends.org>2007-04-02 18:57:27 +0000
commit363b13706a7bf98b8db87860873492eec4be6295 (patch)
tree5c9aa92b401685616238b34cc614d6116616561e /Master/texmf-dist/tex/latex/svninfo/svninfo.sty
parent7d7fb8482d1f1b56ae7d0a5e25ab6b5b16170af1 (diff)
svninfo 0.7 update (27mar07)
git-svn-id: svn://tug.org/texlive/trunk@4096 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/svninfo/svninfo.sty')
-rw-r--r--Master/texmf-dist/tex/latex/svninfo/svninfo.sty143
1 files changed, 115 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/latex/svninfo/svninfo.sty b/Master/texmf-dist/tex/latex/svninfo/svninfo.sty
index 6a9661c099a..2a49fbc3b04 100644
--- a/Master/texmf-dist/tex/latex/svninfo/svninfo.sty
+++ b/Master/texmf-dist/tex/latex/svninfo/svninfo.sty
@@ -21,6 +21,7 @@
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% `svninfo' package to use with LaTeX2e.
@@ -29,7 +30,7 @@
%% by the Subversion revision control system.
%%
%% Copyright (C) 1995 Dr. Juergen Vollmer
-%% Copyright (C) 2003-2006 Achim D. Brucker
+%% Copyright (C) 2003-2007 Achim D. Brucker
%%
%% License:
%% This program can be redistributed and/or modified under the terms
@@ -57,11 +58,15 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
+
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{svninfo}[2006/05/11 v0.6]
+\ProvidesPackage{svninfo}[2007/03/26 v0.8]
\newcount\@svnInfoDay
\newcount\@svnInfoMonth
\newcount\@svnInfoYear
+\newcount\@svnInfoMaxDay
+\newcount\@svnInfoMaxMonth
+\newcount\@svnInfoMaxYear
\newif\if@svnInfoToday@
\DeclareOption{today}{
\@svnInfoToday@true
@@ -81,10 +86,14 @@
\DeclareOption{draft}{
\@svnInfoDraft@true
}
+\newif\if@svnInfoNotPreamble@%
+\@svnInfoNotPreamble@false%
\newif\if@svnInfoUseFancy@
\newif\if@svnInfoUseFancyhdr@
\newif\if@svnInfoUseScrpage@
\newif\if@svnInfoUseEsofoot@
+\newif\if@svnInfoUseMargin@
+\newif\if@svnInfoSVK@
\DeclareOption{fancy}{
\@svnInfoUseFancy@true
\@svnInfoUseFancyhdr@false
@@ -109,6 +118,12 @@
\@svnInfoUseScrpage@false
\@svnInfoUseEsofoot@true
}
+\DeclareOption{margin}{
+ \@svnInfoUseMargin@true
+}
+\DeclareOption{svk}{
+ \@svnInfoSVK@true
+}
\DeclareOption{nofancy}{
\@svnInfoUseFancy@false
\@svnInfoUseFancyhdr@false
@@ -155,8 +170,8 @@
}
\def\svnInfo {\@svnBeginRead
- \@svnInfoReadArgs
-}
+ \@svnInfoReadArgs
+ }
\def\@svnInfoReadArgs #1Id#2 {\@svnEndRead
@@ -186,11 +201,17 @@
\def\svnInfoFile{#1}%
\def\svnInfoRevision{#2}%
\ifthenelse{\(\equal{\svnInfoMaxRevision}{--maxrevision--}\) %
- \OR \( #2 > \svnInfoMaxRevision \)}{\def\svnInfoMaxRevision{#2}}{}%
+ \OR \( #2 > \svnInfoMaxRevision \)}{%
+ \@svnInfoMaxYear =\@svnInfoYear
+ \@svnInfoMaxMonth =\@svnInfoMonth
+ \@svnInfoMaxDay =\@svnInfoDay
+ \def\svnInfoMaxRevision{#2}%
+ }{}%
\ifthenelse{\(\equal{\svnInfoMinRevision}{--minrevision--}\) %
\OR \( #2 < \svnInfoMinRevision \)}{\def\svnInfoMinRevision{#2}}{}%
\def\svnInfoTime{#4}%
\@svnInfoSplitDate x#3x%
+ \@svnInfoMargin%
\def\svnInfoLongDate{\@svnInfoToday}%
\if@svnInfoToday@
\year =\@svnInfoYear
@@ -205,11 +226,19 @@
\expandafter\@svnInfoEat
\fi
}
-\def\@svnInfoSplitDate x#1-#2-#3x{%
- \@svnInfoDay =#3\relax
- \@svnInfoMonth=#2\relax
- \@svnInfoYear =#1\relax
+\if@svnInfoSVK@
+ \def\@svnInfoSplitDate x#1-#2-#3T#4Zx{%
+ \@svnInfoDay =#3\relax
+ \@svnInfoMonth=#2\relax
+ \@svnInfoYear =#1\relax
}
+\else%
+ \def\@svnInfoSplitDate x#1-#2-#3x{%
+ \@svnInfoDay =#3\relax
+ \@svnInfoMonth=#2\relax
+ \@svnInfoYear =#1\relax
+}
+\fi%
\def\@svnInfoToday {%
\begingroup
\year =\@svnInfoYear
@@ -218,11 +247,22 @@
\svnToday
\endgroup
}
+\def\@svnInfoMaxToday {%
+ \begingroup
+ \year =\@svnInfoMaxYear
+ \month =\@svnInfoMaxMonth
+ \day =\@svnInfoMaxDay
+ \svnToday
+ \endgroup
+}
\def\@svnInfoDefaults {%
\@svnInfoYear =\year
\@svnInfoMonth =\month
\@svnInfoDay =\day
+ \@svnInfoMaxYear =\year
+ \@svnInfoMaxMonth =\month
+ \@svnInfoMaxDay =\day
\def\svnInfoFile{--sourcefile--}%
\def\svnInfoHeadURL{--head-url--}%
\def\svnInfoDate{\the\@svnInfoYear-\two@digits\@svnInfoMonth-%
@@ -236,6 +276,7 @@
\def\svnInfoMonth{\the\@svnInfoMonth}%
\def\svnInfoDay{\the\@svnInfoDay}%
\def\svnInfoLongDate{\@svnInfoToday}%
+ \ifthenelse{\isundefined{\svnInoMaxToday}}{\def\svnMaxToday{\@svnInfoMaxToday}}{}%
\def\svnId{\svnInfoFile\ \svnInfoRevision\ \svnInfoTime\ \svnInfoOwner}%
}
@@ -265,18 +306,31 @@
\setlength{\plainfootrulewidth}{0.4pt}%
\fi
\fi
- \if@svnInfoDraft@
+ \if@svnInfoDraft@
\if@svnInfoUseFancyhdr@
- \fancyfoot[LE,RO]{\@svnInfoFancyInfo}%
- \fancyfoot[LO,RE]{\@svnInfoFancyFile}%
- \fancyfoot[CO,CE]{\thepage}%
- \renewcommand{\footrulewidth}{0.4pt}%
- \fancypagestyle{plain}{%
- \fancyfoot[LE,RO]{\@svnInfoFancyInfo}%
- \fancyfoot[LO,RE]{\@svnInfoFancyFile}%
- \fancyfoot[CO,CE]{\thepage}%
- \renewcommand{\footrulewidth}{0.4pt}%
- }
+ \if@twoside
+ \fancyfoot[LE,RO]{\@svnInfoFancyInfo}%
+ \fancyfoot[LO,RE]{\@svnInfoFancyFile}%
+ \fancyfoot[CO,CE]{\thepage}%
+ \renewcommand{\footrulewidth}{0.4pt}%
+ \fancypagestyle{plain}{%
+ \fancyfoot[LE,RO]{\@svnInfoFancyInfo}%
+ \fancyfoot[LO,RE]{\@svnInfoFancyFile}%
+ \fancyfoot[CO,CE]{\thepage}%
+ \renewcommand{\footrulewidth}{0.4pt}%
+ }
+ \else
+ \fancyfoot[L]{\@svnInfoFancyInfo}%
+ \fancyfoot[R]{\@svnInfoFancyFile}%
+ \fancyfoot[C]{\thepage}%
+ \renewcommand{\footrulewidth}{0.4pt}%
+ \fancypagestyle{plain}{%
+ \fancyfoot[L]{\@svnInfoFancyInfo}%
+ \fancyfoot[R]{\@svnInfoFancyFile}%
+ \fancyfoot[C]{\thepage}%
+ \renewcommand{\footrulewidth}{0.4pt}%
+ }
+ \fi
\fi
\fi
\if@svnInfoDraft@
@@ -299,9 +353,25 @@
\fi
\fi
}
+\def\@svnInfoMargin{
+ \if@svnInfoDraft@
+ \if@svnInfoNotPreamble@
+ \if@svnInfoUseMargin@
+ \expandafter\marginpar[%
+ {\raggedleft\tiny\svnInfoFile, \svnInfoRevision, %
+ \svnInfoDate, \svnInfoTime, \svnInfoOwner}%
+ ]{%
+ {\raggedright\tiny\svnInfoFile, \svnInfoRevision, %
+ \svnInfoDate, \svnInfoTime, \svnInfoOwner}%
+ }%
+\fi
+\fi
+\fi
+}
\@svnInfoDefaults
\AtBeginDocument{%
+ \@svnInfoNotPreamble@true
\if@svnInfoDraft@
\if@svnInfoUseFancy@
\@svnInfoFancyFoot
@@ -320,6 +390,7 @@
\AtEndDocument{%
\immediate\write\@mainaux{\string\gdef\string\svnInfoMinRevision{\svnInfoMinRevision}}%
\immediate\write\@mainaux{\string\gdef\string\svnInfoMaxRevision{\svnInfoMaxRevision}}%
+ \immediate\write\@mainaux{\string\gdef\string\svnMaxToday{\immediate\svnMaxToday}}%
}
\def\svnKeyword $#1${\svn@$#1: $}
\let\svnKeywordempty\relax
@@ -347,18 +418,34 @@
\svn@parse@date$#2$%
}%
\let\svnKeyword@LastChangedDate@exp\svnKeyword@Date@exp
+\if@svnInfoSVK@
+ \def\svn@parse@date$#1-#2-#3T#4:#5:#6.#7${%
+ \@svnInfoDay =#3\relax%
+ \@svnInfoMonth=#2\relax%
+ \@svnInfoYear =#1\relax%
+ \def\svnInfoLongDate{\@svnInfoToday}%
+ \if@svnInfoToday@
+ \year =\@svnInfoYear
+ \month =\@svnInfoMonth
+ \day =\@svnInfoDay
+ \fi
+ \def\svnInfoTime{#4:#5:#6}%
+ }
+\else
\def\svn@parse@date$#1-#2-#3 #4:#5:#6 #7${%
+
\@svnInfoDay =#3\relax%
\@svnInfoMonth=#2\relax%
\@svnInfoYear =#1\relax%
- \def\svnInfoLongDate{\@svnInfoToday}%
- \if@svnInfoToday@
- \year =\@svnInfoYear
- \month =\@svnInfoMonth
- \day =\@svnInfoDay
- \fi
- \def\svnInfoTime{#4:#5:#6}%
-}
+ \def\svnInfoLongDate{\@svnInfoToday}%
+ \if@svnInfoToday@
+ \year =\@svnInfoYear
+ \month =\@svnInfoMonth
+ \day =\@svnInfoDay
+ \fi
+ \def\svnInfoTime{#4:#5:#6}%
+ }
+\fi
\def\svnKeyword@Id@unexp#1#2{}%
\def\svnKeyword@Id@exp#1#2{%