3

How do I split text into two lines in an arc?

\documentclass[pstricks,border=10mm]{standalone}
\usepackage{pst-node}
\begin{document}
\begin{pspicture}[showgrid](10,6)
\rput(2,1){\Rnode{r1}{}}
\rput(2,5){\Rnode{r2}{}}
\ncangle[angleA=180, angleB=180, arm=1, linearc=0.5, arrows=->]{r1}{r2}\ncput*{\small test, test2}
\end{pspicture}
\end{document}

I have two rnodes and connect them with an ncangle and with \ncput i put a text in the arc. Here it prints test, test2 but i would like to have two lines, such test is in line 1 and test2 in a second line directly under test.

2
\documentclass{article}
\usepackage{pst-node}
\begin{document}
\begin{pspicture}[showgrid](4,6)
\pnodes(2,1){r1}(2,5){r2}
\ncangle[angleA=180,angleB=180,arm=1,linearc=0.5,arrows=->]{r1}{r2}
\ncput*{\small\shortstack{t1\\test2}}
\end{pspicture}
\end{document}
1

Something like this?

\documentclass{article}
\usepackage{pst-node} % Thanks to ArtificialStupidity
\begin{document}
\begin{pspicture}[showgrid](10,6)
\rput(2,1){\Rnode{r1}{}}
\rput(2,5){\Rnode{r2}{}}
\ncangle[angleA=180, angleB=180, arm=1, linearc=0.5,
arrows=->]{r1}{r2}\ncput*{\small\begin{tabular}{c}
test\\ test2
\end{tabular}}
\end{pspicture}
\end{document}

enter image description here

The nice thing about pstricks and other packages like asymptote and tikz is that you can use all the LaTeX commands for annotations and so on.

  • 1
    You don't need to load all packages, pst-node is enough in this case. – Money Oriented Programmer Dec 11 '17 at 23:35
  • 1
    @ArtificialStupidity You're right. – user121799 Dec 11 '17 at 23:46

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.