我想去掉电压源上的箭头,只使用没有箭头的标签。可以吗?任何帮助都将不胜感激。谢谢
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{color}
\usepackage[siunitx]{circuitikz}
\usetikzlibrary{shapes.misc}
\begin{document}
\begin{figure}[t!]
\centering
\ctikzset{bipoles/length=1.cm}
\begin{circuitikz}[scale = 0.6]
\draw (-2,-2) node[ground] {} to[sV=$SG_1$] (-2,0);
\end{circuitikz}
\end{figure}
\end{document}
答案1
它似乎对我来说,您所需要的就是sinusoidal voltage source,label=...
,它可以成为一种风格。
\documentclass{article}
\usepackage[siunitx]{circuitikz}
\usetikzlibrary{shapes.misc}
\begin{document}
\begin{figure}[t!]
\centering
\ctikzset{bipoles/length=1.cm}
\begin{circuitikz}[scale = 0.6]
\draw (-2,-2) node[ground] {}
to[sinusoidal voltage source,label=$SG_1$] (-2,0);
\end{circuitikz}
\quad\tikzset{myV/.style={sinusoidal voltage source,label=#1}}
\begin{circuitikz}[scale = 0.6]
\draw (-2,-2) node[ground] {}
to[myV=$SG_1$] (-2,0);
\end{circuitikz}
\end{figure}
\end{document}
答案2
您可以在某个地方添加一个\node
,这样不会打印箭头,但可以放置标签:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{color}
\usepackage{circuitikz}
\usetikzlibrary{shapes.misc}
\begin{document}
\begin{figure}[t!]
\centering
\ctikzset{bipoles/length=1.cm}
\begin{circuitikz}[scale = 0.6]
\draw (-2,-2) node[ground] {} to[sV] (-2,0);
\node[anchor=east] at (-2.5,-1) {$SG_1$};
\end{circuitikz}
\end{figure}
\end{document}