# [Tex/LaTex] Colorbox with changes package

changescolor

I am working with the changes package. Modifying the color of the changed passages works well with \colorlet command. Is it possible to create colorboxes (with yellow color) only around the changes (without the \colorbox command)?

Philipp

You can control the appearance of added and deleted text through the commands \setaddedmarkup and \setdeletedmarkup, respectively.

So you can define, for example:

\setaddedmarkup{\colorbox{yellow}{#1}}
\setdeletedmarkup{\colorbox{red}{\sout{#1}}}


With the following code

\documentclass{article}

\usepackage{changes}

\definechangesauthor[name={Philipp}]{P}

\setdeletedmarkup{\colorbox{red}{\sout{#1}}}

\begin{document}

\end{document}


you get

This doesn't obviously support line breaks.

If you don't need particular formatting apart from coloring, you can load the soul package (once loaded by changes), and define, for example:

\setaddedmarkup{\sethlcolor{yellow}\hl{#1}}
\setdeletedmarkup{\sethlcolor{red}\hl{#1}}


MWE

\documentclass{article}

\usepackage{changes}
\usepackage{soul}

\definechangesauthor[name={Philipp}]{P}

\setdeletedmarkup{\sethlcolor{red}\hl{#1}}

\begin{document}