Q:

problem in command definition

I have this command defined in my thesis and it works fine, but when I try to include it in some other document it doesn't work (compiler reports the command is not defined). What do I forget to define/include ?
\documentclass{article}
\usepackage[normalem]{ulem}
\usepackage{xcolor}

\def\revisionHighlight{True}
\def\revisionHighlightOld{True}

\newcommand{\correction}[2]{% old word, new word
\ifnum\pdfstrcmp{\revisionHighlight}{True}=0%
    \ifnum\pdfstrcmp{\revisionHighlightOld}{True}=0%
        \stkout{#1}\textcolor{red}{#2}%
    \else%
        \ifx&#2&%
            \ignorespaces
        \else
            \textcolor{red}{#2}%
        \fi
    \fi
\else%
    \ifx&#2&%
        \ignorespaces
    \else
        #2%
    \fi
\fi}

\begin{document}
\correction{a}{b}
\end{document}

A:

As far as I know, the macro for striking out text is called \sout, not \stkout.
Note you have a couple of bad % at the end of lines, namely after =0.
\documentclass{article}
\usepackage[normalem]{ulem}
\usepackage{xcolor}

\def\revisionHighlight{True}
\def\revisionHighlightOld{True}

\newcommand{\correction}[2]{% old word, new word
\ifnum\pdfstrcmp{\revisionHighlight}{True}=0
    \ifnum\pdfstrcmp{\revisionHighlightOld}{True}=0
        \sout{#1}\textcolor{red}{#2}%
    \else
        \ifx&#2&%
            \ignorespaces
        \else
            \textcolor{red}{#2}%
        \fi
    \fi
\else
    \ifx&#2&%
        \ignorespaces
    \else
        #2%
    \fi
\fi}

\begin{document}
\correction{a}{b}
\end{document}

I'd prefer an approach based on \newif, though.
\documentclass{article}
\usepackage[normalem]{ulem}
\usepackage{xcolor}

\newif\ifrevisionHighlight
\revisionHighlighttrue
\newif\ifrevisionHighlightOld
\revisionHighlightOldtrue

\newcommand{\correction}[2]{% old word, new word
  \ifrevisionHighlight
    \ifrevisionHighlightOld
        \sout{#1}\textcolor{red}{#2}%
    \else
        \if\relax\detokenize{#2}\relax
            \ignorespaces
        \else
            \textcolor{red}{#2}%
        \fi
    \fi
\else
    \if\relax\detokenize{#2}\relax
        \ignorespaces
    \else
        #2%
    \fi
\fi}

\begin{document}
\correction{a}{b}
\end{document}

