diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-changes.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lwarp/lwarp-changes.sty | 344 |
1 files changed, 239 insertions, 105 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-changes.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-changes.sty index e4734ba1975..9139b3223d1 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-changes.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-changes.sty @@ -15,9 +15,9 @@ %% http://www.latex-project.org/lppl.txt %% and version 1.3 or later is part of all distributions of LaTeX %% version 2005/12/01 or later. -\LWR@ProvidesPackagePass{changes}[2019/01/26] +\LWR@ProvidesPackagePass{changes}[2021/02/14] \renewcommand{\ChangesListline}[4]{% - \IfSubStr{\Changes@loc@show}{#1}{% + \IfIsInList{#1}{\Changes@loc@show}{% \LWR@startpars% #2: #3 \qquad \nameref{\BaseJobname-autopage-#4}% @@ -25,112 +25,246 @@ }{}% } -\renewcommand{\Changes@summaryline}[4]{% - \IfSubStr{\Changes@loc@show}{#1}{% - \ifthenelse{\not\equal{\Changes@loc@style}{compactsummary} \or #2 > 0}% - {% - #3:~#2#4% - }{}% - }{}% +\renewcommand{\listofchanges}[1][\@empty]{% +\setkeys{Changes@loc}{#1}% +\ifbool{Changes@optiondraft}% +{% +\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{}% +}% +\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{}% +}% +\IfIsEmpty{\Changes@loc@show}% +{\def\Changes@loc@show{added|deleted|replaced|highlight|comment}}% +{}% +\IfIsEmpty{\Changes@loc@title}% +{% +\IfStrEq{\Changes@loc@style}{list}% +{\def\Changes@heading{\listofchangesname}}{}% +\IfStrEq{\Changes@loc@style}{summary}% +{\def\Changes@heading{\summaryofchangesname}}{}% +\IfStrEq{\Changes@loc@style}{compactsummary}% +{\def\Changes@heading{\compactsummaryofchangesname}}{}% +}% +{\def\Changes@heading{\Changes@loc@title}}% +\section*{\Changes@heading} +\IfIsInList{\Changes@loc@style}{list}% +{% +\IfFileExists{\jobname.\Changes@locextension}% +{% +\newread\Changes@InFile% +\openin\Changes@InFile=\jobname.\Changes@locextension% +\loop\unless\ifeof\Changes@InFile% +\read\Changes@InFile to \Changes@Line% +\ifeof\Changes@InFile\else% +\Changes@Line% +\fi +\repeat +\closein\Changes@InFile% +}{% +\emph{\changesnoloc}% +\PackageWarning{changes}{LaTeX rerun needed for list of changes}% +}% +}{}% +\IfIsInList{\Changes@loc@style}{summary|compactsummary}% +{% +\IfFileExists{\jobname.\Changes@socextension}% +{% +\newread\Changes@InFile% +\openin\Changes@InFile = \jobname.\Changes@socextension% +\loop\unless\ifeof\Changes@InFile% +\read\Changes@InFile to \Changes@Line% +\ifeof\Changes@InFile\else% +\expandafter\changes@chopline\Changes@Line\\% +\textbf{% +\IfIsColored% +{\color{\Changes@Incolor}}% +{}% +\IfIsAnonymous{\Changes@Inid}% +{% + \LWR@textcurrentcolor{% lwarp + \changesauthorname: \changesanonymousname% + }% lwarp +}% +{% + \LWR@textcurrentcolor{% lwarp +\changesauthorname: \Changes@Inid% + }% lwarp +\IfIsEmpty{\Changes@Inname}% +{}% +{ % + \LWR@textcurrentcolor{% lwarp +(\Changes@Inname)% + }% lwarp +}% +}% +}\\% +\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}% +{% + \changesnochanges% + \par% \lwarp +}% +{% +\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}}% +}% +{% +\csuse{changes########1name}~% +\dotfill~% \lwarp +\csuse{Changes@In########1}% +{\\}% +}% +{}% +}% +\expandafter\dopsvlist\expandafter{\Changes@loc@show}% + \par% lwarp +}% +\fi% +\repeat +\closein\Changes@InFile% +}{% +\emph{\changesnosoc}% +\PackageWarning{changes}{LaTeX rerun needed for summary of changes}% +}% +}{}% +}{}% } -\xpatchcmd{\listofchanges} - {{\changesauthorname: \changesanonymousname}} - {{\LWR@textcurrentcolor{\changesauthorname: \changesanonymousname}}} - {} - {\LWR@patcherror{changes}{listofchanges A}} - -\xpatchcmd{\listofchanges} - {\changesauthorname: \Changes@InID} - {\LWR@textcurrentcolor{\changesauthorname: \Changes@InID}} - {} - {\LWR@patcherror{changes}{listofchanges B}} - -\xpatchcmd{\listofchanges} - {(\Changes@InName)} - {\LWR@textcurrentcolor{(\Changes@InName)}} - {} - {\LWR@patcherror{changes}{listofchanges C}} - -\xpatchcmd{\listofchanges} - {\parbox{\Changes@summary@width}} - {} - {} - {\LWR@patcherror{changes}{listofchanges D}} - -\xpatchcmd{\Changes@Markup@comment} - {% - \ifthenelse{\isAnonymous{#2}}% - {\textbf{[\arabic{Changes@commentCount#2}]:} }% - {\textbf{[#3~\arabic{Changes@commentCount#2}]:} }% - #1% - } - {% - \LWR@textcurrentcolor{% lwarp - \ifthenelse{\isAnonymous{#2}}% - {\textbf{[\arabic{Changes@commentCount#2}]:} }% - {\textbf{[#3~\arabic{Changes@commentCount#2}]:} }% - #1% - }% lwarp - } - {} - {\LWR@patcherror{changes}{\Changes@Markup@comment A}} - -\xpatchcmd{\Changes@Markup@comment} - {% - \uwave{% - \ifthenelse{\isAnonymous{#2}}% - {\textbf{[\arabic{Changes@commentCount#2}]:} }% - {\textbf{[#3~\arabic{Changes@commentCount#2}]:} }% - #1% - }% - } - {% - \LWR@textcurrentcolor{% lwarp - \uwave{% - \ifthenelse{\isAnonymous{#2}}% - {\textbf{[\arabic{Changes@commentCount#2}]:} }% - {\textbf{[#3~\arabic{Changes@commentCount#2}]:} }% - #1% - }% - }% lwarp - } - {} - {\LWR@patcherror{changes}{\Changes@Markup@comment B}} - -\xpatchcmd{\Changes@output} - {\Changes@Markup@author{\Changes@output@author{#2}{left}}} - {\LWR@textcurrentcolor{\Changes@Markup@author{\Changes@output@author{#2}{left}}}} - {} - {\LWR@patcherror{changes}{Changes@output A}} - -\xpatchcmd{\Changes@output} - {% - \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}}{}% - } - {% - \LWR@textcurrentcolor{% - \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}}{}% - }% - } - {} - {\LWR@patcherror{changes}{Changes@output B}} +\renewcommand{\Changes@Markup@comment}[3]{% +\IfStrEq{\Changes@optioncommentmarkup}{todo}% +{% +\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}% +}{}% +\IfStrEq{\Changes@optioncommentmarkup}{margin}% +{% +\marginpar{% +\IfIsColored% +{\leavevmode\color{authorcolor}}% +{}% + \LWR@textcurrentcolor{% lwarp +\textbf{[\IfIsAnonymous{#2}{}{#3~}\arabic{Changes@commentCount#2}]:} #1% + }% lwarp +}% +}{}% +\IfStrEq{\Changes@optioncommentmarkup}{footnote}% +{% +\footnote{% + \LWR@textcurrentcolor{% lwarp +\textbf{[\IfIsAnonymous{#2}{}{#3~}\arabic{Changes@commentCount#2}]:} #1% + }% lwarp +}% +}{}% +\IfStrEq{\Changes@optioncommentmarkup}{uwave}% +{% +{% +\IfIsColored% +{\color{authorcolor}}% +{}% +\allowbreak% +\uwave{% +\textbf{[\IfIsAnonymous{#2}{}{#3~}\arabic{Changes@commentCount#2}]:} #1% +}% +}% +}{}% +} -\xpatchcmd{\Changes@output} - {\Changes@Markup@author{\Changes@output@author{#2}{right}}} - {\LWR@textcurrentcolor{\Changes@Markup@author{\Changes@output@author{#2}{right}}}} - {} - {\LWR@patcherror{changes}{Changes@output C}} +\renewrobustcmd{\Changes@output}[7]{% +\ifbool{Changes@optiondraft}% +{% +\Changes@check@author{#2}% +\Changes@set@color{#2}% +{% +\IfIsInList{#1}{added|deleted|replaced|highlight}% +{% +\IfIsEmpty{#5}% +{% +\IfIsAuthorEmptyAtPosition{#2}{left}% +{}% +{{% +\IfIsColored% +{\color{authorcolor}}% +{}% + \LWR@textcurrentcolor{% lwarp +\Changes@Markup@author{\Changes@output@author{#2}{left}}% + }% lwarp +}}% +}{}% +{% +\IfStrEq{#1}{highlight}% +{}{% +\IfIsColored% +{\color{authorcolor}}% +{}% +}% + \LWR@textcurrentcolor{% lwarp +\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}}{}% + }% lwarp +}% +\IfIsEmpty{#5}% +{% +\IfIsAuthorEmptyAtPosition{#2}{right}% +{}% +{{% +\IfIsColored% +{\color{authorcolor}}% +{}% + \LWR@textcurrentcolor{% lwarp +\Changes@Markup@author{\Changes@output@author{#2}{right}}% + }% lwarp +}}% +}{}% +\stepcounter{Changes@#1Count#2}% +}{}% +\IfIsEmpty{#5}% +{}% +{% +\stepcounter{Changes@commentCount#2}% +\Changes@set@commentcount{#2}% +\Changes@Markup@comment% +{#5}% +{#2}% +{\Changes@output@author{#2}{left}\Changes@output@author{#2}{right}}% +}% +}% +\IfIsEmpty{#2}% +{\def\Changes@locid{}}% +{\def\Changes@locid{~(#2)}}% +\addtocontents{\Changes@locextension}{\protect\ChangesListline{#1}{#6\Changes@locid}{#7}{\thepage}}% +}% +{% +\IfIsEmpty{#3}% +{\@bsphack\@esphack}% +{#3}% +}% +} \endinput %% %% End of file `lwarp-changes.sty'. |