%%
%% This is file `changes.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% changes.dtx  (with options: `changes')
%% 
%% changes.dtx
%% Copyright 2007-2019 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
%% of this license or any later version.
%% The latest version of this license is in
%%  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.
%% 
%% This work has the LPPL maintenance status `maintained'.
%% The current maintainer of this work is Ekkart Kleinod.
%% 
%% This work consists of the files
%% source/latex/changes/changes.drv
%% source/latex/changes/changes.dtx
%% source/latex/changes/changes.ins
%% source/latex/changes/examples.dtx
%% source/latex/changes/README
%% source/latex/changes/userdoc/*.tex
%% 
%% scripts/changes/delcmdchanges.bash
%% and the derived files
%% doc/latex/changes/changes.english.pdf
%% doc/latex/changes/changes.english.withcode.pdf
%% doc/latex/changes/changes.ngerman.pdf
%% 
%% doc/latex/changes/examples/changes.example.*.tex
%% doc/latex/changes/examples/changes.example.*.pdf
%% 
%% tex/latex/changes/changes.sty
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{changes}
[2019/01/26 v3.1.2 changes package]
\typeout{*** changes package 2019/01/26 v3.1.2 ***}
\RequirePackage{xkeyval}
\RequirePackage{xifthen}
\RequirePackage{xstring}
\newboolean{Changes@optiondraft}
\setboolean{Changes@optiondraft}{true}
\DeclareOptionX{draft}{
\setboolean{Changes@optiondraft}{true}
\typeout{changes-option '\CurrentOption'}
}
\DeclareOptionX{final}{
\setboolean{Changes@optiondraft}{false}
\typeout{changes-option '\CurrentOption'}
}
\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}}
{}
{
\ifthenelse{
\equal{#1}{default}\or
\equal{#1}{underlined}\or
\equal{#1}{bfit}\or
\equal{#1}{nocolor}
}
{\renewcommand{\Changes@optionmarkup}{#1}}
{\PackageWarning{changes}{markup '#1' unknown, using '\Changes@optionmarkup'}}
}
\ifthenelse{\equal{\Changes@optionmarkup}{default}}
{
}
{}
\ifthenelse{\equal{\Changes@optionmarkup}{underlined}}
{
\renewcommand{\Changes@optionaddedmarkup}{uline}
\renewcommand{\Changes@optionhighlightmarkup}{uwave}
}
{}
\ifthenelse{\equal{\Changes@optionmarkup}{bfit}}
{
\renewcommand{\Changes@optionaddedmarkup}{bf}
\renewcommand{\Changes@optiondeletedmarkup}{it}
}
{}
\ifthenelse{\equal{\Changes@optionmarkup}{nocolor}}
{
\renewcommand{\Changes@optionaddedmarkup}{uline}
\renewcommand{\Changes@optionhighlightmarkup}{uwave}
}
{}
\typeout{changes-option 'markup=\Changes@optionmarkup'}
}
\DeclareOptionX{addedmarkup}{
\ifthenelse{\equal{\@empty}{#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}
}
{\renewcommand{\Changes@optionaddedmarkup}{#1}}
{\PackageWarning{changes}{addedmarkup '#1' unknown, using '\Changes@optionaddedmarkup'}}
}
\typeout{changes-option 'addedmarkup=\Changes@optionaddedmarkup'}
}
\DeclareOptionX{deletedmarkup}{
\ifthenelse{\equal{\@empty}{#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}
}
{\renewcommand{\Changes@optiondeletedmarkup}{#1}}
{\PackageWarning{changes}{deletedmarkup '#1' unknown, using '\Changes@optiondeletedmarkup'}}
}
\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}}
{}
{
\ifthenelse{
\equal{#1}{superscript}\or
\equal{#1}{subscript}\or
\equal{#1}{brackets}\or
\equal{#1}{footnote}\or
\equal{#1}{none}
}
{\renewcommand{\Changes@optionauthormarkup}{#1}}
{\PackageWarning{changes}{authormarkup '#1' unknown, using '\Changes@optionauthormarkup'}}
}
\typeout{changes-option 'authormarkup=\Changes@optionauthormarkup'}
}
\newcommand{\Changes@optionauthormarkupposition}{right}
\DeclareOptionX{authormarkupposition}{
\ifthenelse{\equal{\@empty}{#1}}
{}
{
\ifthenelse{
\equal{#1}{right}\or
\equal{#1}{left}
}
{\renewcommand{\Changes@optionauthormarkupposition}{#1}}
{\PackageWarning{changes}{authormarkupposition '#1' unknown, using '\Changes@optionauthormarkupposition'}}
}
\typeout{changes-option 'authormarkupposition=\Changes@optionauthormarkupposition'}
}
\newcommand{\Changes@optionauthormarkuptext}{id}
\DeclareOptionX{authormarkuptext}{
\ifthenelse{\equal{\@empty}{#1}}
{}
{
\ifthenelse{
\equal{#1}{id}\or
\equal{#1}{name}
}
{\renewcommand{\Changes@optionauthormarkuptext}{#1}}
{\PackageWarning{changes}{authormarkuptext '#1' unknown, using '\Changes@optionauthormarkuptext'}}
}
\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}
}
\DeclareOptionX{xcolor}{
\typeout{xcolor-option '#1', passed to package xcolor}
\PassOptionsToPackage{#1}{xcolor}
}
\DeclareOptionX*{
\PackageWarning{changes}{Unknown option '\CurrentOption'}
}
\DeclareOptionX<Changes@definechangesauthor>{name}{\def\Changes@definechangesauthor@name{#1}}
\DeclareOptionX<Changes@definechangesauthor>{color}{\def\Changes@definechangesauthor@color{#1}}
\presetkeys{Changes@definechangesauthor}{
name=\@empty,
color=blue
}{}
\DeclareOptionX<Changes@added>{id}{\def\Changes@added@id{#1}}
\DeclareOptionX<Changes@added>{remark}{\def\Changes@added@remark{#1}}
\DeclareOptionX<Changes@added>{comment}{\def\Changes@added@comment{#1}}
\presetkeys{Changes@added}{
id=\@empty,
remark=\@empty,
comment=\@empty,
}{}
\DeclareOptionX<Changes@deleted>{id}{\def\Changes@deleted@id{#1}}
\DeclareOptionX<Changes@deleted>{remark}{\def\Changes@deleted@remark{#1}}
\DeclareOptionX<Changes@deleted>{comment}{\def\Changes@deleted@comment{#1}}
\presetkeys{Changes@deleted}{
id=\@empty,
remark=\@empty,
comment=\@empty,
}{}
\DeclareOptionX<Changes@replaced>{id}{\def\Changes@replaced@id{#1}}
\DeclareOptionX<Changes@replaced>{remark}{\def\Changes@replaced@remark{#1}}
\DeclareOptionX<Changes@replaced>{comment}{\def\Changes@replaced@comment{#1}}
\presetkeys{Changes@replaced}{
id=\@empty,
remark=\@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,
title=\@empty,
show=all,
}{}
\ProcessOptionsX*\relax
\newtest{\isColored}{%
\not\equal{\Changes@optionmarkup}{nocolor}%
}
\ifthenelse{\isColored}
{
\RequirePackage{xcolor}
\RequirePackage{pdfcolmk}
}
{}
\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}
}
{\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}
\setboolean{Changes@langpackage}{false}
\@ifpackageloaded{babel}
{\setboolean{Changes@langpackage}{true}}
{}
\@ifpackageloaded{polyglossia}
{\setboolean{Changes@langpackage}{true}}
{}
\ifthenelse{\boolean{Changes@langpackage}}
{
\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.}}
}
{}
\newcommand{\Changes@extension}{soc}
\newcommand{\setsocextension}[1]{
\renewcommand{\Changes@extension}{#1}
}
\newcounter{Changes@AuthorCount}
\setcounter{Changes@AuthorCount}{0}
\newcounter{Changes@Author}
\newcommand*\definechangesauthor[2][]{
\setkeys{Changes@definechangesauthor}{#1}
\stepcounter{Changes@AuthorCount}
\@namedef{Changes@AuthorID\theChanges@AuthorCount}{#2}
\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)}{}%
\ifthenelse{\equal{\Changes@optionauthormarkup}{footnote}}{\footnote{#1}}{}%
\ifthenelse{\equal{\Changes@optionauthormarkup}{none}}{}{}%
}
\newcommand{\setauthormarkup}[1]{
\renewcommand{\Changes@Markup@author}[1]{#1}
}
\newcommand{\setauthormarkupposition}[1]{
\renewcommand{\Changes@optionauthormarkupposition}{#1}
}
\newcommand{\setauthormarkuptext}[1]{
\renewcommand{\Changes@optionauthormarkuptext}{#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}{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}
}
\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}}{}%
}
\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}}{}%
}
\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{\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}%
{}%
{%
\setboolean{Changes@WrongID}{true}%
\setcounter{Changes@Author}{0}%
\whiledo{\value{Changes@Author} < \value{Changes@AuthorCount}}{%
\stepcounter{Changes@Author}%
\ifthenelse{\equal{#1}{\@nameuse{Changes@AuthorID\theChanges@Author}}}%
{\setboolean{Changes@WrongID}{false}}%
{}%
}%
\ifthenelse{\boolean{Changes@WrongID}}%
{\PackageError{changes}%
{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}}%
{%
#1%
}%
{}%
\ifthenelse{\equal{\Changes@optionauthormarkuptext}{name}}%
{%
\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}}%
{%
\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{\isColored}%
{\color{authorcolor}}%
{}%
\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{\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}}%
}%
}%
\ifIsEmpty{#2}%
{\def\Changes@locid{}}%
{\def\Changes@locid{~(#2)}}%
\addtocontents{loc}{\protect\ChangesListline{#1}{#6\Changes@locid}{#7}{\thepage}}%
}%
{%
\ifIsEmpty{#3}%
{\@bsphack\@esphack}%
{#3}%
}%
}
\newcommand{\added}[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}%
{#2}%
}
\newcommand{\deleted}[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}%
{#2}%
}
\newcommand{\replaced}[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}%
{#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}{%
\@ifundefined{@dotsep}%
{\def\@dotsep{4.5}}{}%
\@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~\let\cleaders\leaders\dotfill~#2}#4%
}{}%
}{}%
}
\newboolean{Changes@MoreLines}
\newboolean{Changes@ShowOK}
\newcommand{\listofchanges}[1][\@empty]{%
\setkeys{Changes@loc}{#1}%
\ifthenelse{\boolean{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}%
}%
{}%
{%
\PackageWarning{changes}{Wrong style for list of changes: '\Changes@loc@style', using 'list' instead.}%
\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}%
}{}%
\def\Changes@heading{\Changes@loc@title}
\ifIsEmpty{\Changes@loc@title}%
{%
\ifthenelse{\equal{\Changes@loc@style}{list}}%
{\def\Changes@heading{\listofchangesname}}{}%
\ifthenelse{\equal{\Changes@loc@style}{summary}}%
{\def\Changes@heading{\summaryofchangesname}}{}%
\ifthenelse{\equal{\Changes@loc@style}{compactsummary}}%
{\def\Changes@heading{\compactsummaryofchangesname}}{}%
}{}%
\section*{\Changes@heading}
\ifthenelse{\equal{\Changes@loc@style}{list}}%
{%
\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}%
}%
}{}%
\ifthenelse{\equal{\Changes@loc@style}{summary} \or \equal{\Changes@loc@style}{compactsummary}}%
{%
\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{\isColored}%
{\color{\Changes@InColor}}%
{}%
\ifthenelse{\equal{\Changes@InID}{\@empty}}%
{\changesauthorname: \changesanonymousname}%
{%
\changesauthorname: \Changes@InID%
\ifthenelse{\equal{\Changes@InName}{\@empty}}%
{}%
{ (\Changes@InName)}%
}%
}\\%
\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%
}{%
\emph{\changesnosoc}%
\PackageWarning{changes}{LaTeX rerun needed for summary of changes}%
}%
}{}%
}{}%
}
\AtEndDocument{%
\newwrite\Changes@OutFile
\immediate\openout\Changes@OutFile = \jobname.\Changes@extension
\let\Changes@protect\protect
\let\protect\@unexpandable@protect
\setcounter{Changes@Author}{0}
\whiledo{\value{Changes@Author} < \value{Changes@AuthorCount}}{%
\stepcounter{Changes@Author}%
\def\Changes@ID{\@nameuse{Changes@AuthorID\theChanges@Author}}%
\immediate\write\Changes@OutFile{\Changes@ID;%
\@nameuse{Changes@AuthorColor\Changes@ID};%
\@nameuse{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}}%
}%
\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-2019 Ekkart Kleinod
%%
%% End of file `changes.sty'.
