0

We have defined a new environment to allow us to mark large blocks of text:

\newenvironment{deletedParagraphs}{\par\color{red}}{\par}

That environment works great to color the text red, but now we'd also like that text to use a strikeout font. None of my google searches have yielded a way to do this with \newenvironment. I've seen answers on using packages for tracking changes, as we currently do, but what we use has limitations such as failing to handle sections with a \cite key), whereas using \newenvironment works for large blocks of text.

All I can't do is make the text strikeout.

Related questions that didn't seem to have an answer specific to \newenvironment:

I've tried using the environ package as suggested in the comments. So far I haven't succeeded, but I'm sure I haven't spent enough time with the documentation. I'll update that is as go, but here's a minimal reproducible example of what doesn't work so far as I've gotten:

What I'd like is the first section to be red strikethrough, and the second section to be blue and not strikethrough. I need to be able to include things like \cite{...} in the paragraphs within the environment.

\documentclass{article}
\usepackage{xcolor}
\usepackage[normalem]{ulem}

\usepackage{environ} \NewEnviron{deletedParagraphs}{\color{red}{\sout{\BODY}}}{} \NewEnviron{addedParagraphs}{\color{blue}{\BODY}}{}

% This was my first attempt that didn't play well with sout % \newenvironment{deletedParagraphs}{\color{red}}{} % \newenvironment{addedParagraphs}{\color{blue}}{}

\begin{document}

\begin{deletedParagraphs} Example deleted section - notice word wrap is no longer functioning when this text is beyond one line long. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \end{deletedParagraphs}

\begin{addedParagraphs} Example added section - notice that word wrap is looking fine in this section without the sout addition. \end{addedParagraphs}

\end{document}

0 Answers0