LaTeX forum ⇒ GeneralHighlighting, and removing highlights.

LaTeX specific issues not fitting into one of the other forums of this category.
letty
Posts: 9
Joined: Fri Jan 01, 2010 5:33 pm

Highlighting, and removing highlights.

Postby letty » Sat May 01, 2010 3:49 pm

At the moment, I use the packages 'soul' and 'color' to highlight sections of my work. I do this to flag that I'm not happy with what I've written yet, and need to redraft. I want to do this in the finished version so I can see the issue clearly, rather than just putting a %-ed out note in the code.

An example is
\documentclass{article}
\usepackage{geometry} % see geometry.pdf on how to lay out the page. There's lots.
\geometry{a4paper} % or letter or a5paper or ... etc
\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{setspace}
\usepackage{soul}
\usepackage{color}

\title{Example}
\author{Letty}

%%% BEGIN DOCUMENT
\begin{document}
\maketitle

\onehalfspacing

This is text I'm happy with.

\hl{This is text that I want to flag an issue with}
\end{document}


What I would really like to do is to be able to temporarily suspend this highlighting, so I can print out a non-highlighted version to give to my supervisor. I don't want to go through and take out each \hl{} where I've an issue, as I would like to be able to keep a version that shows my worries for myself, whilst being able to quickly submit a version that doesn't show them.

Simply taking the soul package out of the header for the print-out version doesn't work, as that leaves the \hl command undefined.

Has anyone got a suggestion of a way of doing this? I don't mind if it uses a different highlighting method than the one I'm currently employing.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Highlighting, and removing highlights.

Postby localghost » Sat May 01, 2010 3:55 pm

Probably it's better to use the todonotes package. It can be disabled by giving an option. See the manual for details (Section 1.2 - Package options, p. 3f).


Best regards
Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Highlighting, and removing highlights.

Postby frabjous » Sat May 01, 2010 4:14 pm

If you want to stick with the packages you're using now, when you want a printable version, you could take out the packages, and add a line defining the command(s) in question to do nothing, e.g.:

\newcommand{\hl}[1]{#1}

Or even leave the packages in, and use:

\renewcommand{\hl}[1]{#1}

to deactivate them. (Then it's just a matter of commenting out that line to put the highlighting back in.)

letty
Posts: 9
Joined: Fri Jan 01, 2010 5:33 pm

Re: Highlighting, and removing highlights.

Postby letty » Sat May 01, 2010 4:23 pm

Thanks for the quick response. Todonotes looks like a really useful package, and frabjous's suggestion works really simply for my existing documents.

Thanks again,

Letty.

woxi
Posts: 1
Joined: Fri Sep 20, 2024 2:44 am

Highlighting, and removing highlights.

Postby woxi » Fri Sep 20, 2024 2:48 am

At the preamble

\let\ht\

jiyahana

Highlighting, and removing highlights.

Postby jiyahana » Thu Nov 07, 2024 11:41 am

You can also use the xcolor package with the usenames option to temporarily suspend highlighting. Just redefine \hl to \textcolor{black}{#1} or similar to disable it for printing.


Return to “General”

Who is online

Users browsing this forum: No registered users and 14 guests