3

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
Faheem Mitha
  • 7,778
  • 2
  • @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 00: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 02:36
  • @Faheem: No, TrackChanges is not an alternative to soul since soul is not focussed on the realm of tracking document changes; it deals with a bunch of other formatting. TrackChanges provides a very specific/tailored tracking functionality. Using the suggested \newif\ifhighlight should work fine. – Werner Aug 12 '11 at 05:22
  • @Caramdir: Oops, forgot to include \newif\ifhighlight. Fixed now. – Faheem Mitha Aug 12 '11 at 06:58
  • 1
    I'm surprised no-one mentioned latexdiff yet. – mbork Aug 14 '11 at 02:58
  • @Caramdir: Could you write a short answer? – lockstep Dec 04 '11 at 14:21
  • @lockstep: I was reminded by this question by your comment. For the record, I wound up switching to the the changes package (prompted by the comment by Werner). That was quite satisfactory. Is it worth adding an answer detailing that? Is your concern getting the question answered? If so, I guess I can answer and accept, if that would be Ok with everyone. For the record, I would not recommend soul. It has too many problems, and is unmaintained. – Faheem Mitha Dec 04 '11 at 19:03

1 Answers1

5

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.

Caramdir
  • 89,023
  • 26
  • 255
  • 291
  • 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