10

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.

2 Answers 2

12

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

2
  • This is exactly what I'm looking for. Thanks!
    – ritchie888
    Jan 30, 2017 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.
    – Mainland
    Jul 27, 2021 at 22:05
2

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.

2
  • 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!
    – ritchie888
    Jan 30, 2017 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.
    – Chris H
    Jan 30, 2017 at 17:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .