Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The journal PLoS ONE, says in the FAQ

When submitting your revision, you will need to include the following new files:
[...] A ‘clean’ copy of your revised manuscript.
A revised manuscript with tracked changes. [...]

I'm using soul's \hl to highlight changes. So, I also need a version that doesn't highlight changes. To accomplish this, I added the following code. The \renewcommand{\hl}[1]{#1} is intended as a no-op. So the "clean" version would use \highlightfalse and the version with tracked changes would use \highlighttrue.

This appears to work, but I'm wondering if there are any problems with this approach, or better ways to do it.

\newif\ifhighlight
% COMMENT OUT \highlighttrue or \highlightfalse
\highlighttrue % or
%\highlightfalse
\ifhighlight
\else
\renewcommand{\hl}[1]{#1}
\fi
share|improve this question
2  
Have you seen this: TrackChanges - Collaborative editing of LaTeX documents? –  Werner Aug 11 '11 at 23:46
    
@Werner: I haven't, no. So this is a substitute for soul? –  Faheem Mitha Aug 11 '11 at 23:53
    
Searching on trackchanges on this site also brings up changes. Can anyone comment on either of these? changes doesn't use soul, which might be a plus, since it is unmaintained and buggy. And the most recent update of changes is in 2011. –  Faheem Mitha Aug 12 '11 at 0:00
1  
If you do want to use highlighting with soul, then this approach seems fine to me (except that you example is missing the \newif\ifhighlight). Depending on how you compile your file, Passing parameters to a document (or any of its near-duplicates) could be of interest. –  Caramdir Aug 12 '11 at 2:36
1  
I'm surprised no-one mentioned latexdiff yet. –  mbork Aug 14 '11 at 2:58
show 4 more comments

1 Answer 1

up vote 5 down vote accepted

If you do want to use highlighting with soul, then this approach seems fine to me. Even better would be to create a sematic macro, like

\ifhighlight
    \let\change\hl
\else
    \newcommand{\change}[1]{#1}
\fi

Depending on how you compile your file, Passing parameters to a document (or any of its near-duplicates) could be of interest.

Since the trickery soul has to do can cause trouble, it might be worth to have a look packages that are explicitly designed for your application, like the changes package.

share|improve this answer
    
As mentioned in the comments above, I wound up using the changes package, and would not recommend the soul package, as it is unmaintained and I've had problems with it. –  Faheem Mitha Dec 22 '11 at 20:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.