2

I would like to mark up a whole section (including all subsections and footnotes, spanning multiple pages) as proposed for deletion -- ideally, with color and strikethrough, but just one of the two would suffice. I'm using pdflatex and TeXLive 2013.

So far, I have not had good luck with any color change commands I've tried, because they failed either on multiple groups, or on multiple pages, or at footnotes. changes package and \color{} command couldn't handle footnotes either.

The most promising command I could find was pdfcolorstack, but it seems to break when either hyperref or pdfpages is used, e.g. in the example below (copied from documentation), when \usepackage{pdfpages} is present, the "still green" text is black:

\documentclass{article}
\usepackage{pdfpages}  % This breaks things

\begin{document}
Hello world!
\chardef\Color=\pdfcolorstackinit page direct{0 g}
default color,
\pdfcolorstack\Color set{1 1 0 0 k}
some new default
\pdfcolorstack\Color push{0 1 1 0 k}
red,
\pdfcolorstack\Color push{1 0 1 0 k}
green, and some footnote\footnote{here!!} and some more text.
\newpage
still green (BUT NOT WHEN PDFPAGES IS USED!!),
\pdfcolorstack\Color pop
red again,
\pdfcolorstack\Color pop
default again,
\pdfcolorstack\Color set{0 g}
back to black.

\end{document}

I could get by without hyperref for the draft purposes, but pdfpages is pretty essential :(

1 Answer 1

2
\documentclass{article}
\usepackage{pdfpages}  % This breaks things
\usepackage{xcolor}
\RequirePackage[normalem]{ulem}

\begin{document}
Hello world!
default color,
{\color{blue!60!black}
some new default
{\color{red!80!black}
red, \sout{red struck-out} 
{\color{green!60!black}
green, and some footnote\footnote{here!!} and some more text.
\newpage
still green (BUT NOT WHEN PDFPAGES IS USED!!),}
red again,}
default again,}
back to black.

\end{document}

produces

claim on page 2 is now false!

which makes the claim on page 2 false...

1
  • Thanks! You are absolutely right, looks like \color command does work in the small example, I tried it with subsections and it still seems to work (pdfcolorstack still conflicts with pdfpages but perhaps it's not actually needed...) -- now I only need to figure out why \color was failing in the full document... I'll update the question.
    – laxxy
    Jan 2, 2014 at 18:21

You must log in to answer this question.

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