From 4adbea2c56b6d6306b139ba9de0b60e4e0a2dc26 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 16 Nov 2007 11:36:27 +0000 Subject: vhistory 2007-07-21 git-svn-id: svn://tug.org/texlive/trunk@5467 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/vhistory/sets.sty | 15 +++-- Master/texmf-dist/tex/latex/vhistory/vhistory.sty | 68 +++++++++++++++-------- 2 files changed, 52 insertions(+), 31 deletions(-) (limited to 'Master/texmf-dist/tex/latex/vhistory') diff --git a/Master/texmf-dist/tex/latex/vhistory/sets.sty b/Master/texmf-dist/tex/latex/vhistory/sets.sty index 2a16a869cbc..8c5de82fa42 100644 --- a/Master/texmf-dist/tex/latex/vhistory/sets.sty +++ b/Master/texmf-dist/tex/latex/vhistory/sets.sty @@ -3,8 +3,8 @@ %% FILE: sets.sty %% %% %% %% AUTHOR: Jochen Wertenauer %% -%% VERSION: 1.0 %% -%% DATE: 2005-02-17 %% +%% VERSION: 1.1 %% +%% DATE: 2006-01-09 %% %% %% %% LICENSE: This program may be distributed and/or modified under the %% %% conditions of the LaTeX Project Public License, either version 1.2 %% @@ -30,7 +30,7 @@ %% and using that macro would solve the problem. Commands like like "A %% %% work fine. Of course an element cannot contain the character | (but %% %% you can "hide" it in a command like \boldTest, too). %% -%% Another forbidden element is the command \endset. %% +%% Other forbidden elemente are the commands \endset and \empty. %% %% In this package a set is normally sorted and contains no duplicates %% %% unless you explicitly want it as it is by using \newsetsimple (but %% %% several operations will return a sorted set without duplicates). %% @@ -157,8 +157,8 @@ % Helper method for \sizeofset. Recursively calls itself. Implemented straight % forward. \def \sets@sizeofset #1|#2\endset#3{% - \def \sizetemps@t {#1}% - \ifx \sizetemps@t\empty\else + \def \sizetemps@t{#1}% + \ifx \sizetemps@t\empty\relax\else \stepcounter{#3}% \def \sizetemps@t{#2}% \ifx\sizetemps@t\empty\else @@ -176,13 +176,12 @@ \def \setseparator{,\ } %% Prints the contents of set #1. Elements will be separated by \setseparator. -\def \listset #1{\xpa\sets@listset #1|\endset} +\def \listset #1{\xpa\sets@listset #1|\empty\endset} %% Helper method for \listset. \def \sets@listset #1|#2\endset{% - \def \temps@t{#2}% #1% - \ifx\temps@t\empty{}\else + \ifx #2\empty{}\else \setseparator \sets@ReturnFi{\sets@listset #2\endset}% \fi 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% } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -- cgit v1.2.3