在
\begin{tikzpicture}
\node (C0) at (0pt,0pt) []{$C_0$};
\node (C1) at (100pt,100pt) []{$C_1$};
\draw[->] (a)--(b) node [sloped,above]{\text{an isotopy from $C_0$ to $C_1$}};
\end{tikzpicture}
但也可以通过命名节点并稍后绘制来“外部化”从 (a) 到 (b) 的箭头注释的绘制,例如:
\begin{tikzpicture}
\begin{scope}[transparency group,opacity=0.5]
\node (C0) at (0pt,0pt) []{$C_0$};
\node (C1) at (100pt,100pt) []{$C_1$};
\draw[->] (a)--(b) node (positionofannotation) [sloped,above]{};
\end{scope}
\node (nameofannotation) at (positionofannotation) [sloped]{$\text{an isotopy from $C_0$ to $C_1$}$};
\end{tikzpicture}
此时“倾斜”选项就变得无效了。
如何让 TikZ“记住”这个节点要“倾斜绘制”?
答案1
输出
增加了一个障碍物来显示节点绘制晚于路径。
代码
\documentclass[12pt,tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\begin{scope}[transparency group,opacity=0.5]
\node (C0) at (0pt,0pt) []{$C_0$};
\node (C1) at (100pt,100pt) []{$C_1$};
\draw[->] (C0)--(C1) node (positionofannotation) [sloped,midway] {};
\end{scope}
\fill [red!10, rounded corners] (25pt,25pt) rectangle (75pt,75pt);
\path (positionofannotation.west) -- (positionofannotation.east)
node (nameofannotation) [midway, above, sloped, font=\scriptsize]
{an isotopy from $C_0$ to $C_1$};
\end{tikzpicture}
\end{document}