misc/changes-simple.sty

Thu, 19 Oct 2023 23:25:34 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Thu, 19 Oct 2023 23:25:34 -0500
changeset 6
de1cf8032322
parent 5
3716d0eaa356
permissions
-rw-r--r--

Implement a more expansible parser

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{changes-simple}[2020/04/20 v0.1 simple alternative to changes that doesn't blow up with weird journal classes]

\newif\ifchangessimple@final
\changessimple@finalfalse
\DeclareOption{final}{\changessimple@finaltrue}
\DeclareOption{draft}{\changessimple@finalfalse}
\ProcessOptions

\RequirePackage[normalem]{ulem}
\RequirePackage[svgnames]{xcolor}

\ifchangessimple@final
    \newcommand{\added}[1]{#1}
    \newcommand{\deleted}[1]{}
    \newcommand{\replaced}[2]{#1}
\else
    \newcommand{\added}[1]{{\color{blue}#1}}
    \newcommand{\deleted}[1]{{\color{red}\sout{#1}}}
    \newcommand{\replaced}[2]{\added{#1}\deleted{#2}}
\fi

mercurial