# Changes package: \deleted command pushed outside margin

Im using changes to suggest changes to a shared document. To change the colour of the added and deleted text, I made new command for each:

\documentclass[pdf,12pt]{article}
\usepackage{changes}
\newcommand\del[1]{\deleted{\textcolor{red}{#1}}}

\begin{document}

\indent a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch  \add{of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch} of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of \del{text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch} of text a bunch of text a bunch of text a bunch of
text.

\end{document}



For some reason, when I use the new command \del in text, if the deleted text spans multiple lines, the deleted text gets pushed outside the margin. How can I resolve this?

well you can't use a color command inside deleted. That clashes with the underline. You could perhaps use an author id to change the color (perhaps there is something better, check the documentation).

\documentclass[pdf,12pt]{article}
\usepackage[authormarkup=none]{changes}
\definechangesauthor[name=ZZZ, color=red]{ZZZ}
\newcommand\del[1]{\deleted[id=ZZZ]{#1}}

\begin{document}

\indent a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch  \add{of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch} of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of \del{text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch of text a bunch} of text a bunch of text a bunch of text a bunch of
text.

\end{document}


Use the commands provided by the changes package for changing the markup. This way, you can see directly which markup works and which doesn't.

\documentclass[pdf,12pt]{article}
\usepackage{changes}