H
$a
%\yestexdiff
.
g/\\notexdiff/.,/\\yestexdiff/s/^@CH@//
g/^/s/^@CH@\([ ]*\)$/\1/
g/^@CH@%/d
g/^@CH@/s/\([^\\]\)%.*/\1/
g/^/s/^@CH@\(\\[^ ]*[ ]*\)$/\1/
g/^/s/^@CH@\(\\new.*\)$/\1/
0a
%\begin{document}
.
/\\begin{document}/a
%\startexdiff
.
/\\startexdiff/+1,$v/^@CH@/.-1s/^@CH@.*/&@ENDCH@/
/\\startexdiff/,$-1v/^@CH@/.+1s/^@CH@/@BEGCH@/
g/^/s/^@CH@//
w
q
