# Turn off highlighting (or any package)

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.

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}


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}


• This is exactly what I'm looking for. Thanks! Jan 30 '17 at 17:02
• Wow. This is a gem. Previously I was doing a labourious job: go to the text document, find the \hl{ in the document, remove them and remove other end bracket manually. This just killed. I am dead suppose if I have to add something later, I have to redo everything. But, this is a genius solution. Jul 27 '21 at 22:05

You might want to look into the changes packages. By passing it the option final all the markup is suppressed. You can define your own highlights and get a list of changes. This package is design for marking up edits, but you don't have to use it for that.

It has its own tag here.

• Thanks for this. As much as I like the functionality of 'changes' I couldn't see a way to do highlighting as opposed to changing the font colour. I will definitely use it in the future for editing though! Jan 30 '17 at 17:01
• I haven't got the manual in front of me but I'm sure you can use other highlights. Highlighting across paragraphs is interesting at the best of times. Jan 30 '17 at 17:20