6

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?

3
  • I am not really familiar with the circuitikz package, so I will leave this just as a comment (in case there's a "proper" way of solving the issue). You can 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} Commented Mar 13, 2012 at 1:55
  • @GonzaloMedina your solution looks better. You should add it as an answer.
    – user11232
    Commented Mar 13, 2012 at 8:33
  • Related Question: Spacing circuit element labels from their elements with CircuiTikz Commented Mar 15, 2012 at 17:51

1 Answer 1

3

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

1
  • Thank you Gonzalo, that doe work, but it is not ideal. For previous versions of the package, the spacing would be adjusted properly, and the +/- would not be so close to the wire. I think it's a bug, but am not sure... I'll see if I can figure out where to report this.
    – quickk
    Commented Mar 14, 2012 at 18:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .