summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/vhistory/vhistory.sty
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-11-16 11:36:27 +0000
committerNorbert Preining <preining@logic.at>2007-11-16 11:36:27 +0000
commit4adbea2c56b6d6306b139ba9de0b60e4e0a2dc26 (patch)
tree9d19c15d43a7d1d3e6a45321fe288d6267e337ec /Master/texmf-dist/tex/latex/vhistory/vhistory.sty
parentb7899e95726c10175f384c1bf7baadbab493336d (diff)
vhistory 2007-07-21
git-svn-id: svn://tug.org/texlive/trunk@5467 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/vhistory/vhistory.sty')
-rw-r--r--Master/texmf-dist/tex/latex/vhistory/vhistory.sty68
1 files changed, 45 insertions, 23 deletions
diff --git a/Master/texmf-dist/tex/latex/vhistory/vhistory.sty b/Master/texmf-dist/tex/latex/vhistory/vhistory.sty
index 4ec66de33f8..32f728e04a1 100644
--- a/Master/texmf-dist/tex/latex/vhistory/vhistory.sty
+++ b/Master/texmf-dist/tex/latex/vhistory/vhistory.sty
@@ -3,8 +3,8 @@
%% FILE: vhistory.sty %%
%% %%
%% AUTHOR: Jochen Wertenauer %%
-%% VERSION: 1.1 %%
-%% DATE: 2005-04-12 %%
+%% VERSION: 1.3 %%
+%% DATE: 2007-07-21 %%
%% %%
%% LICENSE: This program may be distributed and/or modified under the %%
%% conditions of the LaTeX Project Public License, either version 1.2 %%
@@ -42,6 +42,8 @@
%% - owncaptions: You have to specify your own names for the captions. Use %%
%% this option if you are using a language that is not %%
%% supported. %%
+%% - hideauthorcolumn: The history of versions does not contain the column %%
+%% listing the name(s) of the author(s). %%
%% %%
%% REQUIRED PACKAGES: %%
%% - sets: Works well with version 0.6 or higher %%
@@ -81,6 +83,7 @@
%% Helper methods ------------------------------------------------------------
\let \xpa=\expandafter
\let \nxp=\noexpand
+\def \vh@iwrite{\immediate\write}
\long\def \vh@ReturnFi #1\fi{\fi #1}
@@ -93,7 +96,7 @@
%% This macro writes #2 verbatim to the (open) file #1.
\long \def \vh@verbwrite #1#2{%
\long \def \vh@verbtemp{#2}%
- \xpa\write\xpa#1\xpa{\xpa\vh@eraseToBrace \meaning\vh@verbtemp}%
+ \xpa\vh@iwrite\xpa#1\xpa{\xpa\vh@eraseToBrace \meaning\vh@verbtemp}%
}
%% Deletes everything before the next > e.g. "macro ->". Used by \vh@verbprint
@@ -102,7 +105,6 @@
%% Multilanguage support -----------------------------------------------------
\def \vh@setcaptions{%
- \ifnum \vh@owncaptions=0% Defined by the options
\vh@EnglishCaptions %Default
\vh@Ifundefined{l@ngerman}\else
\ifnum \language=\l@ngerman\relax
@@ -119,7 +121,6 @@
\vh@GermanCaptions
\fi
\fi
- \fi
}
\def \vh@EnglishCaptions{%
@@ -143,10 +144,12 @@
\def \vh@tocentry{0} % By default, there will be no entry in the toc
\def \vh@nochapter{0} % By default, a new chapter will be started
\def \vh@owncaptions{0} % By default, the build in captions are used.
+\def \vh@hideauthor{0} % By default, the authors of a change are shown
-\DeclareOption{tocentry}{\def \vh@tocentry{1}}
-\DeclareOption{nochapter}{\def \vh@chapter{}}
-\DeclareOption{owncaptions}{\vh@setcaptions \def \vh@owncaptions{1}}
+\DeclareOption{tocentry}{\def \vh@tocentry{1}}%
+\DeclareOption{nochapter}{\def \vh@chapter{}}%
+\DeclareOption{owncaptions}{\vh@setcaptions \def \vh@owncaptions{1}}%
+\DeclareOption{hideauthorcolumn}{\def \vh@hideauthor{1}}%
%% This macro starts a new chapter. If \chapter is undefined, \section is
%% used (To work with document class article). The option nochapter will
@@ -157,12 +160,14 @@
% Since chapter is undefined, we try section. If section is
% undefined, too we've got a problem. The User should use the option
% nochapter in this case.
+ \markright{\vhhistoryname}%
\ifnum \vh@tocentry=1\relax
\section{\vhhistoryname}%
\else
\section*{\vhhistoryname}%
\fi
\else
+ \markboth{\vhhistoryname}{\vhhistoryname}%
\ifnum \vh@tocentry=1\relax
\chapter{\vhhistoryname}%
\else
@@ -192,13 +197,12 @@
%% Prints the contents of \vhAllAuthorsSet but regards the elements as
%% commands. Instead of XY, the definition of the command \XY will be used.
%% If \XY is undefined, \relax is used.
-\def \vhListAllAuthorsLong{\xpa\vh@longlistset \vhAllAuthorsSet|\endset}
+\def \vhListAllAuthorsLong{\xpa\vh@longlistset \vhAllAuthorsSet|\empty\endset}
%% Helper method for \vhListAllAuthorsLong.
\def \vh@longlistset #1|#2\endset{%
- \def \vh@tempset{#2}%
\csname #1\endcsname % Create command and expand
- \ifx\vh@tempset\empty{}\else
+ \ifx#2\empty{}\else
\setseparator
\vh@ReturnFi{\vh@longlistset #2\endset}%
\fi
@@ -230,7 +234,9 @@
\vh@declarevhEntry
\vh@writeTable
\newsetsimple \vhAllAuthorsSet{}%
- \vh@setcaptions
+ \ifnum \vh@owncaptions=0\relax% Defined by the options
+ \vh@setcaptions
+ \fi
\vh@chapter
}{
\vh@writeEndTable
@@ -262,7 +268,9 @@
\vh@add{##3}%
\vh@verbwrite \vh@verfile {##1}%
\vh@verbwrite \vh@verfile { & ##2}%
- \vh@verbwrite \vh@verfile { & \listset{##3}}%
+ \ifnum \vh@hideauthor=0\relax
+ \vh@verbwrite \vh@verfile { & \listset{##3}}%
+ \fi
\vh@verbwrite \vh@verfile { & ##4\\}
}%
}
@@ -293,28 +301,42 @@
%%
\def \vh@writeHstFile{%
\newwrite \vh@hstfile%
- \openout \vh@hstfile=\jobname.hst%
- \write \vh@hstfile {%
+ \immediate \openout \vh@hstfile=\jobname.hst%
+ \vh@iwrite \vh@hstfile {%
\def \nxp\vhCurrentVersion{\vh@verbprint\vhCurrentVersion}}%
- \write \vh@hstfile {%
+ \vh@iwrite \vh@hstfile {%
\def \nxp\vhCurrentDate{\vh@verbprint\vhCurrentDate}}%
- \write \vh@hstfile {%
+ \vh@iwrite \vh@hstfile {%
\nxp\newsetsimple \nxp\vhAllAuthorsSet{\vh@verbprint\vhAllAuthorsSet}}%
- \closeout \vh@hstfile%
+ \immediate \closeout \vh@hstfile%
}
+\def \vh@showAuthorHead{%
+ \vh@verbwrite \vh@verfile {%
+ \begin{longtable}{@{}ll>{\hsize=.5\hsize}X>{\hsize=1.5\hsize}X@{}}%
+ }
+}
+
+\def \vh@hideAuthorHead{%
+ \vh@verbwrite \vh@verfile {\begin{longtable}{@{}llX@{}}}
+}
%% This macro is called at the beginning of a versionhistory environment. It
%% writes the head of the resulting table to the file \jobname.ver. The table
%% itself is a LTXtable, i.e. a longtable with the parameterset of tabularx.
%%
\def \vh@writeTable{%
- \openout \vh@verfile=\jobname.ver%
- \vh@verbwrite \vh@verfile%
- {\begin{longtable}{ll>{\hsize=.5\hsize}X>{\hsize=1.5\hsize}X}}%
+ \immediate \openout \vh@verfile=\jobname.ver%
+ \ifnum \vh@hideauthor=0\relax
+ \vh@showAuthorHead
+ \else
+ \vh@hideAuthorHead
+ \fi
\vh@verbwrite \vh@verfile {\textbf{\vhversionname}}%
\vh@verbwrite \vh@verfile { & \textbf{\vhdatename}}%
- \vh@verbwrite \vh@verfile { & \textbf{\vhauthorname}}%
+ \ifnum \vh@hideauthor=0\relax
+ \vh@verbwrite \vh@verfile { & \textbf{\vhauthorname}}%
+ \fi
\vh@verbwrite \vh@verfile { & \textbf{\vhchangename}\\[1ex]}%
}
@@ -323,7 +345,7 @@
%%
\def \vh@writeEndTable{%
\vh@verbwrite \vh@verfile{\end{longtable}}%
- \closeout \vh@verfile%
+ \immediate \closeout \vh@verfile%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%