Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
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 1:13
add comment

1 Answer

up vote 3 down vote accepted

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.

share|improve this answer
    
That was it. It just required to add the `\shorthandoff{>}`` Thanks @percusse –  est.tenorio Mar 30 '13 at 16:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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