Add changes-simple

Thu, 19 Oct 2023 15:40:04 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Thu, 19 Oct 2023 15:40:04 -0500
changeset 5
3716d0eaa356
parent 4
8082eb5a754b
child 6
de1cf8032322

Add changes-simple

README.md file | annotate | diff | comparison | revisions
misc/changes-simple.sty file | annotate | diff | comparison | revisions
--- a/README.md	Thu Oct 19 15:36:39 2023 -0500
+++ b/README.md	Thu Oct 19 15:40:04 2023 -0500
@@ -17,3 +17,7 @@
    ```
 
 For further options, such as whitespace and comment stripping, use the `--help` argument (`cargo run -- --help` when running through `cargo` without installing).
+
+## Miscellaneous
+
+Included is also a plug-in replacement `changes-simple` package for LaTeX, that is less likely to blow up with broken journal styles than the more complex `changes` package.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/changes-simple.sty	Thu Oct 19 15:40:04 2023 -0500
@@ -0,0 +1,22 @@
+\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