3

[Original question]

\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}

enter image description here

I want \textsc works. Any help?

[Updated]

After CarLaTeX's answer, I got:

\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}

enter image description here

I want _ and $\theta$ works.

CarLaTeX
  • 62,716
aban
  • 747
  • 7
  • 13
  • I've also restored the original question; otherwise, the title is no more coherent with its text. However, for the future, I think it's better if you ask a follow-up question, in cases like this. For the solution, see my answer. – CarLaTeX Mar 11 '17 at 05:58

1 Answers1

5

I think you have to use \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}

enter image description here

Edit: answer to the updated version

Put them into {...}:

\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}

enter image description here

CarLaTeX
  • 62,716