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.

  • 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 5:58
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

  • could you make the updated version work? – aban Mar 11 '17 at 4:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.