0

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}}}
\newcommand\add[1]{\added{\textcolor{blue}{#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?

Compiled Text Screenshot

0

2 Answers 2

1

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}}
\newcommand\add[1]{\added{\textcolor{blue}{#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}
1

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}

\setaddedmarkup{\textcolor{green}{#1}}
\setdeletedmarkup{\textcolor{red}{\sout{#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  \added{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 \deleted{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}

Output of the LaTeX example

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.