I am trying to create this effect:
(without red underlines, I did this example with Word that emphasizes the words he doesn't know in red).
I used the package alltt this:
\begin{alltt}
text 1: Quicq fyre | text 1: Slow fool
text 2: Quick fire | text 2: Quick fire
Diff: Quic\colorbox{lightred}{q}\colorbox{lightgreen}{k} f\colorbox{lightred}{y}\colorbox{lightgreen}{i}re | Diff: SlowQuick foolire
Split: Quic\colorbox{lightred}{q}\colorbox{lightgreen}{k}\colorbox{lightred}{ f}\colorbox{lightgreen}{ f}\colorbox{lightred}{y}\colorbox{lightgreen}{i}re | Split: SlowQuick f foolire
Merge: Quic\colorbox{lightred}{q fy}\colorbox{lightgreen}{k fi}re | Merge: Slow foolQuick fire
\end{alltt}
and the result is:
As you can see the underlines are staggered. So the result is not as expected.
How can I use to get something more like the first picture? I didn't use the package listing because I already used it for some code that is formatted differently to how it should be in this text.