Turn off highlighting (or any package)

3,305

Solution 1

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

Solution 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.

Share:
3,305

Related videos on Youtube

ritchie888
Author by

ritchie888

Updated on January 31, 2020

Comments

  • ritchie888
    ritchie888 almost 4 years

    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.

  • ritchie888
    ritchie888 almost 7 years
    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
    ritchie888 almost 7 years
    This is exactly what I'm looking for. Thanks!
  • Chris H
    Chris H almost 7 years
    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.
  • Mainland
    Mainland over 2 years
    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.