[pstricks] writing in circles

Matthieu Paindavoine mpaindav at toad.net
Wed Aug 22 15:25:09 CEST 2001


Hello,

I am trying to write some text on concentric circles. I would like the
text to curve around the arcs, and to be readable without a mirror...

So I tried two things:

first using the pstextpath:

\documentclass[11pt]{article}
\usepackage{graphics,graphicx}
\usepackage{pstcol,pst-char,pst-text,pst-plot}
\begin{document}
\pagestyle{empty}

\begin{figure}[htbp]
\begin{center}
\begin{pspicture}(-4,-3)(3,1)
\psset{linestyle=none}
\pstextpath {\psarc(0,0){4}{90}{130}}{\tt{above}}
\pstextpath {\psarc(0,0){3.5}{90}{130}}{(below)}
\pstextpath {\psarc(0,0){4}{140}{180}}{\tt{above}}
\pstextpath {\psarc(0,0){3.5}{140}{180}}{(below)}
\pstextpath {\psarc(0,0){4}{190}{230}}{\tt{above}}
\pstextpath {\psarc(0,0){3.5}{190}{230}}{(below)}
\pstextpath {\psarc(0,0){4}{240}{280}}{\tt{above}}
\pstextpath {\psarc(0,0){3.5}{240}{280}}{(below)}
\pstextpath {\psarc(0,0){4}{290}{330}}{\tt{above}}
\pstextpath {\psarc(0,0){3.5}{290}{330}}{(below)}
\pstextpath {\psarc(0,0){4}{40}{80}}{\tt{above}}
\pstextpath {\psarc(0,0){3.5}{40}{80}}{(below)}
\end{pspicture}
\end{center}
\end{figure}
\end{document}


The problem with this solution is that psarc works counter clockwise,
and so the text on the upper half is from right to left.

The second solution is using some previous help from Denis, as in

\documentclass[11pt]{article}
\usepackage{graphics,graphicx}
\usepackage{pst-node}

\begin{document}

\begin{figure}[htbp]
\begin{center}
\begin{pspicture}(-3,-3)(3,3)
  \psset{linestyle=none}
  \pnode(-3.46,2){A}{A}
  \pnode(0,4){B}{B}
  \pnode(3.46,2){C}{C}
  \ncarc[arcangle=30]{A}{B}
  \naput[nrot=:U]{some long text}
  \ncarc[arcangle=30]{B}{C}
  \naput[nrot=:U]{above}
\end{pspicture}
\end{center}
\end{figure}

\makeatletter

\def\psset@@nrot:#1\@nil{%
\psset@@rot#1\@nil
\edef\psk at rot{%
NAngle \ifx\psk at rot\@empty\else\psk at rot add \fi
% D.G. modification begin - Oct. 13, 2000
tx at NodeDict begin xB xA lt {180 add} if end
% D.G. modification end
}}

\def\naput at i{%
\pst at killglue
\pst at makebox{%
\naput at ii{%
% D.G. modification begin - Oct. 13, 2000
%NAngle 90 add
tx at NodeDict begin xB xA lt {NAngle 90 sub} {NAngle 90 add} ifelse end
}}}
% D.G. modification end

\def\nbput at i{%
\pst at killglue
\pst at makebox{%
\naput at ii{%
% D.G. modification begin - Oct. 13, 2000
%NAngle 90 sub
tx at NodeDict begin xB xA lt {NAngle 90 add} {NAngle 90 sub} ifelse end
% D.G. modification end
}}}

\end{document}


But in that case the text doesn't wrap around the circle.


Well, does anyone has a suggestion or workaround this problem?

Thanks,

Matthieu



More information about the PSTricks mailing list