One of my favorite poets is probably Guillaume Apollinaire. His story and proximity to Picasso made him a precursor. Calligrams was a constant attempt to merge poetry and visual. I am wondering how we could actually recreate in TikZ enter image description here enter image description here enter image description here


This is just to mention that TikZ has already built in a large selection of tricks that can be applied to paths. Here is a very basic example. (Yes, I know I am not a poet.;-)

 (-2,0) to[bend right=10] (0,5.1)
 to[bend right=10] (2,0) -- (1.5,0) -- (0.8,1) -- (-0.8,1) -- (-1.5,0) -- cycle}
\draw \mypath; 
\path[decorate,decoration={text along path,
text={In Paris there is a tower and beneath it there grows a flower. And often
on Mondays there is a shower.}}] \mypath;

enter image description here

The IMHO most stunning tools are however not from the pgfmanual, but due to Paul Gaborit's great answer. You basically define the contour and the macro takes care of the rest. (Of course, you may want to tune things in the end a bit, but it is stunning how much it does out of the box.)


  % 6 parameters:
  % style for node (default:empty),
  % h margin, v margin, left path, right path, text (just one paragraph!)

  % name left and right paths and compute there bounding boxes
  \begin{scope}[local bounding box=leftbb]
    \path[name path global=left,xshift=#2] #4;
  \node[inner ysep=-#3,inner xsep=0pt,fit=(leftbb)](leftbb){};
  \begin{scope}[local bounding box=rightbb]
    \path[name path global=right,xshift=-#2] #5;
  \node[inner ysep=-#3,inner xsep=0pt,fit=(rightbb)](rightbb){};

  % global bounding box
  \path let
  \p1=(leftbb.north west), \p2=(leftbb.south west),
  \p3=(rightbb.north east), \p4=(rightbb.south east)
    \pgfmathsetmacro{\ymin}{(\y1 < \y3) ? \y1 : \y3}
    \pgfmathsetmacro{\ymax}{(\y2 > \y4) ? \y2 : \y4}
    \typeout{ymin \ymin}
    \typeout{ymax \ymax}
  } node[inner sep=0,fit={(\x1,\ymin pt)(\x3,\ymax pt)}](mybb){};

  % compute nb steps
  \path let \p1=(mybb.north), \p2=(mybb.south) in
    \typeout{nb steps \nbsteps}

  % horizontal references
  \path (mybb.north) -- (mybb.south)
  \foreach \cnt in {0,1,...,\nbsteps}{
    coordinate[pos=\pos] (ref \cnt)

  % left and right boundaries coordinates
  \foreach \cnt in {0,1,...,\nbsteps}{
    % an horizontal line from left to right
    \path[name path=ltor]
    (mybb.west |- ref \cnt) --  (mybb.east |- ref \cnt);
    % same line from right to left
    \path[name path=rtol]
    (mybb.east |- ref \cnt) -- (mybb.west |- ref \cnt);
    % left boundary
    \path[name intersections={of=rtol and left,by={l \cnt},sort by=rtol}];
    % right boundary
    \path[name intersections={of=ltor and right,by={r \cnt},sort by=ltor}];
  % start point (and initial value of boundshape)
  \path let \p1=(l 0) in 

  % top and bottom
  \path let \p1=(l 0), \p2=(l \nbsteps) in
  % incremental definition of boundshape
  \foreach \cnt in {0,1,...,\nbsteps}{
    \path let \p1=(l \cnt), \p2=(r \cnt) in
      \pgfmathsetmacro{\ypos}{\cnt/\nbsteps*(\ystart - \yending)}
      {\let\\=\relax \xdef\boundshape{\boundshape\\{\ypos}t{\start}{\len}}}
      \pgfmathsetmacro{\xmin}{(\xmin < \start) ? \xmin : \start}
      \pgfmathsetmacro{\xmax}{(\xmax > \start + \len) ? \xmax : \start + \len}
  % draw the node with text in a shapepar
  \pgfmathsetmacro{\ymax}{\ystart - \yending}
  {\let\\=\relax \xdef\boundshape{\boundshape\\{\ymax}e{0}}}
  \node[#1,text width=\xmax pt - \xmin pt,align=flush left,
  anchor=north west,inner sep=0]
  at (mybb.north west -| \xmin pt,0)

\def\mytext{In Paris there is a tower and beneath it there grows a flower.}

      \def\pathone{(0,1) -- (-0.8,1) -- (-1.5,0) --
      (-2,0) to[bend right=10] (0,5.1)}
    to[bend right=10] (2,0) -- (1.5,0) -- (0.8,1) -- (-0.8,1)}
      \fill[top color=lime,bottom color=orange,middle color=yellow,draw=white]
      \pathone -- \pathtwo -- cycle;
      \def\pathone{(0,1) -- (-0.8,1) -- (-1.5,0) --
      (-1.6,0) to[bend right=10] (0,4.1)}
    to[bend right=10] (1.6,0) -- (1.5,0) -- (0.8,1) -- (-0.8,1)}
      %\draw[orange] \pathone;
      %\draw[orange] \pathtwo;

enter image description here

| improve this answer | |

Stolen from PSTricks gallery:


\newdimen\MyDim \MyDim=30pt
  \global\advance\MyDim by -0.175pt}


    {50}{0}[/A 5e-3 def ]{A*(cos(t)+t^2*sin(t)) | A*(sin(t)-t^2*cos(t))}}{\perChar{%


enter image description here

| improve this answer | |

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.