将一页的框架转换为多页,以便与 \animategraphics 一起使用

将一页的框架转换为多页,以便与 \animategraphics 一起使用

我想生成单独的帧以在我的投影仪中使用\animategraphics,那么如何将它们转换为帧?.. 提前感谢您的帮助。

\documentclass[border=30pt, tikz]{standalone}
\usepackage{circuitikz}


\newcommand{\stepconductor}{.1}
\newcommand{\stepresistor}{.025}

\newcommand{\currentradius}{3pt}


\newenvironment{mycircuit}{%
    \begin{circuitikz}
        \draw (0,0) coordinate (V-)
            to[V,v=$U_q$] ++(0, 2) coordinate (V+)
            to[short]     ++(2, 0) coordinate (R1+)
            to[R=$R_1$]   ++(0,-2) coordinate (R1-)
            to[short]     (V-);
        \draw (R1+)
            to[short]     ++(2, 0) coordinate (R2+)
            to[R=$R_2$]   ++(0,-2) coordinate (R2-)
            to[short]     (R1-);

        % ensure that tikzpicture has always the same size (independent of the position of the current)
        \path (V+) -- ++(0, +\currentradius);
        \path (V-) -- ++(0, -\currentradius);
}{%
    \end{circuitikz}%
}
\newcommand{\current}[2]{%
    \path (#1) -- node[pos=\p, circle, fill=red, minimum size=2*\currentradius, inner sep=0pt]{} (#2);
}

\begin{document}
    \foreach \p in {0, \stepconductor, ..., 1}{
        \begin{mycircuit}
            \current{V-}{V+}
        \end{mycircuit}
    }
    \foreach \p in {0, \stepconductor, ..., 1}{
        \begin{mycircuit}
            \current{V+}{R1+}
        \end{mycircuit}
    }
    \foreach \p in {0, \stepresistor, ..., 1}{
        \begin{mycircuit}
            \current{R1+}{R1-}
        \end{mycircuit}
    }
    \foreach \p in {0, \stepconductor, ..., 1}{
        \begin{mycircuit}
            \current{R1-}{V-}
        \end{mycircuit}
    }
\end{document}

答案1

添加

\standaloneenv{mycircuit}

在序言的末尾,就在 之前\begin{document}。这将为多页 PDF 创建一页(裁剪后的)页面,可在另一个文档中mycircuit使用。\animategraphics

相关内容