diff options
author | Karl Berry <karl@freefriends.org> | 2018-11-04 20:27:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-11-04 20:27:32 +0000 |
commit | 4859175b4924c3eaef115b2863325a3b0ced5e8d (patch) | |
tree | 566e9cc7d2514b30d8a336689d9e1d6664720cb0 /Master/texmf-dist/tex/latex/changes/changes.sty | |
parent | 100a6835ee4907ef9a8778ae422fa36f9791fbbd (diff) |
changes (4nov18)
git-svn-id: svn://tug.org/texlive/trunk@49079 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/changes/changes.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/changes/changes.sty | 682 |
1 files changed, 501 insertions, 181 deletions
diff --git a/Master/texmf-dist/tex/latex/changes/changes.sty b/Master/texmf-dist/tex/latex/changes/changes.sty index 39f0de5b34c..b33624b9a60 100644 --- a/Master/texmf-dist/tex/latex/changes/changes.sty +++ b/Master/texmf-dist/tex/latex/changes/changes.sty @@ -41,10 +41,11 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{changes} -[2018/10/10 v2.1.0 changes package] -\typeout{*** changes package 2018/10/10 v2.1.0 ***} +[2018/11/04 v3.0.0 changes package] +\typeout{*** changes package 2018/11/04 v3.0.0 ***} \RequirePackage{xkeyval} \RequirePackage{xifthen} +\RequirePackage{xstring} \newboolean{Changes@optiondraft} \setboolean{Changes@optiondraft}{true} \DeclareOptionX{draft}{ @@ -55,8 +56,10 @@ \setboolean{Changes@optiondraft}{false} \typeout{changes-option '\CurrentOption'} } -\newcommand{\Changes@optionaddedmarkup}{none} +\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}} @@ -73,14 +76,12 @@ } \ifthenelse{\equal{\Changes@optionmarkup}{default}} { -\renewcommand{\Changes@optionaddedmarkup}{none} -\renewcommand{\Changes@optiondeletedmarkup}{sout} } {} \ifthenelse{\equal{\Changes@optionmarkup}{underlined}} { \renewcommand{\Changes@optionaddedmarkup}{uline} -\renewcommand{\Changes@optiondeletedmarkup}{sout} +\renewcommand{\Changes@optionhighlightmarkup}{uwave} } {} \ifthenelse{\equal{\Changes@optionmarkup}{bfit}} @@ -92,7 +93,7 @@ \ifthenelse{\equal{\Changes@optionmarkup}{nocolor}} { \renewcommand{\Changes@optionaddedmarkup}{uline} -\renewcommand{\Changes@optiondeletedmarkup}{sout} +\renewcommand{\Changes@optionhighlightmarkup}{uwave} } {} \typeout{changes-option 'markup=\Changes@optionmarkup'} @@ -102,14 +103,12 @@ {} { \ifthenelse{ -\equal{#1}{none}\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}{sout}\or -\equal{#1}{xout}\or \equal{#1}{bf}\or \equal{#1}{it}\or \equal{#1}{sl}\or @@ -125,13 +124,13 @@ {} { \ifthenelse{ -\equal{#1}{none}\or +\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}{sout}\or \equal{#1}{xout}\or \equal{#1}{bf}\or \equal{#1}{it}\or @@ -143,6 +142,35 @@ } \typeout{changes-option 'deletedmarkup=\Changes@optiondeletedmarkup'} } +\DeclareOptionX{highlightmarkup}{ +\ifthenelse{\equal{\@empty}{#1}} +{} +{ +\ifthenelse{ +\equal{#1}{background}\or +\equal{#1}{uuline}\or +\equal{#1}{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}} +{} +{ +\ifthenelse{ +\equal{#1}{todo}\or +\equal{#1}{margin}\or +\equal{#1}{footnote}\or +\equal{#1}{uwave} +} +{\renewcommand{\Changes@optioncommentmarkup}{#1}} +{\PackageWarning{changes}{commentmarkup '#1' unknown, using '\Changes@optioncommentmarkup'}} +} +\typeout{changes-option 'commentmarkup=\Changes@optioncommentmarkup'} +} \newcommand{\Changes@optionauthormarkup}{superscript} \DeclareOptionX{authormarkup}{ \ifthenelse{\equal{\@empty}{#1}} @@ -188,6 +216,14 @@ } \typeout{changes-option 'authormarkuptext=\Changes@optionauthormarkuptext'} } +\DeclareOptionX{todonotes}{ +\typeout{todonotes-option '#1', passed to package todonotes} +\PassOptionsToPackage{#1}{todonotes} +} +\DeclareOptionX{truncate}{ +\typeout{truncate-option '#1', passed to package truncate} +\PassOptionsToPackage{#1}{truncate} +} \DeclareOptionX{ulem}{ \typeout{ulem-option '#1', passed to package ulem} \PassOptionsToPackage{#1}{ulem} @@ -203,55 +239,57 @@ \DeclareOptionX<Changes@definechangesauthor>{color}{\def\Changes@definechangesauthor@color{#1}} \presetkeys{Changes@definechangesauthor}{ name=\@empty, -color=black +color=blue }{} \DeclareOptionX<Changes@added>{id}{\def\Changes@added@id{#1}} \DeclareOptionX<Changes@added>{remark}{\def\Changes@added@remark{#1}} -\DeclareOptionX<Changes@added>{decision}{\def\Changes@added@dec{#1}} -\DeclareOptionX<Changes@added>{decisionid}{\def\Changes@added@decid{#1}} -\DeclareOptionX<Changes@added>{decisionremark}{\def\Changes@added@decrem{#1}} +\DeclareOptionX<Changes@added>{comment}{\def\Changes@added@comment{#1}} \presetkeys{Changes@added}{ id=\@empty, remark=\@empty, -decision=\@empty, -decisionid=\@empty, -decisionremark=\@empty +comment=\@empty, }{} \DeclareOptionX<Changes@deleted>{id}{\def\Changes@deleted@id{#1}} \DeclareOptionX<Changes@deleted>{remark}{\def\Changes@deleted@remark{#1}} -\DeclareOptionX<Changes@deleted>{decision}{\def\Changes@deleted@dec{#1}} -\DeclareOptionX<Changes@deleted>{decisionid}{\def\Changes@deleted@decid{#1}} -\DeclareOptionX<Changes@deleted>{decisionremark}{\def\Changes@deleted@decrem{#1}} +\DeclareOptionX<Changes@deleted>{comment}{\def\Changes@deleted@comment{#1}} \presetkeys{Changes@deleted}{ id=\@empty, remark=\@empty, -decision=\@empty, -decisionid=\@empty, -decisionremark=\@empty +comment=\@empty, }{} \DeclareOptionX<Changes@replaced>{id}{\def\Changes@replaced@id{#1}} \DeclareOptionX<Changes@replaced>{remark}{\def\Changes@replaced@remark{#1}} -\DeclareOptionX<Changes@replaced>{decision}{\def\Changes@replaced@dec{#1}} -\DeclareOptionX<Changes@replaced>{decisionid}{\def\Changes@replaced@decid{#1}} -\DeclareOptionX<Changes@replaced>{decisionremark}{\def\Changes@replaced@decrem{#1}} +\DeclareOptionX<Changes@replaced>{comment}{\def\Changes@replaced@comment{#1}} \presetkeys{Changes@replaced}{ id=\@empty, remark=\@empty, -decision=\@empty, -decisionid=\@empty, -decisionremark=\@empty +comment=\@empty, +}{} +\DeclareOptionX<Changes@highlight>{id}{\def\Changes@highlight@id{#1}} +\DeclareOptionX<Changes@highlight>{remark}{\def\Changes@highlight@remark{#1}} +\DeclareOptionX<Changes@highlight>{comment}{\def\Changes@highlight@comment{#1}} +\presetkeys{Changes@highlight}{ +id=\@empty, +remark=\@empty, +comment=\@empty, +}{} +\DeclareOptionX<Changes@comment>{id}{\def\Changes@comment@id{#1}} +\presetkeys{Changes@comment}{ +id=\@empty, }{} \DeclareOptionX<Changes@loc>{style}{\def\Changes@loc@style{#1}} +\DeclareOptionX<Changes@loc>{title}{\def\Changes@loc@title{#1}} +\DeclareOptionX<Changes@loc>{show}{\def\Changes@loc@show{#1}} \presetkeys{Changes@loc}{ -style=list +style=list, +title=\@empty, +show=all, }{} \ProcessOptionsX*\relax -\newboolean{Changes@colored} -\setboolean{Changes@colored}{true} -\ifthenelse{\equal{\Changes@optionmarkup}{nocolor}} -{\setboolean{Changes@colored}{false}} -{} -\ifthenelse{\boolean{Changes@colored}} +\newtest{\isColored}{% +\not\equal{\Changes@optionmarkup}{nocolor}% +} +\ifthenelse{\isColored} { \RequirePackage{xcolor} \RequirePackage{pdfcolmk} @@ -263,25 +301,35 @@ style=list \equal{\Changes@optionaddedmarkup}{uwave}\or \equal{\Changes@optionaddedmarkup}{dashuline}\or \equal{\Changes@optionaddedmarkup}{dotuline}\or -\equal{\Changes@optionaddedmarkup}{sout}\or -\equal{\Changes@optionaddedmarkup}{xout}\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} +\equal{\Changes@optiondeletedmarkup}{xout}\or +\equal{\Changes@optioncommentmarkup}{uwave}\or +\equal{\Changes@optionhighlightmarkup}{uuline}\or +\equal{\Changes@optionhighlightmarkup}{uwave} } {\RequirePackage[normalem,normalbf]{ulem}} {} +\ifthenelse{ +\equal{\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} @@ -296,51 +344,71 @@ style=list { \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\changeshighlightname{Hervorgehoben}} +\addto\captionsngerman{\def\changescommentname{Kommentiert}} \addto\captionsngerman{\def\changesauthorname{Autor}} \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.}} \addto\captionsngerman{\def\changesnosoc{\"Anderungen nach dem n\"achsten \LaTeX-Lauf verf\"ugbar.}} \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\changeshighlightname{Hervorgehoben}} +\addto\captionsgerman{\def\changescommentname{Kommentiert}} \addto\captionsgerman{\def\changesauthorname{Autor}} \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.}} \addto\captionsgerman{\def\changesnosoc{\"Anderungen nach dem n\"achsten \LaTeX-Lauf verf\"ugbar.}} \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\changeshighlightname{Highlighted}} +\addto\captionsenglish{\def\changescommentname{Commented}} \addto\captionsenglish{\def\changesauthorname{Author}} \addto\captionsenglish{\def\changesanonymousname{anonymous}} +\addto\captionsenglish{\def\changesnochanges{No changes.}} \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\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\changeshighlightname{Highlighted}} +\addto\captionsbritish{\def\changescommentname{Commented}} \addto\captionsbritish{\def\changesauthorname{Author}} \addto\captionsbritish{\def\changesanonymousname{anonymous}} +\addto\captionsbritish{\def\changesnochanges{No changes.}} \addto\captionsbritish{\def\changesnoloc{List of changes is available after the next \LaTeX\ run.}} \addto\captionsbritish{\def\changesnosoc{Summary of changes is available after the next \LaTeX\ run.}} \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\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}} \addto\captionsitalian{\def\changesanonymousname{anonimo}} +\addto\captionsitalian{\def\changesnochanges{Nessuna modifica.}} % translation by me (EK), please provide correct translation \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.}} } @@ -356,21 +424,16 @@ style=list \setkeys{Changes@definechangesauthor}{#1} \stepcounter{Changes@AuthorCount} \@namedef{Changes@AuthorID\theChanges@AuthorCount}{#2} -\expandafter -\let\csname Changes@AuthorName#2\endcsname=\Changes@definechangesauthor@name -\newcounter{Changes@AddCount#2} -\newcounter{Changes@DeleteCount#2} -\newcounter{Changes@ReplaceCount#2} -\ifthenelse{\boolean{Changes@colored}} -{ -\expandafter -\let\csname Changes@AuthorColor#2\endcsname=\Changes@definechangesauthor@color -\colorlet{Changes@Color#2}{\@nameuse{Changes@AuthorColor#2}} -} -{} -} -\definechangesauthor[color=blue]{\@empty} -\newcommand{\Changes@Markup@Author}[1]{% +\expandafter\let\csname Changes@AuthorName#2\endcsname=\Changes@definechangesauthor@name +\expandafter\let\csname Changes@AuthorColor#2\endcsname=\Changes@definechangesauthor@color +\newcounter{Changes@addedCount#2} +\newcounter{Changes@deletedCount#2} +\newcounter{Changes@replacedCount#2} +\newcounter{Changes@highlightCount#2} +\newcounter{Changes@commentCount#2} +} +\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)}{}% @@ -378,55 +441,37 @@ style=list \ifthenelse{\equal{\Changes@optionauthormarkup}{none}}{}{}% } \newcommand{\setauthormarkup}[1]{ -\renewcommand{\Changes@Markup@Author}[1]{#1} +\renewcommand{\Changes@Markup@author}[1]{#1} } -\ifthenelse{\isundefined{\textsubscript}} -{ -\DeclareRobustCommand*\textsubscript[1]{\@textsubscript{\selectfont#1}} -\newcommand{\@textsubscript}[1]{{\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}} -}{} \newcommand{\setauthormarkupposition}[1]{ \renewcommand{\Changes@optionauthormarkupposition}{#1} } \newcommand{\setauthormarkuptext}[1]{ \renewcommand{\Changes@optionauthormarkuptext}{#1} } -\newcommand{\Changes@Remark}[2]{% -\footnote{% -\ifthenelse{\not\equal{#1}{\@empty}}% -{#1: }% -{}% -#2% -}% -} -\newcommand{\setremarkmarkup}[1]{% -\renewcommand{\Changes@Remark}[2]{#1}% -} -\newcommand{\Changes@Markup@Added}[1]{% -\ifthenelse{\equal{\Changes@optionaddedmarkup}{none}}{#1}{}% +\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}{sout}}{\sout{#1}}{}% -\ifthenelse{\equal{\Changes@optionaddedmarkup}{xout}}{\xout{#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}}{}% } \newcommand{\setaddedmarkup}[1]{ -\renewcommand{\Changes@Markup@Added}[1]{#1} +\renewcommand{\Changes@Markup@added}[1]{#1} } -\newcommand{\Changes@Markup@Deleted}[1]{% -\ifthenelse{\equal{\Changes@optiondeletedmarkup}{none}}{#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}{sout}}{\sout{#1}}{}% \ifthenelse{\equal{\Changes@optiondeletedmarkup}{xout}}{\xout{#1}}{}% \ifthenelse{\equal{\Changes@optiondeletedmarkup}{bf}}{\textbf{#1}}{}% \ifthenelse{\equal{\Changes@optiondeletedmarkup}{it}}{\textit{#1}}{}% @@ -434,158 +479,367 @@ style=list \ifthenelse{\equal{\Changes@optiondeletedmarkup}{em}}{\emph{#1}}{}% } \newcommand{\setdeletedmarkup}[1]{ -\renewcommand{\Changes@Markup@Deleted}[1]{#1} +\renewcommand{\Changes@Markup@deleted}[1]{#1} } -\newboolean{Changes@WrongID} -\newcommand{\Changes@output}[9]{% -\ifthenelse{\boolean{Changes@optiondraft}}% +\newcommand{\Changes@Markup@highlight}[1]{% +\ifthenelse{\equal{\Changes@optionhighlightmarkup}{background}}% {% -\setboolean{Changes@WrongID}{true}% -\setcounter{Changes@Author}{0}% -\whiledo{\value{Changes@Author} < \value{Changes@AuthorCount}}{% -\stepcounter{Changes@Author}% -\ifthenelse{\equal{#3}{\@nameuse{Changes@AuthorID\theChanges@Author}}}% -{\setboolean{Changes@WrongID}{false}}% +\ifthenelse{\isColored}% +{\colorbox{authorcolor!30}{#1}}% +{#1}% +}{}% +\ifthenelse{\equal{\Changes@optionhighlightmarkup}{uuline}}{\uuline{#1}}{}% +\ifthenelse{\equal{\Changes@optionhighlightmarkup}{uwave}}{\uwave{#1}}{}% +} +\newcommand{\sethighlightmarkup}[1]{ +\renewcommand{\Changes@Markup@highlight}[1]{#1} +} +\newcommand{\Changes@Markup@comment}[3]{% +\ifthenelse{\equal{\Changes@optioncommentmarkup}{todo}}% +{% +\ifthenelse{\isColored}% +{% +\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}% +}% +}% +}{}% +\ifthenelse{\equal{\Changes@optioncommentmarkup}{margin}}% +{% +\marginpar{% +\ifthenelse{\isColored}% +{\leavevmode\color{authorcolor}}% {}% +\ifthenelse{\isAnonymous{#2}}% +{\textbf{[\arabic{Changes@commentCount#2}]:} }% +{\textbf{[#3~\arabic{Changes@commentCount#2}]:} }% +#1% }% -\ifthenelse{\boolean{Changes@WrongID}}% -{\PackageError{changes}% -{Undefined changes author: #3}% -{You have to define the author #3 with e.g.: \definechangesauthor{#3}}}% +}{}% +\ifthenelse{\equal{\Changes@optioncommentmarkup}{footnote}}% +{% +\footnote{% +\ifthenelse{\isAnonymous{#2}}% +{\textbf{[\arabic{Changes@commentCount#2}]:} }% +{\textbf{[#3~\arabic{Changes@commentCount#2}]:} }% +#1% +}% +}{}% +\ifthenelse{\equal{\Changes@optioncommentmarkup}{uwave}}% +{% +{% +\ifthenelse{\isColored}% +{\color{authorcolor}}% +{}% +\allowbreak% +\uwave{% +\ifthenelse{\isAnonymous{#2}}% +{\textbf{[\arabic{Changes@commentCount#2}]:} }% +{\textbf{[#3~\arabic{Changes@commentCount#2}]:} }% +#1% +}% +}% +}{}% +} +\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} +\newcommand{\Changes@check@author}[1]{% +\ifIsEmpty{#1}% {}% -\ifthenelse{\not\equal{#8}{\@empty}}% {% \setboolean{Changes@WrongID}{true}% \setcounter{Changes@Author}{0}% \whiledo{\value{Changes@Author} < \value{Changes@AuthorCount}}{% \stepcounter{Changes@Author}% -\ifthenelse{\equal{#8}{\@nameuse{Changes@AuthorID\theChanges@Author}}}% +\ifthenelse{\equal{#1}{\@nameuse{Changes@AuthorID\theChanges@Author}}}% {\setboolean{Changes@WrongID}{false}}% {}% }% \ifthenelse{\boolean{Changes@WrongID}}% {\PackageError{changes}% -{Undefined changes author: #8}% -{You have to define the author #8 with e.g.: \definechangesauthor{#8}}}% +{Undefined changes author: #1}% +{You have to define the author #1 with e.g.: \definechangesauthor{#1}}}% {}% }% +} +\DeclareRobustCommand{\Changes@output@author}[2]{% +\ifthenelse{\isAuthorEmpty{#1}{#2}}% {}% +{% \ifthenelse{\equal{\Changes@optionauthormarkuptext}{id}}% {% -\@namedef{Changes@AuthorText}{#3}% -\ifthenelse{\not\equal{#8}{\@empty}}% -{\@namedef{Changes@DecAuthorText}{#8}}% -{}% +#1% }% {}% \ifthenelse{\equal{\Changes@optionauthormarkuptext}{name}}% {% -\@namedef{Changes@AuthorText}{\@nameuse{Changes@AuthorName#3}}% -\ifthenelse{\not\equal{#8}{\@empty}}% -{\@namedef{Changes@DecAuthorText}{\@nameuse{Changes@AuthorName#8}}}% +\ifIsEmpty{\@nameuse{Changes@AuthorName#1}}% +{% +#1% +}{% +\@nameuse{Changes@AuthorName#1}% +}% +}% {}% }% +} +\newcommand{\Changes@set@color}[1]{% +\ifthenelse{\isColored}% +{\colorlet{authorcolor}{\@nameuse{Changes@AuthorColor#1}}}% {}% +} +\newcounter{authorcommentcount} +\newcommand{\Changes@set@commentcount}[1]{% +\setcounter{authorcommentcount}{\value{Changes@commentCount#1}}% +} +\newcommand{\Changes@output}[7]{% +\ifthenelse{\boolean{Changes@optiondraft}}% {% -\ifthenelse{\boolean{Changes@colored}}% -{\color{Changes@Color#3}}% +\Changes@check@author{#2}% +\Changes@set@color{#2}% +{% +\ifthenelse{% +\equal{#1}{added}\or% +\equal{#1}{deleted}\or% +\equal{#1}{replaced}\or% +\equal{#1}{highlight}% +}% +{% +\ifIsEmpty{#5}% +{% +\ifthenelse{\isAuthorEmpty{#2}{left}}% {}% -\ifthenelse{\equal{\Changes@optionauthormarkupposition}{left} \and \not\equal{#3}{\@empty}}% -{\Changes@Markup@Author{\@nameuse{Changes@AuthorText}}}% +{{% +\ifthenelse{\isColored}% +{\color{authorcolor}}% {}% -{#1}% -\ifthenelse{\equal{\Changes@optionauthormarkupposition}{right} \and \not\equal{#3}{\@empty}}% -{\Changes@Markup@Author{\@nameuse{Changes@AuthorText}}}% +\Changes@Markup@author{\Changes@output@author{#2}{left}}% +}}% +}{}% +{% +\ifthenelse{\not\equal{#1}{highlight}}% +{% +\ifthenelse{\isColored}% +{\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}% +{% +\ifthenelse{\isAuthorEmpty{#2}{right}}% {}% -\ifthenelse{\not\equal{#4}{\@empty}}% -{\Changes@Remark{#3}{#4}}% +{{% +\ifthenelse{\isColored}% +{\color{authorcolor}}% {}% +\Changes@Markup@author{\Changes@output@author{#2}{right}}% +}}% +}{}% +\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}}% +}% }% -\ifthenelse{\equal{\@empty}{#3}}% +\ifIsEmpty{#2}% {\def\Changes@locid{}}% -{\def\Changes@locid{~(#3)}}% -\addcontentsline{loc}{subsection}{#6\Changes@locid: \truncate{.3\textwidth}{#5}}% +{\def\Changes@locid{~(#2)}}% +\addtocontents{loc}{\protect\ChangesListline{#1}{#6\Changes@locid}{#7}{\thepage}}% +}% +{% +\ifIsEmpty{#3}% +{\@bsphack\@esphack}% +{#3}% }% -{#2}% } \newcommand{\added}[2][\@empty]{% \setkeys{Changes@added}{#1}% -\let\Changes@esphack\relax% -\Changes@output% -{\Changes@Markup@Added{#2}}% +\ifIsEmpty{\Changes@added@remark}% +{}% {% -\ifthenelse{\equal{\@empty}{#2}}% -{\@bsphack \let\Changes@esphack\@esphack}% -{#2}% +\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}% -{\Changes@added@remark}% {#2}% +{}% +{\Changes@added@comment}% {\changesaddname}% -{\Changes@added@dec}% -{\Changes@added@decid}% -{\Changes@added@decremark}% -\stepcounter{Changes@AddCount\Changes@added@id}% -\Changes@esphack% +{#2}% } \newcommand{\deleted}[2][\@empty]{% \setkeys{Changes@deleted}{#1}% -\let\Changes@esphack\relax% +\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% -{\Changes@Markup@Deleted{#2}}% -{\@bsphack \let\Changes@esphack\@esphack}% +{deleted}% {\Changes@deleted@id}% -{\Changes@deleted@remark}% +{}% {#2}% +{\Changes@deleted@comment}% {\changesdeletename}% -{\Changes@deleted@dec}% -{\Changes@deleted@decid}% -{\Changes@deleted@decremark}% -\stepcounter{Changes@DeleteCount\Changes@deleted@id}% -\Changes@esphack% +{#2}% } \newcommand{\replaced}[3][\@empty]{% \setkeys{Changes@replaced}{#1}% -\let\Changes@esphack\relax% -\Changes@output% -{{\Changes@Markup@Added{#2}}{\Changes@Markup@Deleted{#3}}}% +\ifIsEmpty{\Changes@replaced@remark}% +{}% {% -\ifthenelse{\equal{\@empty}{#2}}% -{\@bsphack \let\Changes@esphack\@esphack}% -{#2}% +\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}% -{\Changes@replaced@remark}% {#2}% +{#3}% +{\Changes@replaced@comment}% {\changesreplacename}% -{\Changes@replaced@dec}% -{\Changes@replaced@decid}% -{\Changes@replaced@decremark}% -\stepcounter{Changes@ReplaceCount\Changes@replaced@id}% -\Changes@esphack% -} -\RequirePackage[breakall]{truncate} -\def\changes@chopline#1;#2;#3;#4;#5;#6 \\{ -\def\Changes@InID{#1} -\def\Changes@InColor{#2} -\def\Changes@InName{#3} -\def\Changes@InAdded{#4} -\def\Changes@InDeleted{#5} -\def\Changes@InReplaced{#6} -} -\newlength{\Changes@Len@summ} -\setlength{\Changes@Len@summ}{.2\textwidth} +{#2}% +} +\newcommand{\highlight}[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}% +{#2}% +{}% +{\Changes@highlight@comment}% +{\changeshighlightname}% +{#2}% +} +\newcommand{\comment}[2][\@empty]{% +\setkeys{Changes@comment}{#1}% +\Changes@output% +{comment}% +{\Changes@comment@id}% +{}% +{}% +{#2}% +{\changescommentname}% +{#2}% +} +\RequirePackage[breakall,fit]{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}% +} +\newcommand{\ChangesListline}[4]{% +\IfSubStr{\Changes@loc@show}{#1}{% +\@dottedtocline{1}{0px}{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} +\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~\dotfill~#2}#4% +}{}% +}{}% +} \newboolean{Changes@MoreLines} -\newcommand{\listofchanges}[1][style=list]{% +\newboolean{Changes@ShowOK} +\newcommand{\listofchanges}[1][\@empty]{% \setkeys{Changes@loc}{#1}% \ifthenelse{\boolean{Changes@optiondraft}}% {% -\ifthenelse{\equal{\@empty}{\Changes@loc@style}}% +\ifIsEmpty{\Changes@loc@style}% {\def\Changes@loc@style{list}}% {% \ifthenelse{% \equal{\Changes@loc@style}{list}\or% -\equal{\Changes@loc@style}{summary}% +\equal{\Changes@loc@style}{summary}\or% +\equal{\Changes@loc@style}{compactsummary}% }% {}% {% @@ -593,18 +847,62 @@ style=list \def\Changes@loc@style{list}% }% }% +\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}}% +{}% +{% +\PackageWarning{changes}{Wrong show-value for list of changes: '\Changes@loc@show', using 'all' instead.}% +\def\Changes@loc@show{all}% +}% +}% +\ifthenelse{\equal{\Changes@loc@show}{all}}% +{% +\def\Changes@loc@show{added|deleted|replaced|highlight|comment}% +}{}% +\section*{% +\ifIsEmpty{\Changes@loc@title}% +{% +\ifthenelse{\equal{\Changes@loc@style}{list}}% +{\listofchangesname}{}% +\ifthenelse{\equal{\Changes@loc@style}{summary}}% +{\summaryofchangesname}{}% +\ifthenelse{\equal{\Changes@loc@style}{compactsummary}}% +{\compactsummaryofchangesname}{}% +}% +{\Changes@loc@title}% +}% \ifthenelse{\equal{\Changes@loc@style}{list}}% {% -\section*{\listofchangesname}% \IfFileExists{\jobname.loc}% -{}{% +{% +\setboolean{Changes@MoreLines}{true}% +\newread\Changes@InFile% +\openin\Changes@InFile = \jobname.loc% +\whiledo{\boolean{Changes@MoreLines}}{% +\read\Changes@InFile to \Changes@Line% +\ifeof\Changes@InFile% +\setboolean{Changes@MoreLines}{false}% +\else% +\Changes@Line% +\fi% +}% +\closein\Changes@InFile% +}{% \emph{\changesnoloc}% \PackageWarning{changes}{LaTeX rerun needed for list of changes}% }% -\@starttoc{loc}{}% -}% +}{}% +\ifthenelse{\equal{\Changes@loc@style}{summary} \or \equal{\Changes@loc@style}{compactsummary}}% {% -\section*{\summaryofchangesname}% \IfFileExists{\jobname.\Changes@extension}% {% \setboolean{Changes@MoreLines}{true}% @@ -617,7 +915,7 @@ style=list \else% \expandafter\changes@chopline\Changes@Line\\% \textbf{% -\ifthenelse{\boolean{Changes@colored}}% +\ifthenelse{\isColored}% {\color{\Changes@InColor}}% {}% \ifthenelse{\equal{\Changes@InID}{\@empty}}% @@ -629,9 +927,23 @@ style=list { (\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]% +\ifthenelse{% +\Changes@InAdded > 0 \or% +\Changes@InDeleted > 0 \or% +\Changes@InReplaced > 0 \or% +\Changes@InHighlight > 0 \or% +\Changes@InComment > 0% +}% +{% +\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]}% +}% +{% +\parbox{\Changes@summary@width}{\changesnochanges}\\[1ex]% +}% \fi% }% \closein\Changes@InFile% @@ -639,10 +951,10 @@ style=list \emph{\changesnosoc}% \PackageWarning{changes}{LaTeX rerun needed for summary of changes}% }% -}% +}{}% }{}% } -\AtEndDocument{ +\AtEndDocument{% \newwrite\Changes@OutFile \immediate\openout\Changes@OutFile = \jobname.\Changes@extension \let\Changes@protect\protect @@ -654,12 +966,20 @@ style=list \immediate\write\Changes@OutFile{\Changes@ID;% \@nameuse{Changes@AuthorColor\Changes@ID};% \@nameuse{Changes@AuthorName\Changes@ID};% -\the\value{Changes@AddCount\Changes@ID};% -\the\value{Changes@DeleteCount\Changes@ID};% -\the\value{Changes@ReplaceCount\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}}% }% \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 +}{}% +\fi } %% Copyright 2007-2018 Ekkart Kleinod %% |