使电压箭头出现在投影仪上 - Circuitikz

使电压箭头出现在投影仪上 - Circuitikz

我正在尝试让电压箭头出现在第二帧上。现在我得到了这个:

\documentclass{beamer}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{siunitx}
\usepackage{tikz, pgfplots}
\usepackage[european]{circuitikz}
\usepackage{float}

\pgfplotsset{compat=1.14}
\usetikzlibrary{calc}
\usetikzlibrary{intersections}



\newcommand{\subb}[1]{_{\mathrm{#1}}}
\renewcommand{\Re}{\mathrm{Re}}

\begin{document}
    \begin{frame}
    \begin{figure}[H]
        \centering
        \begin{circuitikz}
            \draw
            (0,0) to[battery,l_=$V\subb{in}$] ++(0,-4) coordinate (v);
            (0,0) to[short]++(1,0)
            \only<1>{
                \draw
                (0,0) to[inductor, l^=$L$,-*] ++(3,0) coordinate (s1);
            }
            \only<2->{
                \draw
                (0,0) to[inductor, l^=$L$,-*,v_=$v\subb L$,i=$i\subb L$] ++(3,0) coordinate (s1);
            }           
            \draw
            ([xshift=15pt, yshift=-15pt]s1) coordinate (son) 
            (son) to[short,o-] (son|-v)
            to[short] (v)
            ([xshift=22pt]s1) coordinate (soff)
            (soff) to[short,o-*]++(2,0) coordinate (c);
            \only<1>{
                \draw
                (c) to[C,l_=$C$]  (c|-v) coordinate (cc);
            }
            \only<2->{
                \draw
                (c) to[C,l_=$C$,i>_=$i\subb C$]  (c|-v) coordinate (cc);
            }
            \draw
            (cc) to[short,*-*] (cc-|son)
            (c) to[short] ++ (2,0) coordinate (l);

            \only<1>{
                \draw
                (l) to[R,l_=$R\subb L$] (l|-cc) coordinate (pe);
            }
            \only<2->{
                \draw
                (l) to[R,l_=$R\subb L$,v^=$V\subb{out}$,i>_=$i\subb{out}$] (l|-cc) coordinate (pe);
            }
            \draw
            (pe) to[short] (cc);
            \draw [very thick] (s1)--++(19pt,-8pt);
            \node[anchor = north east] at (son) {$T\subb{ON}$};
            \node[anchor = south] at (soff) {$T\subb{OFF}$};
        \end{circuitikz}
        \caption{Boost converter}
        \label{circ:boost_diagrama}
    \end{figure}
    \end{frame}
\end{document}

但在帧之间,电路中的所有元件都会向左移动,为负载中的电压箭头腾出空间。
有什么方法可以消除这种偏移吗?
谢谢

答案1

最简单的解决方案是放大图片的边界框。例如,只需添加:

\useasboundingbox (l) -- ++(1.5,0);

结束circuitikz 环境。pgf有关更多详细信息,请参阅文档(第 15.8 节)。

相关内容