我正在尝试沿着表示隔间(节点)流出的箭头插入文本。我在下面提供了一个最小工作示例。
\documentclass[tikz,margin=2mm]{standalone}
\usepackage[utf8]{inputenc}
\usetikzlibrary{arrows,positioning}
\definecolor{boxcolor}{HTML}{B9DCFF}
\begin{document}
\pagestyle{empty}
\tikzstyle{block}=[draw, fill=boxcolor, minimum size=1.5em, text width = 2cm, align = center, minimum height = 2cm]
\tikzstyle{arrow}=[->, red, text = black]
\begin{tikzpicture}[auto, >=latex']
\node [block] (S) {$S$};
\draw [arrow] (S.east) -- (3,0);
\end{tikzpicture}
\end{document}
我想在上图突出显示的区域中插入一些文本。
答案1
像这样吗?
\documentclass[tikz,margin=2mm]{standalone}
\usepackage[utf8]{inputenc}
\usetikzlibrary{arrows,positioning}
\definecolor{boxcolor}{HTML}{B9DCFF}
\begin{document}
\pagestyle{empty}
\tikzstyle{block}=[draw, fill=boxcolor, minimum size=1.5em, text width = 2cm, align = center, minimum height = 2cm]
\tikzstyle{arrow}=[->, red, text = black]
\begin{tikzpicture}[auto, >=latex']
\node [block] (S) {$S$};
\draw [arrow] (S.east) -- node [above] {Text} (3,0);
\end{tikzpicture}
\end{document}