%%
%% This is file `proofread.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% proofread.dtx  (with options: `package')
%% ---------:| ---------------------------------------------------------------
%% proofread:| Commands for inserting annotations
%%    Author:| Wybo Dekker
%%    E-mail:| wybo@dekkerdocumenten.nl
%%   License:| Released under the LaTeX Project Public License v1.3c or later
%%       See:| http://www.latex-project.org/lppl.txt
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{proofread}
    [2015/12/07 v1.01 Commands for inserting annotations]

\RequirePackage{soul}
\RequirePackage{tikz}
\RequirePackage{etoolbox}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathmorphing}

\newcommand{\PR@defhiliter}[3][]{%
  \tikzset{every hiliter/.style={color=#2, fill opacity=#3, #1}}%
}

\PR@defhiliter{yellow}{.25}

\newcommand{\PR@hilite@Dohilite}{
  \fill [ decoration = {random steps, amplitude=1pt, segment length=15pt}
        , outer sep = -15pt, inner sep = 0pt, decorate
        , every hiliter, this hiliter ]
        ($(begin hilite)+(0,8pt)$) rectangle ($(end hilite)+(0,-3pt)$) ;
}

\newcommand{\PR@hilite@Beginhilite}{
  \coordinate (begin hilite) at (0,0) ;
}

\newcommand{\PR@hilite@Endhilite}{
  \coordinate (end hilite) at (0,0) ;
}

\newdimen\PR@hilite@previous
\newdimen\PR@hilite@current

\DeclareRobustCommand*\hilite[1][]{%
  \tikzset{this hiliter/.style={#1}}%
  \SOUL@setup
  %
  \def\SOUL@preamble{%
    \begin{tikzpicture}[overlay, remember picture]
      \PR@hilite@Beginhilite
      \PR@hilite@Endhilite
    \end{tikzpicture}%
  }%
  %
  \def\SOUL@postamble{%
    \begin{tikzpicture}[overlay, remember picture]
      \PR@hilite@Endhilite
      \PR@hilite@Dohilite
    \end{tikzpicture}%
  }%
  %
  \def\SOUL@everyhyphen{%
    \discretionary{%
      \SOUL@setkern\SOUL@hyphkern
      \SOUL@sethyphenchar
      \tikz[overlay, remember picture] \PR@hilite@Endhilite ;%
    }{%
    }{%
      \SOUL@setkern\SOUL@charkern
    }%
  }%
  %
  \def\SOUL@everyexhyphen##1{%
    \SOUL@setkern\SOUL@hyphkern
    \hbox{##1}%
    \discretionary{%
      \tikz[overlay, remember picture] \PR@hilite@Endhilite ;%
    }{%
    }{%
      \SOUL@setkern\SOUL@charkern
    }%
  }%
  %
  \def\SOUL@everysyllable{%
    \begin{tikzpicture}[overlay, remember picture]
      \path let \p0 = (begin hilite), \p1 = (0,0) in \pgfextra
        \global\PR@hilite@previous=\y0
        \global\PR@hilite@current =\y1
      \endpgfextra (0,0) ;
      \ifdim\PR@hilite@current < \PR@hilite@previous
        \PR@hilite@Dohilite
        \PR@hilite@Beginhilite
      \fi
    \end{tikzpicture}%
    \the\SOUL@syllable
    \tikz[overlay, remember picture] \PR@hilite@Endhilite ;%
  }%
  \SOUL@
}
\AtEndPreamble{\marginparpush2pt}
\ifdef{\marginparmargin}{\marginparmargin{outer}}{}
\newbox\PR@soulbox
\newcount\PR@markerno\PR@markerno=1
\newcommand{\com}[1]{%
  \marginpar{%
    \footnotesize%
    \the\PR@markerno:#1%
  }%
  \global\advance\PR@markerno1%
}
\newcommand{\del}[1]{%
  \com{delete}%
  \sbox\PR@soulbox{\st{#1}}%
  \hilite[red]{{\usebox\PR@soulbox}}%
  \bgroup\egroup%
}
\newcommand{\yel}[2][\mbox{}]{%
  \com{#1}%
  \hilite[yellow]{#2}%
  \bgroup\egroup%
}
\newcommand{\add}[1]{%
  \com{add}%
  \hilite[green,draw=blue]{#1}%
  \bgroup\egroup%
}
\newcommand{\rep}[2]{%
  \com{was:#1}%
  \hilite[blue]{#2}%
  \bgroup\egroup%
}
%% 
%% Copyright (C) 2015 by Wybo Dekker <wybo@dekkerdocumenten.nl>
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either
%% version 1.3c of this license or (at your option) any later
%% version.  The latest version of this license is in the file:
%% 
%% http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status) by
%% Wybo Dekker.
%% 
%% This work consists of the file proofread.dtx and a Makefile.
%% Running "make" generates the derived files README, proofread.pdf and
%% proofread.sty.
%% Running "make inst" installs the files in the user's TeX tree.
%% Running "make install" installs the files in the local TeX tree.
%% 
%%
%% End of file `proofread.sty'.
