我想在两条中心线上显示灯的特性:我使用了l2
手册中指示的标签,但两条线不是居中而是左对齐。
我犯了什么错误?
感谢您的帮助。
\documentclass{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[european, straightvoltages, RPvoltages]{circuitikz}
\usepackage{siunitx}
\usetikzlibrary{babel}
\begin{document}
\begin{circuitikz}
\draw (0,0)
to [vsource, l=\SI{6}{V}] (0,3)
to[lamp, l=\mbox{\SI{6}{\volt}, \SI{100}{mA}}] (3,3)
to [lamp, l2=\SI{6}{\volt} and \SI{100}{mA}, l2 valign=c] (3,0)
to[R, l=\SI{10}{\ohm}] (0,0)
;
\end{circuitikz}
\end{document}
答案1
似乎您没有正确匹配垂直和水平对齐。
\documentclass{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[european, straightvoltages, RPvoltages]{circuitikz}
\usepackage{siunitx}
\usetikzlibrary{babel}
\begin{document}
\begin{circuitikz}
\draw (0,0)
to [vsource, l=\SI{6}{V}] (0,3)
to[lamp, l=\mbox{\SI{6}{\volt}, \SI{100}{mA}}] (3,3)
to [lamp, l2=\SI{6}{\volt} and \SI{100}{mA}, l2 halign=c] (3,0)
to[R, l=\SI{10}{\ohm}] (0,0)
;
\end{circuitikz}
\end{document}