如何在没有 circuitikz 图形的情况下打印

如何在没有 circuitikz 图形的情况下打印

我想打印一份不带图片的文档。我知道可以使用 documentclass 的“草稿”选项来完成,但这不适用于使用 circuitikz 制作的图片。有办法实现这一点吗?

答案1

我只是circuitikz从复制了一些代码这里并添加了一个密钥tikzpicture draft。如果您

\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}

在此处输入图片描述

如果你\tikzset{tikzpicture draft}通过删除%前面的来取消注释,你会得到

在此处输入图片描述

相关内容