diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/color-edits/color-edits.sty | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/color-edits/color-edits.sty b/Master/texmf-dist/tex/latex/color-edits/color-edits.sty new file mode 100644 index 00000000000..7c507bfd4a6 --- /dev/null +++ b/Master/texmf-dist/tex/latex/color-edits/color-edits.sty @@ -0,0 +1,125 @@ +%% +%% This is file `color-edits.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% color-edits.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 2020 by David Kempe +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) 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. +%% + \ProvidesPackage{color-edits}[2020/09/18 v1.1 Class for annotating authors' edits in color] +\def\coloredits@SuppressEdits{no} +\DeclareOption{suppress}{\def\coloredits@SuppressEdits{yes}} +\def\coloredits@ShowDeletions{no} +\DeclareOption{showdeletions}{\def\coloredits@ShowDeletions{yes}} +\ProcessOptions\relax + % \CharacterTable + % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z + % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z + % Digits \0\1\2\3\4\5\6\7\8\9 + % Exclamation \! Double quote \" Hash (number) \# + % Dollar \$ Percent \% Ampersand \& + % Acute accent \' Left paren \( Right paren \) + % Asterisk \* Plus \+ Comma \, + % Minus \- Point \. Solidus \/ + % Colon \: Semicolon \; Less than \< + % Equals \= Greater than \> Question mark \? + % Commercial at \@ Left bracket \[ Backslash \\ + % Right bracket \] Circumflex \^ Underscore \_ + % Grave accent \` Left brace \{ Vertical bar \| + % Right brace \} Tilde \~} +\RequirePackage{ifthen} +\RequirePackage{color} + +\definecolor{@gray}{rgb}{0.5,0.5,0.5} + +\newcommand{\coloredits@addauthoredit}[3]{% +\ifthenelse{\equal{\coloredits@SuppressEdits}{yes} \or \equal{#2}{suppress}}{% suppressed +\expandafter\long\expandafter\def\csname #1edit\endcsname ##1{##1}% +}{% not suppressed +\expandafter\long\expandafter\def\csname #1edit\endcsname ##1{{\color{#3}##1}} +}} + +\newcommand{\coloredits@addauthorreplace}[3]{% +\ifthenelse{\equal{\coloredits@SuppressEdits}{yes} \or \equal{#2}{suppress}}{% suppressed +\expandafter\long\expandafter\def\csname #1replace\endcsname ##1##2{##2} +}{% not suppressed +\ifthenelse{\equal{\coloredits@ShowDeletions}{yes}}{% Showing deletions +\expandafter\long\expandafter\def\csname #1replace\endcsname ##1##2{% +{\color{@gray}##1}{\color{#3}##2}} +}{% Not showing deletions +\expandafter\long\expandafter\def\csname #1replace\endcsname ##1##2{% +{\color{#3}##2}} +}% +}} + +\newcommand{\coloredits@addauthorcomment}[3]{% +\ifthenelse{\equal{\coloredits@SuppressEdits}{yes} \or \equal{#2}{suppress}}{% suppressed +\expandafter\long\expandafter\def\csname #1comment\endcsname ##1{} +}{% not suppressed +\expandafter\long\expandafter\def\csname #1comment\endcsname ##1{% +{\color{#3}[#2: ##1]}} +}} + +\newcommand{\coloredits@addauthormargincomment}[3]{% +\ifthenelse{\equal{\coloredits@SuppressEdits}{yes} \or \equal{#2}{suppress}}{% suppressed +\expandafter\long\expandafter\def\csname #1margincomment\endcsname ##1{} +}{% not suppressed +\expandafter\long\expandafter\def\csname #1margincomment\endcsname##1{{% +\color{#3}$[\bullet]$\marginpar{\scriptsize\color{#3}[#2: ##1]}}} +}} + +\newcommand{\coloredits@addauthordelete}[3]{% +\ifthenelse{\equal{\coloredits@SuppressEdits}{yes} \or \equal{#2}{suppress}}{% suppressed +\expandafter\long\expandafter\def\csname #1delete\endcsname ##1{} +}{% not suppressed +\ifthenelse{\equal{\coloredits@ShowDeletions}{yes}}{% Showing deletions +\expandafter\long\expandafter\def\csname #1delete\endcsname ##1{{\color{@gray}##1}} +}{% Not showing deletions +\expandafter\long\expandafter\def\csname #1delete\endcsname ##1{{% +\color{#3}$[\bullet]$\marginpar{\scriptsize\color{#3}#2 deleted here}}} +}% +}} + +\newcommand{\coloredits@addauthordeletecomment}[3]{% +\ifthenelse{\equal{\coloredits@SuppressEdits}{yes} \or \equal{#2}{suppress}}{% suppressed +\expandafter\long\expandafter\def\csname #1deletecomment\endcsname ##1##2{} +}{% not suppressed +\ifthenelse{\equal{\coloredits@ShowDeletions}{yes}}{% Showing deletions +\expandafter\long\expandafter\def\csname #1deletecomment\endcsname ##1##2{{% +\color{#3}$[\bullet]$\color{@gray}##2\marginpar{\scriptsize\color{#3}#2: ##1}}} +}{% Not showing deletions +\expandafter\long\expandafter\def\csname #1deletecomment\endcsname ##1##2{{% +\color{#3}$[\bullet]$\marginpar{\scriptsize\color{#3}#2 deleted here: ##1}}} +}% +}} + +\newcommand{\addauthor}[3][]{% +\coloredits@addauthoredit{#2}{#1}{#3} +\coloredits@addauthorreplace{#2}{#1}{#3} +\ifthenelse{\equal{#1}{}}{%optional name was not provided +\coloredits@addauthorcomment{#2}{#2}{#3} +\coloredits@addauthormargincomment{#2}{#2}{#3} +\coloredits@addauthordelete{#2}{#2}{#3} +\coloredits@addauthordeletecomment{#2}{#2}{#3}}{%optional name was provided +\coloredits@addauthorcomment{#2}{#1}{#3} +\coloredits@addauthormargincomment{#2}{#1}{#3} +\coloredits@addauthordelete{#2}{#1}{#3} +\coloredits@addauthordeletecomment{#2}{#1}{#3}} +} +\endinput +%% +%% End of file `color-edits.sty'. |