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?

  • 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} – Gonzalo Medina Mar 13 '12 at 1:55
  • @GonzaloMedina your solution looks better. You should add it as an answer. – user11232 Mar 13 '12 at 8:33
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

  • 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 Mar 14 '12 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.