Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to specify a curved base line (rising and falling like a roller coaster), then to have the text positioned such that it flows along that line. Is there a way to achieve this?

share|improve this question
10  
If you're willing to use TikZ, have a look at TikZ: Bend text so that it follows a line –  Jake Dec 24 '11 at 2:07
add comment

1 Answer

up vote 15 down vote accepted

Example 1: Text along a graph plot

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-text,pstricks-add}

\begin{document}

\begin{pspicture*}(-3,-5)(3,2)
\pstextpath[c](0,-0.5)
    {\psplot[linecolor=red,algebraic]{-2.75}{2.75}{x^2-4}}
    {\color{blue}\bf The graph of $y=f(x)=x^2-4$}
\psaxes[mathLabel=false,labelFontSize=\tiny]{->}(0,0)(-2.75,-4.75)(2.75,1.75)[$x$,-90][$y$,225]
\end{pspicture*}

\end{document}

enter image description here

Example 2: Text along an arc

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-text}

\begin{document}

\begin{pspicture}(7,3.5)
\pstextpath[c](0,0.25)
    {\psarcn[linecolor=red](3.5,0){3}{180}{0}}
    {\color{blue}\bf Merry Christmas and Happy New Year 2012}
\end{pspicture}

\end{document}

enter image description here

Example 3: Text along an arbitrary curve

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-text}

\begin{document}

\begin{pspicture}(7,3.5)
\pstextpath[c](0,0.15)
    {\pscurve[linecolor=red](0,0)(1.5,2.5)(3.5,2)(5.5,2.5)(7,0)}
    {\color{blue}\bf Merry Christmas and Happy New Year 2012}
\end{pspicture}

\end{document}

enter image description here

Note:

Compile each of them with latex-dvips-ps2pdf sequence. Warning: xelatex cannot compile them correctly.

share|improve this answer
2  
No, the pst-text package is incompitable with xelatex until now. –  gerry Apr 11 at 16:52
    
@gerry: Thanks for confirming such a incompatibility. –  I am who I say I am Apr 11 at 16:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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