[Tex/LaTex] Voltage labels too close to circuit element with circuitikz 2.4

circuitikz

Since upgrading to circuitikz 2.4, I noticed that the voltage labels are way too close to the circuit elements.

For example:

\documentclass{article}
\usepackage[american voltages,siunitx]{circuitikz}

\begin{document}
\begin{circuitikz}
   \draw (0,0) to [R=\SI{10}{\ohm},v=$v_r(t)$] (0,3)
               to [C=\SI{10}{F},v=$v_c(t)$] (0,6);
\end{circuitikz}
\end{document}

This is what my output looks like with circuitikz 2.4:

labels too close

Anyone else experience this? Is there an easy fix?

Best Answer

I am not really familiar with the circuitikz package, so maybe there's a more "proper" way of solving the issue. However, you can manually add some horizontal space:

\documentclass{article} 
\usepackage[american voltages,siunitx]{circuitikz} 

\begin{document} 

\begin{circuitikz} 
  \draw (0,0) to [R=\SI{10}{\ohm},v=\hspace{25pt}$v_r(t)$] (0,3) 
    to [C=\SI{10}{F},v=\hspace{25pt}$v_c(t)$] (0,6); 
\end{circuitikz} 

\end{document}

enter image description here

Related Question