5

I am using \usepackage{changebar} to indicate differences in two documents. At the moment, I use one color for all different kinds of changes. That does not make me happy. I would prefer to have at least two colors. One to show, where I added text. One to highlight passages, where I deleted text. Does anyone has a solution?

MWE:

\documentclass{article}
\usepackage[color]{changebar}
\cbcolor{blue}

\begin{document}


Die Ergebnisse wurden hauptsächlich introspektiv erzielt.

\cbstart
Die Ergebnisse wurden hauptsächlich introspektiv erzielt.
\cbend

Die Ergebnisse wurden hauptsächlich introspektiv erzielt.

\end{document}
  • What you want is one of Peter Grill solutions in Environments for visually setting text apart – Ignasi Sep 16 '14 at 14:43
  • @Ignasi: Thanks, I prefer the changebox option Harish Kumar provided. However, I am sure that I will use one of the options I found in Peter Grills compilation for other purposes soon. So again, thanks! – Philip Sep 16 '14 at 15:48
6
\documentclass{article}
\usepackage[xcolor]{changebar}
\usepackage{lipsum}

\newcommand{\deleted}[1]{%
  \cbcolor{red}
  \begin{changebar}
    #1
  \end{changebar}%
  }%

\newcommand{\added}[1]{%
  \cbcolor{green}
  \begin{changebar}
    #1
  \end{changebar}%
  }%

\setlength{\changebarsep}{2ex}
\begin{document}
  \deleted{\lipsum[1]}
  \lipsum[2]
  \added{\lipsum[3]}
\end{document}

enter image description here

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.