將幀從一頁轉換為多頁以與 \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

相關內容