我想知道如何在元件端子上放置名称,在本例中为二极管。
以下是代码:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{mathtools}
\usepackage[american]{circuitikz}
\usetikzlibrary{shapes,arrows}
\renewcommand*\contentsname{Contenido}
\begin{document}
\maketitle
\begin{figure}[h]\centering
\begin{circuitikz}
\ctikzset{bipoles/diode/height=0.85, bipoles/diode/width=0.85,}
\draw (10,0) to[diode] (15,0);
\end{circuitikz}
\caption{Símbolo del Diodo}
\end{figure}
我希望在这里包含文本,我相信这是通过声明节点然后给节点命名来实现的,但我不确定。
答案1
是的,节点可以做到这一点。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[american]{circuitikz}
\begin{document}
\begin{figure}[h]\centering
\begin{circuitikz}
\ctikzset{bipoles/diode/height=0.85, bipoles/diode/width=0.85,}
\draw (10,0) node[above right,align=center]{some\\ text} to[diode]
(15,0) node[above left,align=center]{more\\ text} ;
\begin{scope}[yshift=-4cm,pin distance=15mm,
every pin edge/.style={<-,shorten <=1pt,stealth-,bend left},
every pin/.style={align=center}]
\draw (10,0) coordinate[pin=above right:{some\\ text}] to[diode]
(15,0) coordinate[pin={[pin edge={bend right}]above left:{more\\ text}}] ;
\end{scope}
\end{circuitikz}
\caption{S\'imbolo del Diodo.}
\end{figure}
\end{document}