I want to print a document without the figures. I know it can be done with 'draft' option of documentclass but this does not work for the figures made with circuitikz. Is there a way to accomplish this?
Asked
Active
Viewed 118 times
1 Answers
4
I just copied some circuitikz code from here and added a key tikzpicture draft. If you
\documentclass[12pt,a4paper]{article}
\usepackage[RPvoltages]{circuitikz}
\newcounter{tikzdraftpicture}
\tikzset{tikzpicture draft/.code={\tikzset{%
every picture/.append style={execute at end picture={\stepcounter{tikzdraftpicture}
\draw[fill=white] (current bounding box.south west) rectangle (current bounding
box.north east);
\path(current bounding box.west) node[right,font=\ttfamily]
{tikzpicture~\number\value{tikzdraftpicture}}; }}}}}
%\tikzset{tikzpicture draft}
\begin{document}
\begin{figure}[h]
\centering
\begin{circuitikz}[scale = 0.5,european]
% start points
\coordinate[label=above:B] (B) at (0,0);
\coordinate[label=above:A] (A) at (0,5);
\foreach \i in {A,B} {
\fill (\i) circle (2pt);
}
% name the node, and...
\draw (B) to (4,0) to (4,-1) to[R, name=R1] (8,-1) to (8,0);
% add the thing
\node at (R1.center) {$R$};
\draw (4,0) to (4,1) to[R, label={$2R$}] (8,1) to (8,0) to (12,0) to[R, l_={$R$}] (12,5) to[] (11,5);
\draw (A) to[] (1,5) to (1,3) to[R, label={$2R$}] (11,3) to[] (11,5);
\draw (1,5) to[R, label={$R$}] (6,5) to[R, label={$R$}] (11,5);
\end{circuitikz}
\caption{A circuit.}
\end{figure}
\begin{figure}[h]
\centering
\begin{circuitikz}[scale = 0.5,european]
% start points
\coordinate[label=above:B] (B) at (0,0);
\coordinate[label=above:A] (A) at (0,5);
\foreach \i in {A,B} {
\fill (\i) circle (2pt);
}
% name the node, and...
\draw (B) to (4,0) to (4,-1) to[R, name=R1] (8,-1) to (8,0);
% add the thing
\node at (R1.center) {$R$};
\draw (4,0) to (4,1) to[R, label={$2R$}] (8,1) to (8,0) to (12,0) to[R, l_={$R$}] (12,5) to[] (11,5);
\draw (A) to[] (1,5) to (1,3) to[R, label={$2R$}] (11,3) to[] (11,5);
\draw (1,5) to[R, label={$R$}] (6,5) to[R, label={$R$}] (11,5);
\end{circuitikz}
\caption{Another circuit.}
\end{figure}
\end{document}
If you uncomment \tikzset{tikzpicture draft} by removing the % in front of it you will get
-
Thanks you. It actually worked for me. My preference is not to have anything in the place of the picture. I want nothing at all in place of pictures. The main reason is that I want to convert my pdf to .txt and pictures or even placeholders of pictures produce extra symbol which I don't want. So I will keep your solution as a second best if I don't get any other solution where nothing prints in place of pictures. Thanks again for a detailed solution. – Tash Apr 08 '20 at 03:39
-
1
-
The solution that you pointed to is perfect...almost. Why I wrote 'almost' is because it still leaves the caption (Figure 1. ABC etc). What if I want to remove that too (as I don't want ANYTHING related to images). I have posted this question to the forum as well ( that you pointed to). BTW, the only change I had to make in that solution is to replace 'tikz' environment with 'circuitikz'. – Tash Apr 08 '20 at 16:26
-


\tikzset{opacity=0}at the begin of the document. This will fail if theopacityis set somewhere explicitly. – Apr 05 '20 at 22:50tikzpictures, just add\tikzset{every picture/.append style={execute at end picture={ \fill[black] (current bounding box.south west) rectangle (current bounding box.north east);}}}at the begin of the document. If you want to suppress all figures completely, this is also possible, but you'd need to explain your goals in a bit more detail. – Apr 06 '20 at 00:00\documentclass[draft]{article} \usepackage{graphicx} \begin{document} \includegraphics{example-image-duck} \end{document}then I get a box with the title of the external graphics. Thecircuitikzpictures are not external, so they have no file name. What do you want instead? Also, do you have "tikz only"tikzpicturesin your document, and if so, what should happen to those? – Apr 06 '20 at 04:04circuitikzdo not have a filename. What do you want instead of the filename? – Apr 06 '20 at 04:28