From cbd0c9d5ad3299c4a474bb472f7dc205fb8c2bcc Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 29 Jan 2021 22:30:54 +0000 Subject: changes (29jan21) git-svn-id: svn://tug.org/texlive/trunk@57549 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/changes/changes.sty | 836 +++++++++++------------- 1 file changed, 388 insertions(+), 448 deletions(-) (limited to 'Master/texmf-dist/tex/latex/changes') diff --git a/Master/texmf-dist/tex/latex/changes/changes.sty b/Master/texmf-dist/tex/latex/changes/changes.sty index 9bd12597ece..58fa8e4e983 100644 --- a/Master/texmf-dist/tex/latex/changes/changes.sty +++ b/Master/texmf-dist/tex/latex/changes/changes.sty @@ -7,7 +7,7 @@ %% changes.dtx (with options: `changes') %% %% changes.dtx -%% Copyright 2007-2020 Ekkart Kleinod (ekleinod@edgesoft.de) +%% Copyright 2007-2021 Ekkart Kleinod (ekleinod@edgesoft.de) %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -41,56 +41,83 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{changes} -[2020/06/16 v3.2.2 changes package] -\typeout{*** changes package 2020/06/16 v3.2.2 ***} +[2021/01/28 v4.0.0 changes package] +\typeout{*** changes package 2021/01/28 v4.0.0 ***} \RequirePackage{xkeyval} -\RequirePackage{xifthen} +\RequirePackage{etoolbox} \RequirePackage{xstring} -\newboolean{Changes@optiondraft} -\setboolean{Changes@optiondraft}{true} +\DeclareListParser{\dopsvlist}{|} +\DeclareListParser*{\forpsvlist}{|} +\newcommand{\Changes@tmplist}{} +\newbool{Changes@inlist} +\newrobustcmd{\IfIsInList}[4]{% +\renewcommand{\Changes@tmplist}{}% +\renewcommand*{\do}[1]{% +\listadd{\Changes@tmplist}{##1}% +}% +\expandafter\dopsvlist\expandafter{#2}% +\setbool{Changes@inlist}{false}% +\renewcommand*{\do}[1]{% +\ifinlist{##1}{\Changes@tmplist}% +{\setbool{Changes@inlist}{true}}% +{}% +}% +\expandafter\dopsvlist\expandafter{#1}% +\ifbool{Changes@inlist}% +{#3}% +{#4}% +} +\newbool{Changes@optiondraft} +\setbool{Changes@optiondraft}{true} \DeclareOptionX{draft}{ -\setboolean{Changes@optiondraft}{true} +\setbool{Changes@optiondraft}{true} \typeout{changes-option '\CurrentOption'} } \DeclareOptionX{final}{ -\setboolean{Changes@optiondraft}{false} +\setbool{Changes@optiondraft}{false} \typeout{changes-option '\CurrentOption'} } +\newcommand{\Changes@optioncommandnameprefix}{none} +\DeclareOptionX{commandnameprefix}{ +\ifblank{#1} +{} +{ +\IfIsInList{#1}{none|always|ifneeded} +{\renewcommand{\Changes@optioncommandnameprefix}{#1}} +{\PackageWarning{changes}{commandnameprefix '#1' unknown, using '\Changes@optioncommandnameprefix'}} +} +\typeout{changes-option 'commandnameprefix=\Changes@optioncommandnameprefix'} +} \newcommand{\Changes@optionaddedmarkup}{colored} \newcommand{\Changes@optiondeletedmarkup}{sout} \newcommand{\Changes@optionhighlightmarkup}{background} \newcommand{\Changes@optioncommentmarkup}{todo} \newcommand{\Changes@optionmarkup}{default} \DeclareOptionX{markup}{ -\ifthenelse{\equal{\@empty}{#1}} +\ifblank{#1} {} { -\ifthenelse{ -\equal{#1}{default}\or -\equal{#1}{underlined}\or -\equal{#1}{bfit}\or -\equal{#1}{nocolor} -} +\IfIsInList{#1}{bfit|default|nocolor|underlined} {\renewcommand{\Changes@optionmarkup}{#1}} {\PackageWarning{changes}{markup '#1' unknown, using '\Changes@optionmarkup'}} } -\ifthenelse{\equal{\Changes@optionmarkup}{default}} +\IfStrEq{\Changes@optionmarkup}{default} { } {} -\ifthenelse{\equal{\Changes@optionmarkup}{underlined}} +\IfStrEq{\Changes@optionmarkup}{underlined} { \renewcommand{\Changes@optionaddedmarkup}{uline} \renewcommand{\Changes@optionhighlightmarkup}{uwave} } {} -\ifthenelse{\equal{\Changes@optionmarkup}{bfit}} +\IfStrEq{\Changes@optionmarkup}{bfit} { \renewcommand{\Changes@optionaddedmarkup}{bf} \renewcommand{\Changes@optiondeletedmarkup}{it} } {} -\ifthenelse{\equal{\Changes@optionmarkup}{nocolor}} +\IfStrEq{\Changes@optionmarkup}{nocolor} { \renewcommand{\Changes@optionaddedmarkup}{uline} \renewcommand{\Changes@optionhighlightmarkup}{uwave} @@ -99,73 +126,40 @@ \typeout{changes-option 'markup=\Changes@optionmarkup'} } \DeclareOptionX{addedmarkup}{ -\ifthenelse{\equal{\@empty}{#1}} +\ifblank{#1} {} { -\ifthenelse{ -\equal{#1}{colored}\or -\equal{#1}{uline}\or -\equal{#1}{uuline}\or -\equal{#1}{uwave}\or -\equal{#1}{dashuline}\or -\equal{#1}{dotuline}\or -\equal{#1}{bf}\or -\equal{#1}{it}\or -\equal{#1}{sl}\or -\equal{#1}{em} -} +\IfIsInList{#1}{bf|colored|dashuline|dotuline|em|it|sl|uline|uuline|uwave} {\renewcommand{\Changes@optionaddedmarkup}{#1}} {\PackageWarning{changes}{addedmarkup '#1' unknown, using '\Changes@optionaddedmarkup'}} } \typeout{changes-option 'addedmarkup=\Changes@optionaddedmarkup'} } \DeclareOptionX{deletedmarkup}{ -\ifthenelse{\equal{\@empty}{#1}} +\ifblank{#1} {} { -\ifthenelse{ -\equal{#1}{sout}\or -\equal{#1}{colored}\or -\equal{#1}{uline}\or -\equal{#1}{uuline}\or -\equal{#1}{uwave}\or -\equal{#1}{dashuline}\or -\equal{#1}{dotuline}\or -\equal{#1}{xout}\or -\equal{#1}{bf}\or -\equal{#1}{it}\or -\equal{#1}{sl}\or -\equal{#1}{em} -} +\IfIsInList{#1}{bf|colored|dashuline|dotuline|em|it|sl|sout|uline|uuline|uwave|xout} {\renewcommand{\Changes@optiondeletedmarkup}{#1}} {\PackageWarning{changes}{deletedmarkup '#1' unknown, using '\Changes@optiondeletedmarkup'}} } \typeout{changes-option 'deletedmarkup=\Changes@optiondeletedmarkup'} } \DeclareOptionX{highlightmarkup}{ -\ifthenelse{\equal{\@empty}{#1}} +\ifblank{#1} {} { -\ifthenelse{ -\equal{#1}{background}\or -\equal{#1}{uuline}\or -\equal{#1}{uwave} -} +\IfIsInList{#1}{background|uuline|uwave} {\renewcommand{\Changes@optionhighlightmarkup}{#1}} {\PackageWarning{changes}{highlightmarkup '#1' unknown, using '\Changes@optionhighlightmarkup'}} } \typeout{changes-option 'highlightmarkup=\Changes@optionhighlightmarkup'} } \DeclareOptionX{commentmarkup}{ -\ifthenelse{\equal{\@empty}{#1}} +\ifblank{#1} {} { -\ifthenelse{ -\equal{#1}{todo}\or -\equal{#1}{margin}\or -\equal{#1}{footnote}\or -\equal{#1}{uwave} -} +\IfIsInList{#1}{footnote|margin|todo|uwave} {\renewcommand{\Changes@optioncommentmarkup}{#1}} {\PackageWarning{changes}{commentmarkup '#1' unknown, using '\Changes@optioncommentmarkup'}} } @@ -173,16 +167,10 @@ } \newcommand{\Changes@optionauthormarkup}{superscript} \DeclareOptionX{authormarkup}{ -\ifthenelse{\equal{\@empty}{#1}} +\ifblank{#1} {} { -\ifthenelse{ -\equal{#1}{superscript}\or -\equal{#1}{subscript}\or -\equal{#1}{brackets}\or -\equal{#1}{footnote}\or -\equal{#1}{none} -} +\IfIsInList{#1}{brackets|footnote|none|subscript|superscript} {\renewcommand{\Changes@optionauthormarkup}{#1}} {\PackageWarning{changes}{authormarkup '#1' unknown, using '\Changes@optionauthormarkup'}} } @@ -190,13 +178,10 @@ } \newcommand{\Changes@optionauthormarkupposition}{right} \DeclareOptionX{authormarkupposition}{ -\ifthenelse{\equal{\@empty}{#1}} +\ifblank{#1} {} { -\ifthenelse{ -\equal{#1}{right}\or -\equal{#1}{left} -} +\IfIsInList{#1}{left|right} {\renewcommand{\Changes@optionauthormarkupposition}{#1}} {\PackageWarning{changes}{authormarkupposition '#1' unknown, using '\Changes@optionauthormarkupposition'}} } @@ -204,18 +189,24 @@ } \newcommand{\Changes@optionauthormarkuptext}{id} \DeclareOptionX{authormarkuptext}{ -\ifthenelse{\equal{\@empty}{#1}} +\ifblank{#1} {} { -\ifthenelse{ -\equal{#1}{id}\or -\equal{#1}{name} -} +\IfIsInList{#1}{id|name} {\renewcommand{\Changes@optionauthormarkuptext}{#1}} {\PackageWarning{changes}{authormarkuptext '#1' unknown, using '\Changes@optionauthormarkuptext'}} } \typeout{changes-option 'authormarkuptext=\Changes@optionauthormarkuptext'} } +\newcommand{\Changes@optiondefaultcolor}{blue} +\DeclareOptionX{defaultcolor}{ +\ifblank{#1} +{} +{ +\renewcommand{\Changes@optiondefaultcolor}{#1} +} +\typeout{changes-option 'defaultcolor=\Changes@optiondefaultcolor'} +} \DeclareOptionX{todonotes}{ \typeout{todonotes-option '#1', passed to package todonotes} \PassOptionsToPackage{#1}{todonotes} @@ -239,38 +230,30 @@ \DeclareOptionX{color}{\def\Changes@definechangesauthor@color{#1}} \presetkeys{Changes@definechangesauthor}{ name=\@empty, -color=blue +color=\Changes@optiondefaultcolor }{} \DeclareOptionX{id}{\def\Changes@added@id{#1}} -\DeclareOptionX{remark}{\def\Changes@added@remark{#1}} \DeclareOptionX{comment}{\def\Changes@added@comment{#1}} \presetkeys{Changes@added}{ id=\@empty, -remark=\@empty, comment=\@empty, }{} \DeclareOptionX{id}{\def\Changes@deleted@id{#1}} -\DeclareOptionX{remark}{\def\Changes@deleted@remark{#1}} \DeclareOptionX{comment}{\def\Changes@deleted@comment{#1}} \presetkeys{Changes@deleted}{ id=\@empty, -remark=\@empty, comment=\@empty, }{} \DeclareOptionX{id}{\def\Changes@replaced@id{#1}} -\DeclareOptionX{remark}{\def\Changes@replaced@remark{#1}} \DeclareOptionX{comment}{\def\Changes@replaced@comment{#1}} \presetkeys{Changes@replaced}{ id=\@empty, -remark=\@empty, comment=\@empty, }{} \DeclareOptionX{id}{\def\Changes@highlight@id{#1}} -\DeclareOptionX{remark}{\def\Changes@highlight@remark{#1}} \DeclareOptionX{comment}{\def\Changes@highlight@comment{#1}} \presetkeys{Changes@highlight}{ id=\@empty, -remark=\@empty, comment=\@empty, }{} \DeclareOptionX{id}{\def\Changes@comment@id{#1}} @@ -290,70 +273,71 @@ ulem={normalem,normalbf}, truncate={breakall,fit} } \ProcessOptionsX*\relax -\newtest{\isColored}{% -\not\equal{\Changes@optionmarkup}{nocolor}% +\newrobustcmd{\IfIsColored}[2]{% +\IfStrEq{\Changes@optionmarkup}{nocolor}% +{#2}% +{#1}% } -\ifthenelse{\isColored} -{ -\RequirePackage{xcolor} +\newrobustcmd{\IfIsEmpty}[3]{% +\ifboolexpr{% +test {\ifblank{#1}} or% +test {\IfStrEq{#1}{}} or% +test {\IfStrEq{#1}{\@empty}}% +}% +{#2}% +{#3}% +} +\newrobustcmd{\IfIsAnonymous}[3]{% +\IfIsEmpty{#1}{#2}{#3}% } +\newrobustcmd{\IfIsAuthorEmptyAtPosition}[4]{% +\ifboolexpr{% +test {\IfIsAnonymous{#1}} or% +not test {\IfStrEq{\Changes@optionauthormarkupposition}{#2}}% +}% +{#3}% +{#4}% +} +\IfIsColored +{\RequirePackage{xcolor}} {} -\ifthenelse{ -\equal{\Changes@optionaddedmarkup}{uline}\or -\equal{\Changes@optionaddedmarkup}{uuline}\or -\equal{\Changes@optionaddedmarkup}{uwave}\or -\equal{\Changes@optionaddedmarkup}{dashuline}\or -\equal{\Changes@optionaddedmarkup}{dotuline}\or -\equal{\Changes@optiondeletedmarkup}{uline}\or -\equal{\Changes@optiondeletedmarkup}{uuline}\or -\equal{\Changes@optiondeletedmarkup}{uwave}\or -\equal{\Changes@optiondeletedmarkup}{dashuline}\or -\equal{\Changes@optiondeletedmarkup}{dotuline}\or -\equal{\Changes@optiondeletedmarkup}{sout}\or -\equal{\Changes@optiondeletedmarkup}{xout}\or -\equal{\Changes@optioncommentmarkup}{uwave}\or -\equal{\Changes@optionhighlightmarkup}{uuline}\or -\equal{\Changes@optionhighlightmarkup}{uwave} +\ifboolexpr{ +test {\IfIsInList{\Changes@optionaddedmarkup}{dashuline|dotuline|sout|uline|uuline|uwave|xout}} or +test {\IfIsInList{\Changes@optiondeletedmarkup}{dashuline|dotuline|sout|uline|uuline|uwave|xout}} or +test {\IfIsInList{\Changes@optionhighlightmarkup}{dashuline|dotuline|sout|uline|uuline|uwave|xout}} } {\RequirePackage{ulem}} {} -\ifthenelse{ -\equal{\Changes@optioncommentmarkup}{todo} -} +\IfStrEq{\Changes@optioncommentmarkup}{todo} {\RequirePackage{todonotes}} {} -\newcommand*\listofchangesname{List of changes} -\newcommand*\summaryofchangesname{Changes} -\newcommand*\compactsummaryofchangesname{Changes (compact)} -\newcommand*\changesaddname{Added} -\newcommand*\changesdeletename{Deleted} -\newcommand*\changesreplacename{Replaced} -\newcommand*\changeshighlightname{Highlighted} -\newcommand*\changescommentname{Commented} -\newcommand*\changesauthorname{Author} -\newcommand*\changesanonymousname{anonymous} -\newcommand*\changesnochanges{No changes.} -\newcommand*\changesnoloc{List of changes is available after the next \LaTeX\ run.} -\newcommand*\changesnosoc{Summary of changes is available after the next \LaTeX\ run.} -\newboolean{Changes@langpackage} -\setboolean{Changes@langpackage}{false} -\@ifpackageloaded{babel} -{\setboolean{Changes@langpackage}{true}} -{} -\@ifpackageloaded{polyglossia} -{\setboolean{Changes@langpackage}{true}} -{} -\ifthenelse{\boolean{Changes@langpackage}} +\def\listofchangesname{List of changes} +\def\summaryofchangesname{Changes} +\def\compactsummaryofchangesname{Changes (compact)} +\def\changesaddedname{Added} +\def\changesdeletedname{Deleted} +\def\changesreplacedname{Replaced} +\def\changeshighlightname{Highlighted} +\def\changescommentname{Commented} +\def\changesauthorname{Author} +\def\changesanonymousname{anonymous} +\def\changesnochanges{No changes.} +\def\changesnoloc{List of changes is available after the next \LaTeX\ run.} +\def\changesnosoc{Summary of changes is available after the next \LaTeX\ run.} +\ifboolexpr{ +test {\@ifpackageloaded{babel}} or +test {\@ifpackageloaded{polyglossia}} +} { \addto\captionsngerman{\def\listofchangesname{Liste der \"Anderungen}} \addto\captionsngerman{\def\summaryofchangesname{\"Anderungen}} \addto\captionsngerman{\def\compactsummaryofchangesname{\"Anderungen (kompakt)}} -\addto\captionsngerman{\def\changesaddname{Eingef\"ugt}} -\addto\captionsngerman{\def\changesdeletename{Gel\"oscht}} -\addto\captionsngerman{\def\changesreplacename{Ersetzt}} +\addto\captionsngerman{\def\changesaddedname{Eingef\"ugt}} +\addto\captionsngerman{\def\changesdeletedname{Gel\"oscht}} +\addto\captionsngerman{\def\changesreplacedname{Ersetzt}} \addto\captionsngerman{\def\changeshighlightname{Hervorgehoben}} \addto\captionsngerman{\def\changescommentname{Kommentiert}} -\addto\captionsngerman{\def\changesauthorname{Autor}} +\addto\captionsngerman{\def\changesauthorname{Autor:in}} \addto\captionsngerman{\def\changesanonymousname{Anonym}} \addto\captionsngerman{\def\changesnochanges{Keine \"Anderungen.}} \addto\captionsngerman{\def\changesnoloc{Liste der \"Anderungen nach dem n\"achsten \LaTeX-Lauf verf\"ugbar.}} @@ -362,12 +346,12 @@ truncate={breakall,fit} \addto\captionsgerman{\def\listofchangesname{Liste der \"Anderungen}} \addto\captionsgerman{\def\summaryofchangesname{\"Anderungen}} \addto\captionsgerman{\def\compactsummaryofchangesname{\"Anderungen (kompakt)}} -\addto\captionsgerman{\def\changesaddname{Eingef\"ugt}} -\addto\captionsgerman{\def\changesdeletename{Gel\"oscht}} -\addto\captionsgerman{\def\changesreplacename{Ersetzt}} +\addto\captionsgerman{\def\changesaddedname{Eingef\"ugt}} +\addto\captionsgerman{\def\changesdeletedname{Gel\"oscht}} +\addto\captionsgerman{\def\changesreplacedname{Ersetzt}} \addto\captionsgerman{\def\changeshighlightname{Hervorgehoben}} \addto\captionsgerman{\def\changescommentname{Kommentiert}} -\addto\captionsgerman{\def\changesauthorname{Autor}} +\addto\captionsgerman{\def\changesauthorname{Autor:in}} \addto\captionsgerman{\def\changesanonymousname{Anonym}} \addto\captionsgerman{\def\changesnochanges{Keine \"Anderungen.}} \addto\captionsgerman{\def\changesnoloc{Liste der \"Anderungen nach dem n\"achsten \LaTeX-Lauf verf\"ugbar.}} @@ -376,9 +360,9 @@ truncate={breakall,fit} \addto\captionsenglish{\def\listofchangesname{List of changes}} \addto\captionsenglish{\def\summaryofchangesname{Changes}} \addto\captionsenglish{\def\compactsummaryofchangesname{Changes (compact)}} -\addto\captionsenglish{\def\changesaddname{Added}} -\addto\captionsenglish{\def\changesdeletename{Deleted}} -\addto\captionsenglish{\def\changesreplacename{Replaced}} +\addto\captionsenglish{\def\changesaddedname{Added}} +\addto\captionsenglish{\def\changesdeletedname{Deleted}} +\addto\captionsenglish{\def\changesreplacedname{Replaced}} \addto\captionsenglish{\def\changeshighlightname{Highlighted}} \addto\captionsenglish{\def\changescommentname{Commented}} \addto\captionsenglish{\def\changesauthorname{Author}} @@ -390,9 +374,9 @@ truncate={breakall,fit} \addto\captionsbritish{\def\listofchangesname{List of changes}} \addto\captionsbritish{\def\summaryofchangesname{Changes}} \addto\captionsbritish{\def\compactsummaryofchangesname{Changes (compact)}} -\addto\captionsbritish{\def\changesaddname{Added}} -\addto\captionsbritish{\def\changesdeletename{Deleted}} -\addto\captionsbritish{\def\changesreplacename{Replaced}} +\addto\captionsbritish{\def\changesaddedname{Added}} +\addto\captionsbritish{\def\changesdeletedname{Deleted}} +\addto\captionsbritish{\def\changesreplacedname{Replaced}} \addto\captionsbritish{\def\changeshighlightname{Highlighted}} \addto\captionsbritish{\def\changescommentname{Commented}} \addto\captionsbritish{\def\changesauthorname{Author}} @@ -404,9 +388,9 @@ truncate={breakall,fit} \addto\captionsitalian{\def\listofchangesname{Lista delle modifiche}} \addto\captionsitalian{\def\summaryofchangesname{Modifiche}} \addto\captionsitalian{\def\compactsummaryofchangesname{Modifiche (coerente)}} % translation by me (EK), please provide correct translation -\addto\captionsitalian{\def\changesaddname{Aggiunte}} -\addto\captionsitalian{\def\changesdeletename{Cancellazioni}} -\addto\captionsitalian{\def\changesreplacename{Sostituzioni}} +\addto\captionsitalian{\def\changesaddedname{Aggiunte}} +\addto\captionsitalian{\def\changesdeletedname{Cancellazioni}} +\addto\captionsitalian{\def\changesreplacedname{Sostituzioni}} \addto\captionsitalian{\def\changeshighlightname{Accentare}} % translation by me (EK), please provide correct translation \addto\captionsitalian{\def\changescommentname{Commenti}} % translation by me (EK), please provide correct translation \addto\captionsitalian{\def\changesauthorname{Autore}} @@ -416,9 +400,13 @@ truncate={breakall,fit} \addto\captionsitalian{\def\changesnosoc{Le modifiche sar\`a disponibile alla prossima esecuzione di \LaTeX.}} } {} -\newcommand{\Changes@extension}{soc} +\newcommand{\Changes@locextension}{loc} +\newcommand{\setlocextension}[1]{ +\renewcommand{\Changes@locextension}{#1} +} +\newcommand{\Changes@socextension}{soc} \newcommand{\setsocextension}[1]{ -\renewcommand{\Changes@extension}{#1} +\renewcommand{\Changes@socextension}{#1} } \newcounter{Changes@AuthorCount} \setcounter{Changes@AuthorCount}{0} @@ -437,11 +425,21 @@ truncate={breakall,fit} } \definechangesauthor{\@empty} \newcommand{\Changes@Markup@author}[1]{% -\ifthenelse{\equal{\Changes@optionauthormarkup}{superscript}}{\textsuperscript{#1}}{}% -\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}}{}{}% +\IfStrEq{\Changes@optionauthormarkup}{superscript}% +{\textsuperscript{#1}}% +{}% +\IfStrEq{\Changes@optionauthormarkup}{subscript}% +{\textsubscript{#1}}% +{}% +\IfStrEq{\Changes@optionauthormarkup}{brackets}% +{(#1)}% +{}% +\IfStrEq{\Changes@optionauthormarkup}{footnote}% +{\footnote{#1}}% +{}% +\IfStrEq{\Changes@optionauthormarkup}{none}% +{}% +{}% } \newcommand{\setauthormarkup}[1]{ \renewcommand{\Changes@Markup@author}[1]{#1} @@ -452,104 +450,101 @@ truncate={breakall,fit} \newcommand{\setauthormarkuptext}[1]{ \renewcommand{\Changes@optionauthormarkuptext}{#1} } +\newcommand{\Changes@Markup}[2]{% +\IfStrEq{#1}{background}% +{% +\IfIsColored% +{\colorbox{authorcolor!30}{#2}}% +{#2}% +}% +{}% +\IfStrEq{#1}{bf}% +{\textbf{#2}}% +{}% +\IfStrEq{#1}{colored}% +{#2}% +{}% +\IfStrEq{#1}{dashuline}% +{\dashuline{#2}}% +{}% +\IfStrEq{#1}{dotuline}% +{\dotuline{#2}}% +{}% +\IfStrEq{#1}{em}% +{\emph{#2}}% +{}% +\IfStrEq{#1}{it}% +{\textit{#2}}% +{}% +\IfStrEq{#1}{sl}% +{\textsl{#2}}% +{}% +\IfStrEq{#1}{sout}% +{\sout{#2}}% +{}% +\IfStrEq{#1}{uline}% +{\uline{#2}}% +{}% +\IfStrEq{#1}{uuline}% +{\uuline{#2}}% +{}% +\IfStrEq{#1}{uwave}% +{\uwave{#2}}% +{}% +\IfStrEq{#1}{xout}% +{\xout{#2}}% +{}% +} \newcommand{\Changes@Markup@added}[1]{% -\ifthenelse{\equal{\Changes@optionaddedmarkup}{colored}}{#1}{}% -\ifthenelse{\equal{\Changes@optionaddedmarkup}{uline}}{\uline{#1}}{}% -\ifthenelse{\equal{\Changes@optionaddedmarkup}{uuline}}{\uuline{#1}}{}% -\ifthenelse{\equal{\Changes@optionaddedmarkup}{uwave}}{\uwave{#1}}{}% -\ifthenelse{\equal{\Changes@optionaddedmarkup}{dashuline}}{\dashuline{#1}}{}% -\ifthenelse{\equal{\Changes@optionaddedmarkup}{dotuline}}{\dotuline{#1}}{}% -\ifthenelse{\equal{\Changes@optionaddedmarkup}{bf}}{\textbf{#1}}{}% -\ifthenelse{\equal{\Changes@optionaddedmarkup}{it}}{\textit{#1}}{}% -\ifthenelse{\equal{\Changes@optionaddedmarkup}{sl}}{\textsl{#1}}{}% -\ifthenelse{\equal{\Changes@optionaddedmarkup}{em}}{\emph{#1}}{}% +\Changes@Markup{\Changes@optionaddedmarkup}{#1}{}% } \newcommand{\setaddedmarkup}[1]{ \renewcommand{\Changes@Markup@added}[1]{#1} } \newcommand{\Changes@Markup@deleted}[1]{% -\ifthenelse{\equal{\Changes@optiondeletedmarkup}{sout}}{\sout{#1}}{}% -\ifthenelse{\equal{\Changes@optiondeletedmarkup}{colored}}{#1}{}% -\ifthenelse{\equal{\Changes@optiondeletedmarkup}{uline}}{\uline{#1}}{}% -\ifthenelse{\equal{\Changes@optiondeletedmarkup}{uuline}}{\uuline{#1}}{}% -\ifthenelse{\equal{\Changes@optiondeletedmarkup}{uwave}}{\uwave{#1}}{}% -\ifthenelse{\equal{\Changes@optiondeletedmarkup}{dashuline}}{\dashuline{#1}}{}% -\ifthenelse{\equal{\Changes@optiondeletedmarkup}{dotuline}}{\dotuline{#1}}{}% -\ifthenelse{\equal{\Changes@optiondeletedmarkup}{xout}}{\xout{#1}}{}% -\ifthenelse{\equal{\Changes@optiondeletedmarkup}{bf}}{\textbf{#1}}{}% -\ifthenelse{\equal{\Changes@optiondeletedmarkup}{it}}{\textit{#1}}{}% -\ifthenelse{\equal{\Changes@optiondeletedmarkup}{sl}}{\textsl{#1}}{}% -\ifthenelse{\equal{\Changes@optiondeletedmarkup}{em}}{\emph{#1}}{}% +\Changes@Markup{\Changes@optiondeletedmarkup}{#1}{}% } \newcommand{\setdeletedmarkup}[1]{ \renewcommand{\Changes@Markup@deleted}[1]{#1} } \newcommand{\Changes@Markup@highlight}[1]{% -\ifthenelse{\equal{\Changes@optionhighlightmarkup}{background}}% -{% -\ifthenelse{\isColored}% -{\colorbox{authorcolor!30}{#1}}% -{#1}% -}{}% -\ifthenelse{\equal{\Changes@optionhighlightmarkup}{uuline}}{\uuline{#1}}{}% -\ifthenelse{\equal{\Changes@optionhighlightmarkup}{uwave}}{\uwave{#1}}{}% +\Changes@Markup{\Changes@optionhighlightmarkup}{#1}{}% } \newcommand{\sethighlightmarkup}[1]{ \renewcommand{\Changes@Markup@highlight}[1]{#1} } \newcommand{\Changes@Markup@comment}[3]{% -\ifthenelse{\equal{\Changes@optioncommentmarkup}{todo}}% -{% -\ifthenelse{\isColored}% +\IfStrEq{\Changes@optioncommentmarkup}{todo}% {% -\ifthenelse{\isAnonymous{#2}}% -{% -\todo[color=authorcolor!10, bordercolor=authorcolor, linecolor=authorcolor!70, nolist]{\textbf{[\arabic{authorcommentcount}]} #1}% -}{% -\todo[color=authorcolor!10, bordercolor=authorcolor, linecolor=authorcolor!70, nolist]{\textbf{[#3~\arabic{authorcommentcount}]} #1}% -}% -}{% -\ifthenelse{\isAnonymous{#2}}% -{% -\todo[color=black!0, bordercolor=black, linecolor=black!70, nolist]{\textbf{[\arabic{authorcommentcount}]} #1}% -}{% -\todo[color=black!0, bordercolor=black, linecolor=black!70, nolist]{\textbf{[#3~\arabic{authorcommentcount}]:} #1}% -}% -}% +\IfIsColored% +{\colorlet{Changes@todocolor}{authorcolor}}% +{\colorlet{Changes@todocolor}{black}}% +\todo[color=Changes@todocolor!10, bordercolor=Changes@todocolor, linecolor=Changes@todocolor!70, nolist]{\textbf{[\IfIsAnonymous{#2}{}{#3~}\arabic{authorcommentcount}]} #1}% }{}% -\ifthenelse{\equal{\Changes@optioncommentmarkup}{margin}}% +\IfStrEq{\Changes@optioncommentmarkup}{margin}% {% \marginpar{% -\ifthenelse{\isColored}% +\IfIsColored% {\leavevmode\color{authorcolor}}% {}% -\ifthenelse{\isAnonymous{#2}}% -{\textbf{[\arabic{Changes@commentCount#2}]:} }% -{\textbf{[#3~\arabic{Changes@commentCount#2}]:} }% -#1% +\textbf{[\IfIsAnonymous{#2}{}{#3~}\arabic{Changes@commentCount#2}]:} #1% }% }{}% -\ifthenelse{\equal{\Changes@optioncommentmarkup}{footnote}}% +\IfStrEq{\Changes@optioncommentmarkup}{footnote}% {% \footnote{% -\ifthenelse{\isAnonymous{#2}}% -{\textbf{[\arabic{Changes@commentCount#2}]:} }% -{\textbf{[#3~\arabic{Changes@commentCount#2}]:} }% -#1% +\textbf{[\IfIsAnonymous{#2}{}{#3~}\arabic{Changes@commentCount#2}]:} #1% }% }{}% -\ifthenelse{\equal{\Changes@optioncommentmarkup}{uwave}}% +\IfStrEq{\Changes@optioncommentmarkup}{uwave}% {% {% -\ifthenelse{\isColored}% +\IfIsColored% {\color{authorcolor}}% {}% \allowbreak% \uwave{% -\ifthenelse{\isAnonymous{#2}}% -{\textbf{[\arabic{Changes@commentCount#2}]:} }% -{\textbf{[#3~\arabic{Changes@commentCount#2}]:} }% -#1% +\textbf{[\IfIsAnonymous{#2}{}{#3~}\arabic{Changes@commentCount#2}]:} #1% }% }% }{}% @@ -557,109 +552,116 @@ truncate={breakall,fit} \newcommand{\setcommentmarkup}[1]{ \renewcommand{\Changes@Markup@comment}[3]{#1} } -\DeclareRobustCommand{\ifIsEmpty}[3]{% -\ifthenelse{\equal{#1}{} \or \equal{#1}{\@empty}}% -{#2}% -{#3}% -} -\newtest{\isAnonymous}[1]{% -\equal{#1}{\@empty}% -} -\newtest{\isAuthorEmpty}[2]{% -\isAnonymous{#1} \or \not\equal{\Changes@optionauthormarkupposition}{#2}% -} -\newboolean{Changes@WrongID} +\newbool{Changes@WrongID} \newcommand{\Changes@check@author}[1]{% -\ifIsEmpty{#1}% +\IfIsEmpty{#1}% {}% {% -\setboolean{Changes@WrongID}{true}% +\setbool{Changes@WrongID}{true}% \setcounter{Changes@Author}{0}% -\whiledo{\value{Changes@Author} < \value{Changes@AuthorCount}}{% +\loop% \stepcounter{Changes@Author}% -\ifthenelse{\equal{#1}{\@nameuse{Changes@AuthorID\theChanges@Author}}}% -{\setboolean{Changes@WrongID}{false}}% +\IfStrEq{#1}{\csuse{Changes@AuthorID\theChanges@Author}}% +{\setbool{Changes@WrongID}{false}}% {}% -}% -\ifthenelse{\boolean{Changes@WrongID}}% -{\PackageError{changes}% +\ifnum\theChanges@Author<\theChanges@AuthorCount% +\repeat% +\ifbool{Changes@WrongID}% +{% +\PackageError{changes}% {Undefined changes author: #1}% -{You have to define the author #1 with e.g.: \definechangesauthor{#1}}}% +{You have to define the author #1 with e.g.: \definechangesauthor{#1}}% +}% {}% }% } -\DeclareRobustCommand{\Changes@output@author}[2]{% -\ifthenelse{\isAuthorEmpty{#1}{#2}}% +\newrobustcmd{\Changes@output@author}[2]{% +\IfIsAuthorEmptyAtPosition{#1}{#2}% {}% {% -\ifthenelse{\equal{\Changes@optionauthormarkuptext}{id}}% -{% -#1% -}% +\IfStrEq{\Changes@optionauthormarkuptext}{id}% +{#1}% {}% -\ifthenelse{\equal{\Changes@optionauthormarkuptext}{name}}% -{% -\ifIsEmpty{\@nameuse{Changes@AuthorName#1}}% +\IfStrEq{\Changes@optionauthormarkuptext}{name}% {% -#1% -}{% -\@nameuse{Changes@AuthorName#1}% -}% +\IfIsEmpty{\csuse{Changes@AuthorName#1}}% +{#1}% +{\csuse{Changes@AuthorName#1}}% }% {}% }% } -\newcommand{\Changes@set@color}[1]{% -\ifthenelse{\isColored}% -{\colorlet{authorcolor}{\@nameuse{Changes@AuthorColor#1}}}% +\newrobustcmd{\Changes@set@color}[1]{% +\IfIsColored% +{\colorlet{authorcolor}{\csuse{Changes@AuthorColor#1}}}% {}% } \newcounter{authorcommentcount} -\newcommand{\Changes@set@commentcount}[1]{% +\newrobustcmd{\Changes@set@commentcount}[1]{% \setcounter{authorcommentcount}{\value{Changes@commentCount#1}}% } -\newcommand{\Changes@output}[7]{% -\ifthenelse{\boolean{Changes@optiondraft}}% +\def\Changes@commandprefix{ch} +\newrobustcmd{\Changes@set@commandname}[1]{ +\def\Changes@commandname{#1} +\IfStrEq{\Changes@optioncommandnameprefix}{always} +{ +\def\Changes@commandname{\Changes@commandprefix#1} +\typeout{changes-package option commandnameprefix=always: using prefix on #1, new command name is \Changes@commandname.} +}{ +\ifcsdef{#1} +{ +\IfStrEq{\Changes@optioncommandnameprefix}{none} +{ +\PackageError{changes} +{Command #1 is already defined.} +{Try package option commandnameprefix with "always" or "ifneeded", e.g. usepackage[commandnameprefix=always]{changes}} +}{} +\IfStrEq{\Changes@optioncommandnameprefix}{ifneeded} +{ +\def\Changes@commandname{\Changes@commandprefix#1} +\PackageWarning{changes}{Command #1 is already defined, using \Changes@commandname} +}{} +} +{} +} +} +\newrobustcmd{\Changes@output}[7]{% +\ifbool{Changes@optiondraft}% {% \Changes@check@author{#2}% \Changes@set@color{#2}% {% -\ifthenelse{% -\equal{#1}{added}\or% -\equal{#1}{deleted}\or% -\equal{#1}{replaced}\or% -\equal{#1}{highlight}% -}% +\IfIsInList{#1}{added|deleted|replaced|highlight}% {% -\ifIsEmpty{#5}% +\IfIsEmpty{#5}% {% -\ifthenelse{\isAuthorEmpty{#2}{left}}% +\IfIsAuthorEmptyAtPosition{#2}{left}% {}% {{% -\ifthenelse{\isColored}% +\IfIsColored% {\color{authorcolor}}% {}% \Changes@Markup@author{\Changes@output@author{#2}{left}}% }}% }{}% {% -\ifthenelse{\not\equal{#1}{highlight}}% -{% -\ifthenelse{\isColored}% +\IfStrEq{#1}{highlight}% +{}{% +\IfIsColored% {\color{authorcolor}}% {}% -}{}% -\ifthenelse{\equal{#1}{added}}{\Changes@Markup@added{#3}}{}% -\ifthenelse{\equal{#1}{deleted}}{\Changes@Markup@deleted{#4}}{}% -\ifthenelse{\equal{#1}{replaced}}{{\Changes@Markup@added{#3}}\allowbreak\Changes@Markup@deleted{#4}}{}% -\ifthenelse{\equal{#1}{highlight}}{\Changes@Markup@highlight{#3}}{}% }% -\ifIsEmpty{#5}% +\IfStrEq{#1}{added}{\Changes@Markup@added{#3}}{}% +\IfStrEq{#1}{deleted}{\Changes@Markup@deleted{#4}}{}% +\IfStrEq{#1}{replaced}{{\Changes@Markup@added{#3}}\allowbreak\Changes@Markup@deleted{#4}}{}% +\IfStrEq{#1}{highlight}{\Changes@Markup@highlight{#3}}{}% +}% +\IfIsEmpty{#5}% {% -\ifthenelse{\isAuthorEmpty{#2}{right}}% +\IfIsAuthorEmptyAtPosition{#2}{right}% {}% {{% -\ifthenelse{\isColored}% +\IfIsColored% {\color{authorcolor}}% {}% \Changes@Markup@author{\Changes@output@author{#2}{right}}% @@ -667,7 +669,7 @@ truncate={breakall,fit} }{}% \stepcounter{Changes@#1Count#2}% }{}% -\ifIsEmpty{#5}% +\IfIsEmpty{#5}% {}% {% \stepcounter{Changes@commentCount#2}% @@ -678,100 +680,56 @@ truncate={breakall,fit} {\Changes@output@author{#2}{left}\Changes@output@author{#2}{right}}% }% }% -\ifIsEmpty{#2}% +\IfIsEmpty{#2}% {\def\Changes@locid{}}% {\def\Changes@locid{~(#2)}}% -\addtocontents{loc}{\protect\ChangesListline{#1}{#6\Changes@locid}{#7}{\thepage}}% +\addtocontents{\Changes@locextension}{\protect\ChangesListline{#1}{#6\Changes@locid}{#7}{\thepage}}% }% {% -\ifIsEmpty{#3}% +\IfIsEmpty{#3}% {\@bsphack\@esphack}% {#3}% }% } -\newcommand{\added}[2][\@empty]{% +\Changes@set@commandname{added} +\expandafter\newcommand\expandafter{\csname\Changes@commandname\endcsname}[2][\@empty]{% \setkeys{Changes@added}{#1}% -\ifIsEmpty{\Changes@added@remark}% -{}% -{% -\ifIsEmpty{\Changes@added@comment}% -{% -\PackageWarning{changes}{You used the deprecated option 'remark' in your markup, please use 'comment' instead.}% -\let\Changes@added@comment\Changes@added@remark% -}% -{% -\PackageWarning{changes}{You used both options 'comment' and the deprecated 'remark' in your markup, please use 'comment' only, the content of 'remark' will be ignored.}% -}% -}% \Changes@output% {added}% {\Changes@added@id}% {#2}% {}% {\Changes@added@comment}% -{\changesaddname}% +{\changesaddedname}% {#2}% } -\newcommand{\deleted}[2][\@empty]{% +\Changes@set@commandname{deleted} +\expandafter\newcommand\expandafter{\csname\Changes@commandname\endcsname}[2][\@empty]{% \setkeys{Changes@deleted}{#1}% -\ifIsEmpty{\Changes@deleted@remark}% -{}% -{% -\ifIsEmpty{\Changes@deleted@comment}% -{% -\PackageWarning{changes}{You used the deprecated option 'remark' in your markup, please use 'comment' instead.}% -\let\Changes@deleted@comment\Changes@deleted@remark% -}% -{% -\PackageWarning{changes}{You used both options 'comment' and the deprecated 'remark' in your markup, please use 'comment' only, the content of 'remark' will be ignored.}% -}% -}% \Changes@output% {deleted}% {\Changes@deleted@id}% {}% {#2}% {\Changes@deleted@comment}% -{\changesdeletename}% +{\changesdeletedname}% {#2}% } -\newcommand{\replaced}[3][\@empty]{% +\Changes@set@commandname{replaced} +\expandafter\newcommand\expandafter{\csname\Changes@commandname\endcsname}[3][\@empty]{% \setkeys{Changes@replaced}{#1}% -\ifIsEmpty{\Changes@replaced@remark}% -{}% -{% -\ifIsEmpty{\Changes@replaced@comment}% -{% -\PackageWarning{changes}{You used the deprecated option 'remark' in your markup, please use 'comment' instead.}% -\let\Changes@replaced@comment\Changes@replaced@remark% -}% -{% -\PackageWarning{changes}{You used both options 'comment' and the deprecated 'remark' in your markup, please use 'comment' only, the content of 'remark' will be ignored.}% -}% -}% \Changes@output% {replaced}% {\Changes@replaced@id}% {#2}% {#3}% {\Changes@replaced@comment}% -{\changesreplacename}% +{\changesreplacedname}% {#2}% } -\newcommand{\highlight}[2][\@empty]{% +\Changes@set@commandname{highlight} +\expandafter\newcommand\expandafter{\csname\Changes@commandname\endcsname}[2][\@empty]{% \setkeys{Changes@highlight}{#1}% -\ifIsEmpty{\Changes@highlight@remark}% -{}% -{% -\ifIsEmpty{\Changes@highlight@comment}% -{% -\PackageWarning{changes}{You used the deprecated option 'remark' in your markup, please use 'comment' instead.}% -\let\Changes@highlight@comment\Changes@highlight@remark% -}% -{% -\PackageWarning{changes}{You used both options 'comment' and the deprecated 'remark' in your markup, please use 'comment' only, the content of 'remark' will be ignored.}% -}% -}% \Changes@output% {highlight}% {\Changes@highlight@id}% @@ -781,7 +739,8 @@ truncate={breakall,fit} {\changeshighlightname}% {#2}% } -\newcommand{\comment}[2][\@empty]{% +\Changes@set@commandname{comment} +\expandafter\newcommand\expandafter{\csname\Changes@commandname\endcsname}[2][\@empty]{% \setkeys{Changes@comment}{#1}% \Changes@output% {comment}% @@ -795,161 +754,142 @@ truncate={breakall,fit} \RequirePackage{truncate} \renewcommand\TruncateMarker{ [\dots\negthinspace]\ } \def\changes@chopline#1;#2;#3;#4;#5;#6;#7;#8 \\{% -\def\Changes@InID{#1}% -\def\Changes@InColor{#2}% -\def\Changes@InName{#3}% -\def\Changes@InAdded{#4}% -\def\Changes@InDeleted{#5}% -\def\Changes@InReplaced{#6}% -\def\Changes@InHighlight{#7}% -\def\Changes@InComment{#8}% +\def\Changes@Inid{#1}% +\def\Changes@Incolor{#2}% +\def\Changes@Inname{#3}% +\def\Changes@Inadded{#4}% +\def\Changes@Indeleted{#5}% +\def\Changes@Inreplaced{#6}% +\def\Changes@Inhighlight{#7}% +\def\Changes@Incomment{#8}% } \newcommand{\ChangesListline}[4]{% -\IfSubStr{\Changes@loc@show}{#1}{% +\IfIsInList{#1}{\Changes@loc@show}{% \@ifundefined{@dotsep}% -{\def\@dotsep{4.5}}{}% -\@dottedtocline{1}{0px}{2em}{#2: \truncate{\Changes@truncate@width}{#3}}{#4}% +{\def\@dotsep{4.5}}% +{}% +\@dottedtocline{1}{0pt}{2em}{#2: \truncate{\Changes@truncate@width}{#3}}{#4}% }{}% } -\newlength{\Changes@truncate@width} -\setlength{\Changes@truncate@width}{.6\textwidth} \newcommand{\settruncatewidth}[1]{ \setlength{\Changes@truncate@width}{#1} } -\newlength{\Changes@summary@width} -\setlength{\Changes@summary@width}{.3\textwidth} +\newlength{\Changes@truncate@width} +\settruncatewidth{.6\textwidth} \newcommand{\setsummarywidth}[1]{ \setlength{\Changes@summary@width}{#1} } \newcommand{\setsummarytowidth}[1]{ \settowidth{\Changes@summary@width}{#1} } -\newcommand{\Changes@summaryline}[4]{% -\IfSubStr{\Changes@loc@show}{#1}{% -\ifthenelse{\not\equal{\Changes@loc@style}{compactsummary} \or #2 > 0}% -{% -\parbox{\Changes@summary@width}{#3~\let\cleaders\leaders\dotfill~#2}#4% -}{}% -}{}% -} -\newboolean{Changes@MoreLines} -\newboolean{Changes@ShowOK} +\newlength{\Changes@summary@width} +\setsummarywidth{.3\textwidth} \newcommand{\listofchanges}[1][\@empty]{% \setkeys{Changes@loc}{#1}% -\ifthenelse{\boolean{Changes@optiondraft}}% +\ifbool{Changes@optiondraft}% {% -\ifIsEmpty{\Changes@loc@style}% -{\def\Changes@loc@style{list}}% -{% -\ifthenelse{% -\equal{\Changes@loc@style}{list}\or% -\equal{\Changes@loc@style}{summary}\or% -\equal{\Changes@loc@style}{compactsummary}% -}% +\IfIsInList{\Changes@loc@style}{list|summary|compactsummary}% {}% {% \PackageWarning{changes}{Wrong style for list of changes: '\Changes@loc@style', using 'list' instead.}% -\def\Changes@loc@style{list}% +\def\Changes@loc@style{}% }% -}% -\ifIsEmpty{\Changes@loc@show}% -{\def\Changes@loc@show{all}}% -{% -\setboolean{Changes@ShowOK}{false}% -\ifthenelse{\equal{\Changes@loc@show}{all}}{\setboolean{Changes@ShowOK}{true}}{}% -\IfSubStr{\Changes@loc@show}{added}{\setboolean{Changes@ShowOK}{true}}{}% -\IfSubStr{\Changes@loc@show}{deleted}{\setboolean{Changes@ShowOK}{true}}{}% -\IfSubStr{\Changes@loc@show}{replaced}{\setboolean{Changes@ShowOK}{true}}{}% -\IfSubStr{\Changes@loc@show}{highlight}{\setboolean{Changes@ShowOK}{true}}{}% -\IfSubStr{\Changes@loc@show}{comment}{\setboolean{Changes@ShowOK}{true}}{}% -\ifthenelse{\boolean{Changes@ShowOK}}% +\IfIsEmpty{\Changes@loc@style}% +{\def\Changes@loc@style{list}}% +{}% +\IfStrEq{\Changes@loc@show}{all}% +{\def\Changes@loc@show{added|deleted|replaced|highlight|comment}}% +{}% +\IfIsInList{\Changes@loc@show}{added|deleted|replaced|highlight|comment}% {}% {% \PackageWarning{changes}{Wrong show-value for list of changes: '\Changes@loc@show', using 'all' instead.}% -\def\Changes@loc@show{all}% +\def\Changes@loc@show{}% }% -}% -\ifthenelse{\equal{\Changes@loc@show}{all}}% -{% -\def\Changes@loc@show{added|deleted|replaced|highlight|comment}% -}{}% -\def\Changes@heading{\Changes@loc@title} -\ifIsEmpty{\Changes@loc@title}% +\IfIsEmpty{\Changes@loc@show}% +{\def\Changes@loc@show{added|deleted|replaced|highlight|comment}}% +{}% +\IfIsEmpty{\Changes@loc@title}% {% -\ifthenelse{\equal{\Changes@loc@style}{list}}% +\IfStrEq{\Changes@loc@style}{list}% {\def\Changes@heading{\listofchangesname}}{}% -\ifthenelse{\equal{\Changes@loc@style}{summary}}% +\IfStrEq{\Changes@loc@style}{summary}% {\def\Changes@heading{\summaryofchangesname}}{}% -\ifthenelse{\equal{\Changes@loc@style}{compactsummary}}% +\IfStrEq{\Changes@loc@style}{compactsummary}% {\def\Changes@heading{\compactsummaryofchangesname}}{}% -}{}% +}% +{\def\Changes@heading{\Changes@loc@title}}% \section*{\Changes@heading} -\ifthenelse{\equal{\Changes@loc@style}{list}}% +\IfIsInList{\Changes@loc@style}{list}% {% -\IfFileExists{\jobname.loc}% +\IfFileExists{\jobname.\Changes@locextension}% {% -\setboolean{Changes@MoreLines}{true}% \newread\Changes@InFile% -\openin\Changes@InFile = \jobname.loc% -\whiledo{\boolean{Changes@MoreLines}}{% +\openin\Changes@InFile=\jobname.\Changes@locextension% +\loop\unless\ifeof\Changes@InFile% \read\Changes@InFile to \Changes@Line% -\ifeof\Changes@InFile% -\setboolean{Changes@MoreLines}{false}% -\else% +\ifeof\Changes@InFile\else% \Changes@Line% -\fi% -}% +\fi +\repeat \closein\Changes@InFile% }{% \emph{\changesnoloc}% \PackageWarning{changes}{LaTeX rerun needed for list of changes}% }% }{}% -\ifthenelse{\equal{\Changes@loc@style}{summary} \or \equal{\Changes@loc@style}{compactsummary}}% +\IfIsInList{\Changes@loc@style}{summary|compactsummary}% {% -\IfFileExists{\jobname.\Changes@extension}% +\IfFileExists{\jobname.\Changes@socextension}% {% -\setboolean{Changes@MoreLines}{true}% \newread\Changes@InFile% -\openin\Changes@InFile = \jobname.\Changes@extension% -\whiledo{\boolean{Changes@MoreLines}}{% +\openin\Changes@InFile = \jobname.\Changes@socextension% +\loop\unless\ifeof\Changes@InFile% \read\Changes@InFile to \Changes@Line% -\ifeof\Changes@InFile% -\setboolean{Changes@MoreLines}{false}% -\else% +\ifeof\Changes@InFile\else% \expandafter\changes@chopline\Changes@Line\\% \textbf{% -\ifthenelse{\isColored}% -{\color{\Changes@InColor}}% +\IfIsColored% +{\color{\Changes@Incolor}}% {}% -\ifthenelse{\equal{\Changes@InID}{\@empty}}% +\IfIsAnonymous{\Changes@Inid}% {\changesauthorname: \changesanonymousname}% {% -\changesauthorname: \Changes@InID% -\ifthenelse{\equal{\Changes@InName}{\@empty}}% +\changesauthorname: \Changes@Inid% +\IfIsEmpty{\Changes@Inname}% {}% -{ (\Changes@InName)}% +{ (\Changes@Inname)}% }% }\\% -\ifthenelse{% -\Changes@InAdded > 0 \or% -\Changes@InDeleted > 0 \or% -\Changes@InReplaced > 0 \or% -\Changes@InHighlight > 0 \or% -\Changes@InComment > 0% +\numdef{\Changes@InSum}{0}% +\renewcommand*{\do}[1]{% +\numdef{\Changes@InSum}{\Changes@InSum + \csuse{Changes@In########1}}% +}% +\expandafter\dopsvlist\expandafter{\Changes@loc@show}% +\ifnumcomp{\Changes@InSum}{=}{0}% +{% +\parbox{\Changes@summary@width}{\changesnochanges}\\[1ex]% }% {% -\Changes@summaryline{added}{\Changes@InAdded}{\changesaddname}{\\}% -\Changes@summaryline{deleted}{\Changes@InDeleted}{\changesdeletename}{\\}% -\Changes@summaryline{replaced}{\Changes@InReplaced}{\changesreplacename}{\\}% -\Changes@summaryline{highlight}{\Changes@InHighlight}{\changeshighlightname}{\\}% -\Changes@summaryline{comment}{\Changes@InComment}{\changescommentname}{\\[1ex]}% +\numdef{\Changes@InCount}{0}% +\renewcommand*{\do}[1]{% +\numdef{\Changes@InCount}{\Changes@InCount + \csuse{Changes@In########1}}% +\ifboolexpr{% +not test {\IfStrEq{\Changes@loc@style}{compactsummary}} or% +test {\ifnumgreater{\csuse{Changes@In########1}}{0}}% }% {% -\parbox{\Changes@summary@width}{\changesnochanges}\\[1ex]% +\parbox{\Changes@summary@width}{\csuse{changes########1name}~\let\cleaders\leaders\dotfill~\csuse{Changes@In########1}}% +\ifnumless{\Changes@InCount}{\Changes@InSum}% +{\\}% +{\\[1ex]}% }% -\fi% +{}% }% +\expandafter\dopsvlist\expandafter{\Changes@loc@show}% +}% +\fi% +\repeat \closein\Changes@InFile% }{% \emph{\changesnosoc}% @@ -960,31 +900,31 @@ truncate={breakall,fit} } \AtEndDocument{% \newwrite\Changes@OutFile -\immediate\openout\Changes@OutFile = \jobname.\Changes@extension +\immediate\openout\Changes@OutFile = \jobname.\Changes@socextension \let\Changes@protect\protect \let\protect\@unexpandable@protect \setcounter{Changes@Author}{0} -\whiledo{\value{Changes@Author} < \value{Changes@AuthorCount}}{% +\loop\unless\ifnum\theChanges@Author = \value{Changes@AuthorCount} \stepcounter{Changes@Author}% -\def\Changes@ID{\@nameuse{Changes@AuthorID\theChanges@Author}}% +\def\Changes@ID{\csuse{Changes@AuthorID\theChanges@Author}}% \immediate\write\Changes@OutFile{\Changes@ID;% -\@nameuse{Changes@AuthorColor\Changes@ID};% -\@nameuse{Changes@AuthorName\Changes@ID};% +\csuse{Changes@AuthorColor\Changes@ID};% +\csuse{Changes@AuthorName\Changes@ID};% \the\value{Changes@addedCount\Changes@ID};% \the\value{Changes@deletedCount\Changes@ID};% \the\value{Changes@replacedCount\Changes@ID};% \the\value{Changes@highlightCount\Changes@ID};% \the\value{Changes@commentCount\Changes@ID}}% -}% +\repeat \immediate\closeout\Changes@OutFile \let\protect\Changes@protect \if@filesw -\@ifundefined{tf@loc}{% -\expandafter\newwrite\csname tf@loc\endcsname -\immediate\openout \csname tf@loc\endcsname \jobname.loc\relax -}{}% +\@ifundefined{tf@\Changes@locextension}{ +\expandafter\newwrite\csname tf@\Changes@locextension\endcsname +\immediate\openout \csname tf@\Changes@locextension\endcsname \jobname.\Changes@locextension\relax +}{} \fi } -%% Copyright 2007-2020 Ekkart Kleinod +%% Copyright 2007-2021 Ekkart Kleinod %% %% End of file `changes.sty'. -- cgit v1.2.3