9

circuit

`\documentclass{article}
  \usepackage{graphicx}
  \usepackage[american]{circuitikz}
  \begin{document}
     \begin{figure}
       \centering  
       \begin{circuitikz}
      \draw (0,0)
    to[V,v=$V$] (0,3)        
    to[C=$C_1$] (5,3) 
    to [L=$L_1$] (5,0)
    to[short] (0,0);
   \end{circuitikz}
  \caption{}
   \end{figure}
  \end{document}
1

3 Answers 3

8

You can invert the voltage source by changing the counting direction of the voltage using v<=$V$ Your full example will look like:

\documentclass{article}
  \usepackage{graphicx}
  \usepackage[american]{circuitikz}
  \begin{document}
     \begin{figure}
       \centering  
       \begin{circuitikz}
      \draw (0,0)
    to[V,v<=$V$] (0,3)        
    to[C=$C_1$] (5,3) 
    to [L=$L_1$] (5,0)
    to[short] (0,0);
   \end{circuitikz}
  \caption{}
   \end{figure}
  \end{document}

enter image description here

2
  • this doesn't work for me, still it appears the same way, weather I put the < or not, I'm using texlive Commented Dec 12, 2017 at 3:17
  • Ditto, this doesn't work for me, even though the docs say it should (and this does). Using the answer above (drawing the other way around) puts the V on the wrong side of the circuit.
    – aha
    Commented Jan 25, 2018 at 18:41
10

Since version 0.8.3, using v<=$V$ has been removed as a way to change the polarity of a source. The manual recommends using the invert tag on the element:

\begin{center}
    \begin{circuitikz}
        \draw (0,0)
        to[V, v=$V$, invert] (0,3) %Invert the element to achieve required polarity.       
        to[C=$C_1$] (5,3) 
        to[L=$L_1$] (5,0)
        to[short] (0,0);
    \end{circuitikz}
\end{center}

Inverting also keeps the correct voltage/current direction.

PDFLaTeX Rendering

0

According to the circuitikz documentation:

Voltage directions: until v0.8.3, there was an error in the coherence between american and european voltages styles (see section 5.2) for the batteries. This has been fixed, but to guarantee backward compatibility and to avoid nasty surprises, the fix is available with new options:

  • oldvoltagedirection: Use old way of voltage direction having a difference between european and american direction, with wrong default labelling for batteries;
  • nooldvoltagedirection: The standard from 0.5 onward, utilize the (German?) standard of voltage arrows in the direction of electric fields (without fixing batteries);
  • RPvoltages (meaning Rising Potential voltages): the arrow is in direction of rising potential, like in oldvoltagedirection, but batteries and current > sources are fixed to follow the passive/active standard; – EFvoltages (meaning Electric Field voltages): the arrow is in direction of the electric field, like in nooldvoltagedirection, but batteries are fixed;

If none of these option are given, the package will default to nooldvoltagedirection. The behavior is also selectable circuit by circuit with the voltage dir style.

Solution

Add RPvoltages option when importing circuitikz package (\usepackage[american, RPvoltages]{circuitikz}).

The corresponding code is as follows:

\documentclass{article}
\usepackage{graphicx}
\usepackage[american,RPvoltages]{circuitikz}

\begin{document}
 \begin{figure}
   \centering  
   \begin{circuitikz}
        \draw (0,0)
        to[V,v<=$V$] (0,3)        
        to[C=$C_1$] (5,3) 
        to [L=$L_1$] (5,0)
        to[short] (0,0);
    \end{circuitikz}
\caption{}
\end{figure}
\end{document}

circuit

You must log in to answer this question.

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