[Tex/LaTex] Turn off highlighting (or any package)

drafthighlightingieee-styleieeetran

I'm using the IEEEtran package to compile a two-column document and I need to submit two copies: one with highlighted sections and one in a 'clean' state.

I'm using soul to highlight the sections with no problem, but for me to create a 'clean' copy I'm going to have to go through the document and delete all highlight entries, which will take a long time and I don't want two separate copies of the paper in case I make changes to one I'll have to remember to do the same to the other.

Is there a way to easily 'turn off' packages or features in this situation? Ideally I'd like a single line of code in my main tex file which I can comment/uncomment in order to turn highlight/other editing features on and off. I'm playing around with the IEEE draft features, but they don't seem to do what I want.

Thanks.

Best Answer

You can redefine the commands from the soul package that you use to do nothing.

With highlighting:

\documentclass{article}
\usepackage{color,soul}
\setulcolor{red}
\sethlcolor{blue}
\begin{document}
This is \ul{underlined} and \hl{highlighted} text.
\end{document}

enter image description here

Without highlighting:

\documentclass{article}
\usepackage{color,soul}
\setulcolor{red}
\sethlcolor{blue}
\renewcommand\ul[1]{#1} % <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
\renewcommand\hl[1]{#1} % <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
\begin{document}
This is \ul{underlined} and \hl{highlighted} text.
\end{document}

enter image description here

Related Question