diff options
author | Karl Berry <karl@freefriends.org> | 2013-08-10 22:12:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-08-10 22:12:23 +0000 |
commit | dc68b1b33aee8e2228bd36e1a7319dbcabcc7890 (patch) | |
tree | 8de9cd404614b4ed636cfb1ce2f6b8b05e45ad9b /Master/texmf-dist/source/latex/changes/changes.dtx | |
parent | 0d1dcea12f68a273faa21a51057c75738dca9428 (diff) |
changes (10aug13)
git-svn-id: svn://tug.org/texlive/trunk@31408 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/changes/changes.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/changes/changes.dtx | 223 |
1 files changed, 156 insertions, 67 deletions
diff --git a/Master/texmf-dist/source/latex/changes/changes.dtx b/Master/texmf-dist/source/latex/changes/changes.dtx index b437f0d248d..849186e1d73 100644 --- a/Master/texmf-dist/source/latex/changes/changes.dtx +++ b/Master/texmf-dist/source/latex/changes/changes.dtx @@ -1,8 +1,8 @@ -% \CheckSum{860} +% \CheckSum{966} % % \iffalse meta-comment % -% Copyright (C) 2007-2012 +% Copyright (C) 2007-2013 % Ekkart Kleinod (ekleinod@edgesoft.de) % -------------------------------------------------------------------------- % @@ -48,6 +48,8 @@ % \changes{v0.5.4}{2011/04/25}{extract user documentation; default language changed to English; script for removal of commands} % \changes{v0.6.0}{2012/01/11}{redefined user interface for setting options, markup, authors; newly structured documentation} % \changes{v1.0.0}{2012/04/25}{key-value-interface for change commands; special characters in list of changes} +% \changes{v2.0.0}{2013/06/30}{fixed problem with special characters in tabbing environment (loc), real list of changes, authormarkup} +% \changes{v2.0.1}{2013/08/10}{no changes in behavior or code; fixed problems with CTAN upload} % \GetFileInfo{changes.dtx} % \RecordChanges % @@ -87,8 +89,8 @@ % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{changes} -[2012/04/25 v1.0.0 changes-Paket] -\typeout{*** changes-Paket 2012/04/25 v1.0.0 ***} +[2013/08/10 v2.0.1 changes-Paket] +\typeout{*** changes-Paket 2013/08/10 v2.0.1 ***} % \end{macrocode} % % Package \chpackage{xkeyval} provides options with key-value-pairs. @@ -236,7 +238,8 @@ \equal{#1}{superscript}\or \equal{#1}{subscript}\or \equal{#1}{brackets}\or - \equal{#1}{footnote} + \equal{#1}{footnote}\or + \equal{#1}{none} } {\renewcommand{\Changes@optionauthormarkup}{#1}} {\PackageWarning{changes}{authormarkup '#1' unknown, using '\Changes@optionauthormarkup'}} @@ -374,6 +377,20 @@ }{} % \end{macrocode} % +% \minisec{\chcommand{listofchanges}} +% +% Declare available options of the command, define value storage. +% \begin{macrocode} +\DeclareOptionX<Changes@loc>{style}{\def\Changes@loc@style{#1}} +% \end{macrocode} +% +% Set the default values of the options. +% \begin{macrocode} +\presetkeys{Changes@loc}{ + style=list +}{} +% \end{macrocode} +% % \subsubsection{Option processing} % % Process the options. @@ -429,62 +446,72 @@ % \begin{macrocode} \ifthenelse{\isundefined{\addto}} { - \def\listchangesname{Changes} + \def\listofchangesname{List of changes} + \def\summaryofchangesname{Changes} \def\changesaddname{Added} \def\changesdeletename{Deleted} \def\changesreplacename{Replaced} \def\changesauthorname{Author} \def\changesanonymousname{anonymous} \def\changesnoloc{List of changes is available after the next \LaTeX\ run.} + \def\changesnosoc{Summary of changes is available after the next \LaTeX\ run.} }{ - \addto\captionsngerman{\def\listchangesname{\"Anderungen}} + \addto\captionsngerman{\def\listofchangesname{Liste der \"Anderungen}} + \addto\captionsngerman{\def\summaryofchangesname{\"Anderungen}} \addto\captionsngerman{\def\changesaddname{Eingef\"ugt}} \addto\captionsngerman{\def\changesdeletename{Gel\"oscht}} \addto\captionsngerman{\def\changesreplacename{Ersetzt}} \addto\captionsngerman{\def\changesauthorname{Autor}} \addto\captionsngerman{\def\changesanonymousname{Anonym}} - \addto\captionsngerman{\def\changesnoloc{\"Anderungsliste nach dem n\"achsten \LaTeX-Lauf verf\"ugbar.}} + \addto\captionsngerman{\def\changesnoloc{Liste der \"Anderungen nach dem n\"achsten \LaTeX-Lauf verf\"ugbar.}} + \addto\captionsngerman{\def\changesnosoc{\"Anderungen nach dem n\"achsten \LaTeX-Lauf verf\"ugbar.}} - \addto\captionsgerman{\def\listchangesname{\"Anderungen}} + \addto\captionsgerman{\def\listofchangesname{Liste der \"Anderungen}} + \addto\captionsgerman{\def\summaryofchangesname{\"Anderungen}} \addto\captionsgerman{\def\changesaddname{Eingef\"ugt}} \addto\captionsgerman{\def\changesdeletename{Gel\"oscht}} \addto\captionsgerman{\def\changesreplacename{Ersetzt}} \addto\captionsgerman{\def\changesauthorname{Autor}} \addto\captionsgerman{\def\changesanonymousname{Anonym}} - \addto\captionsgerman{\def\changesnoloc{\"Anderungsliste nach dem n\"achsten \LaTeX-Lauf verf\"ugbar.}} + \addto\captionsgerman{\def\changesnoloc{Liste der \"Anderungen nach dem n\"achsten \LaTeX-Lauf verf\"ugbar.}} + \addto\captionsgerman{\def\changesnosoc{\"Anderungen nach dem n\"achsten \LaTeX-Lauf verf\"ugbar.}} - \addto\captionsenglish{\def\listchangesname{Changes}} + \addto\captionsenglish{\def\listofchangesname{List of changes}} + \addto\captionsenglish{\def\summaryofchangesname{Changes}} \addto\captionsenglish{\def\changesaddname{Added}} \addto\captionsenglish{\def\changesdeletename{Deleted}} \addto\captionsenglish{\def\changesreplacename{Replaced}} \addto\captionsenglish{\def\changesauthorname{Author}} \addto\captionsenglish{\def\changesanonymousname{anonymous}} \addto\captionsenglish{\def\changesnoloc{List of changes is available after the next \LaTeX\ run.}} + \addto\captionsenglish{\def\changesnosoc{Summary of changes is available after the next \LaTeX\ run.}} - \addto\captionsitalian{\def\listchangesname{Modifiche}} + \addto\captionsitalian{\def\listofchangesname{Lista delle modifiche}} + \addto\captionsitalian{\def\summaryofchangesname{Modifiche}} \addto\captionsitalian{\def\changesaddname{Aggiunte}} \addto\captionsitalian{\def\changesdeletename{Cancellazioni}} \addto\captionsitalian{\def\changesreplacename{Sostituzioni}} \addto\captionsitalian{\def\changesauthorname{Autore}} \addto\captionsitalian{\def\changesanonymousname{anonimo}} \addto\captionsitalian{\def\changesnoloc{La lista delle modifiche sar\`a disponibile alla prossima esecuzione di \LaTeX.}} + \addto\captionsitalian{\def\changesnosoc{Le modifiche sar\`a disponibile alla prossima esecuzione di \LaTeX.}} } % \end{macrocode} % % \subsection{File extension} % % \begin{macro}{\Changes@extension} -% Store file extension in variable, set default to \texttt{loc}. +% Store file extension in variable, set default to \texttt{soc} (summary of changes). % \begin{macrocode} -\newcommand{\Changes@extension}{loc} +\newcommand{\Changes@extension}{soc} % \end{macrocode} % \end{macro} % -% \begin{macro}{\setlocextension} +% \begin{macro}{\setsocextension} % Set a new file extension. % Argument: new extension. % \begin{macrocode} -\newcommand{\setlocextension}[1]{ +\newcommand{\setsocextension}[1]{ \renewcommand{\Changes@extension}{#1} } % \end{macrocode} @@ -563,6 +590,7 @@ \ifthenelse{\equal{\Changes@optionauthormarkup}{subscript}}{\textsubscript{#1}}{}% \ifthenelse{\equal{\Changes@optionauthormarkup}{brackets}}{(#1)}{}% \ifthenelse{\equal{\Changes@optionauthormarkup}{footnote}}{\footnote{#1}}{}% + \ifthenelse{\equal{\Changes@optionauthormarkup}{none}}{}{}% } % \end{macrocode} % \end{macro} @@ -708,11 +736,13 @@ % \item unchanged text % \item author's id % \item remark +% \item text for list of changes +% \item change type for list of changes % \end{enumerate} % Define boolean for author test. % \begin{macrocode} \newboolean{Changes@WrongID} -\newcommand{\Changes@output}[4]{% +\newcommand{\Changes@output}[6]{% % \end{macrocode} % Output changed text if option \choption{draft} is set, otherwise output unchanged text. % \begin{macrocode} @@ -774,6 +804,13 @@ {\Changes@Remark{#3}{#4}}% {}% }% +% \end{macrocode} +% Store line for list of changes. +% \begin{macrocode} + \ifthenelse{\equal{\@empty}{#3}}% + {\def\Changes@locid{}}% + {\def\Changes@locid{~(#3)}}% + \addcontentsline{loc}{subsection}{#6\Changes@locid: \truncate{.3\textwidth}{#5}}% }% % \end{macrocode} % Output unchanged text (option \choption{final} was set). @@ -794,11 +831,13 @@ % Call \emph{setkeys} in order to evaluate the key-value-options and fill the value storage. % \begin{macrocode} \setkeys{Changes@added}{#1}% - \Changes@output - {\Changes@Markup@Added{#2}} - {#2} - {\Changes@added@id} + \Changes@output% + {\Changes@Markup@Added{#2}}% + {#2}% + {\Changes@added@id}% {\Changes@added@remark}% + {#2}% + {\changesaddname}% \stepcounter{Changes@AddCount\Changes@added@id}% } % \end{macrocode} @@ -818,11 +857,13 @@ % Call \emph{setkeys} in order to evaluate the key-value-options and fill the value storage. % \begin{macrocode} \setkeys{Changes@deleted}{#1}% - \Changes@output - {\Changes@Markup@Deleted{#2}} - {\@bsphack \expandafter \@esphack} - {\Changes@deleted@id} + \Changes@output% + {\Changes@Markup@Deleted{#2}}% + {\@bsphack \expandafter \@esphack}% + {\Changes@deleted@id}% {\Changes@deleted@remark}% + {#2}% + {\changesdeletename}% \stepcounter{Changes@DeleteCount\Changes@deleted@id}% } % \end{macrocode} @@ -844,6 +885,8 @@ {#2} {\Changes@replaced@id} {\Changes@replaced@remark}% + {#2}% + {\changesreplacename}% \stepcounter{Changes@ReplaceCount\Changes@replaced@id}% } % \end{macrocode} @@ -851,6 +894,11 @@ % % \subsection{List of changes} % +% The list of changes truncates text, therefore the \chpackage{truncate} package is used. +% \begin{macrocode} +\RequirePackage[breakall]{truncate} +% \end{macrocode} +% % \begin{macro}{\changes@chopline} % Auxiliary command for reading the content of the loc-files. % The content is read line by line. @@ -869,53 +917,94 @@ % \end{macro} % % \begin{macro}{\listofchanges} -% This command outputs the list of changes, separated by authors. -% The values are read from the loc-file, if it exists. -% If no loc-file exists, an according message is generated. +% This command outputs the list of changes. +% +% Two styles are available: \choption{list} (default) and \choption{summary}. +% \choption{list} prints the list of changes lika a list of figures. +% \choption{summary} prints a summary of changes separated by authors. +% +% For the list, the values are read from the auxiliary file. +% +% For the summary, the values are read from the loc-file, if it exists. +% If no loc-file exists, an according message is generated. +% +% Some definitions that have to reside outside the command in order to use the command multiple times. +% In further versions: compute length of bounding box für summary. % \begin{macrocode} -\newcommand{\listofchanges}{% - \ifthenelse{\boolean{Changes@optiondraft}} +\newlength{\Changes@Len@summ} +\setlength{\Changes@Len@summ}{.2\textwidth} +\newboolean{Changes@MoreLines} +% \end{macrocode} +% The definition of \chcommand{listofchanges}. +% \begin{macrocode} +\newcommand{\listofchanges}[1][style=list]{% + \setkeys{Changes@loc}{#1}% + \ifthenelse{\equal{\@empty}{\Changes@loc@style}} + {\def\Changes@loc@style{list}} { - \section*{\listchangesname} - \IfFileExists{\jobname.\Changes@extension} - { - \newboolean{Changes@MoreLines} - \setboolean{Changes@MoreLines}{true} - \newread\Changes@InFile - \openin\Changes@InFile = \jobname.\Changes@extension - \whiledo{\boolean{Changes@MoreLines}}{ - \read\Changes@InFile to \Changes@Line - \ifeof\Changes@InFile - \setboolean{Changes@MoreLines}{false} - \else - \expandafter\changes@chopline\Changes@Line\\ - \begin{tabbing} - mm\=mmmmmm\=\kill - { - \ifthenelse{\boolean{Changes@colored}} - {\color{\Changes@InColor}} - {} - \ifthenelse{\equal{\Changes@InID}{\@empty}} - {\changesauthorname: \changesanonymousname} - { - \changesauthorname: \Changes@InID - \ifthenelse{\equal{\Changes@InName}{\@empty}} - {} - { (\Changes@InName)} - } - }\\ - \>\changesaddname:\>\Changes@InAdded\\ - \>\changesdeletename:\>\Changes@InDeleted\\ - \>\changesreplacename:\>\Changes@InReplaced\\ - \end{tabbing} - \fi - } - \closein\Changes@InFile - }{ + \ifthenelse{ + \equal{\Changes@loc@style}{list}\or + \equal{\Changes@loc@style}{summary} + } + {} + {\def\Changes@loc@style{list}} + } +% \end{macrocode} +% Print list. +% \begin{macrocode} + \ifthenelse{\equal{\Changes@loc@style}{list}} + { + \section*{\listofchangesname} + \IfFileExists{\jobname.loc} + {}{ \emph{\changesnoloc} \PackageWarning{changes}{LaTeX rerun needed for list of changes} } - }{} + \@starttoc{loc} + } +% \end{macrocode} +% Print summary, but only in draft mode. +% \begin{macrocode} + { + \ifthenelse{\boolean{Changes@optiondraft}} + { + \section*{\summaryofchangesname} + \IfFileExists{\jobname.\Changes@extension} + { + \setboolean{Changes@MoreLines}{true} + \newread\Changes@InFile + \openin\Changes@InFile = \jobname.\Changes@extension + \whiledo{\boolean{Changes@MoreLines}}{ + \read\Changes@InFile to \Changes@Line + \ifeof\Changes@InFile + \setboolean{Changes@MoreLines}{false} + \else + \expandafter\changes@chopline\Changes@Line\\ + \textbf{% + \ifthenelse{\boolean{Changes@colored}} + {\color{\Changes@InColor}} + {} + \ifthenelse{\equal{\Changes@InID}{\@empty}} + {\changesauthorname: \changesanonymousname} + {% + \changesauthorname: \Changes@InID + \ifthenelse{\equal{\Changes@InName}{\@empty}} + {} + { (\Changes@InName)} + } + }\\ + \parbox{\Changes@Len@summ}{\changesaddname~\dotfill~\Changes@InAdded}\\ + \parbox{\Changes@Len@summ}{\changesdeletename~\dotfill~\Changes@InDeleted}\\ + \parbox{\Changes@Len@summ}{\changesreplacename~\dotfill~\Changes@InReplaced}\\[1ex] + \fi + } + \closein\Changes@InFile + }{% + \emph{\changesnosoc} + \PackageWarning{changes}{LaTeX rerun needed for summary of changes} + } + }{} + } } % \end{macrocode} % \end{macro} |