I have a document, that contains critical parts. Now two documents should be generated. One version that is "balcked out" and one version that is all readable.
For pure text I found some hints using the soul
package. See http://latex-community.org/forum/viewtopic.php?f=44&t=18190
Now I have the problem, that there are also some figures (drawn with tikz) that should be hidden. Is there a way to handle this?
Edit:
I got two very good answers how to do it. Unfortunately I use the externalization library of tikz. The criticat pictures I of course do not export to avoid problems with the file numbers. But the on compiling the other pictures (after one in a Btikzpicture
or a ctikzpicture
) have problems to compile as latex finds the \tikzpicture
but it seems not to see the \enttikzpicture
and therefor runs into trouble. Have you here also a solution. I tried using \NewEnviron
but this did not solve the problem as I think.
Example:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize
\usepackage{adjustbox}
\newif\ifblackOut
% \blackOuttrue
\ifblackOut
\newenvironment{ctikzpicture}
{\tikzset{external/export next=false}
\adjustbox{precode=\phantom,bgcolor=black!10}
\bgroup\tikzpicture}
{\endtikzpicture\egroup}
\else
\newenvironment{ctikzpicture}
{\tikzset{external/export next=false}
\tikzpicture}
{\endtikzpicture}
\fi
\begin{document}
\begin{figure}[htbp]
\centering
\begin{tikzpicture}
\draw (0,0) circle (1cm);
\end{tikzpicture}
\end{figure}
%
\begin{figure}[htbp]
\centering
\begin{ctikzpicture}
\draw (0,0) rectangle (1,1);
\end{ctikzpicture}
\caption{}
\end{figure}
% Uncomment next lines for other error
% \begin{figure}[htbp]
% \centering
% \begin{tikzpicture}
% \draw (0,0) circle (2cm);
% \end{tikzpicture}
% \end{figure}
\end{document}
phantom
option? If not, you could try something like tex.stackexchange.com/questions/43069/… and just make the box black. (This is only for the text part, though, not for the figure.)censor
, which has facilities for censoring either the output PDF or the source.tex
file.