For highlighting changes in the final LaTeX document, add following lines to your document preamble:
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage[normalem]{ulem}
\newcommand{\stkout}[1]{\ifmmode\text{\sout{\ensuremath{#1}}}\else\sout{#1}\fi}
\newcommand{\add}[1]{{\textcolor{blue}{#1}}}
\newcommand{\del}[1]{{\textcolor{red}{\stkout{#1}}}}
\newcommand{\change}[2]{\del{#1}\add{#2}}
The names are self-explanatory. The option normalem
keeps the standard format of the \emph
command. These definitions allow usage both in text as well as math modes.
If the original text was:
Friday in German means free day.
then following code
\change{Friday}{Saturday}\del{ in German means}\add{and Sunday are} free day\add{s}.
produces
Modifying the definition of the \add
and \del
commands to
\newcommand{\add}[1]{#1}
\newcommand{\del}[1]{}
then yields the final document:
\sout
does not work over multiple paragraphs so, if your change is large and comprises more that one paragraph, you should use one \add{}
or \del{}
for each paragraph.
Also, \sout
do not work with the \cite
command. You can overcome this by encapsulating \cite in a \mbox
, like this
\mbox{\cite{someCoolPaper}}