我正在尝试画这幅画
我试过
\documentclass[]{article}
\usepackage{circuitikz}
\usepackage[locale = DE]{siunitx}
\begin{document}
\begin{tikzpicture}[c/.style={circle,fill,inner sep=1pt}]
\draw (0,0) coordinate (A) to[R={$R$}] (3,0) coordinate (M) to[L, l={$L,r$}, inductors/width=1.4,inductors/coils=11] (6,0) to[variable capacitor,l={$C$}] (8,0) coordinate (B);
\path foreach \p/\g in {A/-90,M/-90,B/-90}{(\p)node[c]{}+(\g:3.5mm) node{$\p$}};
\end{tikzpicture}
\end{document}
并得到
我怎样才能获得第一张图片形式的R?
答案1
使用 europeanresistors 作为全局选项:
\documentclass[]{article}
\usepackage[europeanresistors]{circuitikz}
\usepackage[locale = DE]{siunitx}
\begin{document}
\begin{tikzpicture}[c/.style={circle,fill,inner sep=1pt}]
\draw (0,0) coordinate (A) to[R={$R$}] (3,0) coordinate (M) to[L, l={$L,r$}, inductors/width=1.4,inductors/coils=11] (6,0) to[variable capacitor,l={$C$}] (8,0) coordinate (B);
\path foreach \p/\g in {A/-90,M/-90,B/-90}{(\p)node[c]{}+(\g:3.5mm) node{$\p$}};
\end{tikzpicture}
\end{document}
对于单个电路:
\documentclass[]{article}
\usepackage{circuitikz}
\usepackage[locale = DE]{siunitx}
\begin{document}
\begin{tikzpicture}[c/.style={circle,fill,inner sep=1pt}, european resistors]
\draw (0,0) coordinate (A) to[R={$R$}] (3,0) coordinate (M) to[L, l={$L,r$}, inductors/width=1.4,inductors/coils=11] (6,0) to[variable capacitor,l={$C$}] (8,0) coordinate (B);
\path foreach \p/\g in {A/-90,M/-90,B/-90}{(\p)node[c]{}+(\g:3.5mm) node{$\p$}};
\end{tikzpicture}
\end{document}
对于单个电阻器:
\documentclass[]{article}
\usepackage{circuitikz}
\usepackage[locale = DE]{siunitx}
\begin{document}
\begin{tikzpicture}[c/.style={circle,fill,inner sep=1pt}]
\draw (0,0) coordinate (A) to[R={$R$}, european resistors] (3,0) coordinate (M) to[L, l={$L,r$}, inductors/width=1.4,inductors/coils=11] (6,0) to[variable capacitor,l={$C$}] (8,0) coordinate (B);
\path foreach \p/\g in {A/-90,M/-90,B/-90}{(\p)node[c]{}+(\g:3.5mm) node{$\p$}};
\end{tikzpicture}
\end{document}
答案2
@Edson 回答是正确的,但我忍不住要添加这个 --- 为什么不使用“极点”机制来添加点,而不是使用单独路径的复杂东西?
\documentclass[]{article}
\usepackage{circuitikz}
\ctikzset{european resistors}% preferred way to set global options, circuitkz has too many package options...
\usepackage[locale = DE]{siunitx}
\begin{document}
\begin{tikzpicture}
\draw (0,0) node[below]{$A$} to[R={$R$}, *-*] (3,0) node[below]{$M$}
to[L, l={$L,r$}, inductors/width=1.4,inductors/coils=11] (6,0)
to[variable capacitor,l={$C$}, -*] (8,0) node[below]{$B$};
\end{tikzpicture}
\end{document}