[原始问题]
\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
\node [circle, draw=red, fill=red!30] (N1) at (0,0) {A};
\node [circle, draw=red, fill=green!30] (N2) at (5,0) {B};
\draw [red,->] [postaction={decoration={raise=3pt, text along path, text={|\textsc|Text||},text align=center}, decorate}] (N1.north) to [out=45,in=135] (N2.north);
\end{tikzpicture}
\end{document}
我想要\textsc
作品。有什么帮助吗?
[更新]
听了 CarLaTeX 的回答后,我得到了:
\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
\node [circle, draw=red, fill=red!30] (N1) at (0,0) {A};
\node [circle, draw=red, fill=green!30] (N2) at (5,0) {B};
\draw [red,->] [postaction={decoration={raise=3pt, text along path, text={|\scshape|Text |\_| |+$\theta$|},text align=center}, decorate}] (N1.north) to [out=45,in=135] (N2.north);
\end{tikzpicture}
\end{document}
我想要_
并且$\theta$
有效。
答案1
我认为你必须使用\scshape
:
\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
\node [circle, draw=red, fill=red!30] (N1) at (0,0) {A};
\node [circle, draw=red, fill=green!30] (N2) at (5,0) {B};
\draw [red,->] [postaction={decoration={raise=3pt, text along path, text={|\scshape|text},text align=center}, decorate}] (N1.north) to [out=45,in=135] (N2.north);
\end{tikzpicture}
\end{document}
编辑:回答更新后的版本
把它们放入{...}
:
\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
\node [circle, draw=red, fill=red!30] (N1) at (0,0) {A};
\node [circle, draw=red, fill=green!30] (N2) at (5,0) {B};
\draw [red,->] [postaction={decoration={raise=3pt, text along path, text={|\scshape|text {\_ $\theta$}},text align=center}, decorate}] (N1.north) to [out=45,in=135] (N2.north); \end{tikzpicture}
\end{document}