3

If I type the following code there is no problem:

\begin{circuitikz}[american]
\draw (0,0) to[R, l^=$R_4$, v=$V_1^+$, -*] (0,2) --(0,4);
\end{circuitikz}

But the polarity is not the one I need. And also I would like to change the position of the voltage and the label. If I type the following code, there's an error

\begin{circuitikz}[american]
\draw (0,0) to[R,  l^=$R_4$, v_>=$V_1^+$, -*] (0,2) --(0,4);
\end{circuitikz}

Errors:

! Argument of \language@active@arg> has an extra }.<inserted text>\par 
                                                  (0,0) to[R, l^=$R_4$, v_>=$V_1^+$, -] (0,2)

!  Paragraph ended before \language@active@arg> was complete.<to be read again>\ par 
                                                  (0,0) to[R, l^=$R_4$, v_>=$V_1^+$, -] (0,2)

! Missing \endcsname inserted.<to be read again> \advance l.12 (0,0) to[R, l^=$R_4$,
                                                               v_>=$V_1^+$, -*] (0,2) --(0,4)

! Package pgfkeys Error: I do not know the key '/tikz/circuitikz/v_\advance \pa
r@deathcycles \@ne ' and I am going to ignore it. Perhaps you misspelled it.
See the pgfkeys package documentation for explanation.

Why does this happen only when I change the voltage configuration?

By the way this is the complete code of the circuit I'm doing.

\documentclass{article}    
\usepackage{latexsym,amsmath,amssymb,amsfonts,cancel}   
\usepackage[latin1,utf8]{inputenc}      
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}              
\usepackage{pstricks}                   
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{circuitikz}
\usepackage{siunitx}
\usepackage{setspace}
\usepackage[rflt]{floatflt}

\begin{document}    
\begin{circuitikz}[american]  
\draw (0,0) node[ground]{}  
(1.2,4.5) node[op amp] {}  
(0,2) to[R, l^=$R_4$, v=$V_1^+$, *-] (0,0)  
(0,2)--(0,4)   
(2.5,2) to[R, l^=$R_3$, i=$i_1$] (0,2)  
(2.5,2) to[short, *-](2.5,3.5)  
(2.5,3.5) to[R, l^=$R_2$, -*] (4.7,3.5)  
(4.7,3.5) to[R, l^=$R_1$] (6.7,3.5)  
(6.7,4.5) to[short, -*, i=$i _o$] (6.7,3.5)  
(2.2,4.5) to[short, -o] (7.5,4.5)   
(3.5,2) node[op amp,xscale=-1] {}  
(4.7,1.5) node[ground]{}  
(4.7,2.5) --(4.7,3.5)  
(0,5) node[ocirc] {}  
{[ anchor=east] (0,5) node {$V_i$}}  
{[ anchor=west] (7.5,4.5) node {$V_o$}}  
{[ anchor=north] (2.5,2) node {$V_o^\prime$}};  
    \end{circuitikz} 
\end{document} 

what I needed to do

  • Both of your code snippets compile without any errors when I tried them (except that you forgot to include the draw command), and the output is what I would expect to see. Perhaps you misspelled something in your original code? – Nicholas Hill Mar 29 '13 at 21:06
  • \language@active@arg> suggests that you have a babel language loaded giving a conflicting meaning to > but without a full example document, it is hard to say – David Carlisle Mar 29 '13 at 21:17
  • yes sorry I forgot to add the \draw, I already fixed in a weird way but it worked. I think that @DavidCarlisle was right. I fixed it by putting the coordenates in the order the direction of the current is needed.

    Instead of:

    \(0,0) to[R, l^=$R_4$, v=$V_1^+$, -*] (0,2)

    \(0,2) to[R, l^=$R_4$, v=$V_1^+$, -*] (0,0)

    – est.tenorio Mar 30 '13 at 01:13

1 Answers1

3

I think this is yet another duplicate of the \shorthandoff{>} problem. Read more here

Labels in TikZ are incorrectly interpreted

Since you don't give a MWE it's not possible to judge hence I'm just guessing it's a spanish setting which produces the same error. You can fix it as the following:

\documentclass{article}
\usepackage[spanish]{babel}
\usepackage{circuitikz}
\begin{document}



    \begin{circuitikz}[american]\shorthandoff{>}
    \draw (0,0) node[ground]{}
    (1.2,4.5) node[op amp] {}
    (0,2) to[R,  l^=$R_4$, v_>=$V_1^+$, -*] (0,0)
    (0,2)--(0,4) 
    (2.5,2) to[R, l^=$R_3$, i=$i_1$] (0,2)
    (2.5,2) to[short, *-](2.5,3.5)
    (2.5,3.5) to[R, l^=$R_2$, -*] (4.7,3.5)
    (4.7,3.5) to[R, l^=$R_1$] (6.7,3.5)
    (6.7,4.5) to[short, -*, i=$i _o$] (6.7,3.5)
    (2.2,4.5) to[short, -o] (7.5,4.5)
    (3.5,2) node[op amp,xscale=-1] {}
    (4.7,1.5) node[ground]{}
    (4.7,2.5) --(4.7,3.5)
    (0,5) node[ocirc] {}
    {[ anchor=east] (0,5) node {$V_i$}}
    {[ anchor=west] (7.5,4.5) node {$V_o$}}
    {[ anchor=north] (2.5,2) node {$V_o^\prime$}};

    \end{circuitikz}

\end{document}

But I can't see any difference in the output so probably it's the default setting.

percusse
  • 157,807