如果我输入以下代码则没有问题:
\begin{circuitikz}[american]
\draw (0,0) to[R, l^=$R_4$, v=$V_1^+$, -*] (0,2) --(0,4);
\end{circuitikz}
但极性不是我需要的。而且我想改变电压和标签的位置。如果我输入以下代码,就会出现错误
\begin{circuitikz}[american]
\draw (0,0) to[R, l^=$R_4$, v_>=$V_1^+$, -*] (0,2) --(0,4);
\end{circuitikz}
错误:
! 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.
为什么仅当我改变电压配置时才会发生这种情况?
顺便说一下,这是我正在做的电路的完整代码。
\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}
答案1
我认为这又是这个问题的重复\shorthandoff{>}
。点击此处了解更多信息
由于您没有提供 MWE,因此无法判断,因此我只能猜测这是西班牙语设置,会产生相同的错误。您可以按如下方式修复它:
\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}
但我看不出输出有任何区别,所以可能是默认设置。