I'm looking for a simple method in tikz, where I can rotate text so that each letter in the text "sits" or is "stacked" on top of the successor letter. For example, the word "Environment" would appear as:


Thank you.

  • 3
    Welcome to tex,sx. Sep 10 '19 at 19:30
  • Welcome Tom! Your question might already have an answer at the link in my comment above. Add a comment if you disagree.
    – James
    Sep 10 '19 at 19:51
  • 2
    I kind of disagree, that question does not say how to put an arbitrary string vertically (other than putting manual linebreaks). There might be another duplicate somewhere though.
    – Marijn
    Sep 10 '19 at 21:44
  • @Marijn: True, but the OP doesn't say that manual linebreaks are not allowed either. Looks like we're getting some good non-Tikz answers below anyway.
    – James
    Sep 10 '19 at 23:11
  • See the stackengine package: ctan.org/pkg/stackengine Sep 11 '19 at 0:50

Usually I start answers with "If you do not mind loading TikZ, you could ..." but here one may say: If you do not mind not using TikZ you could use soul instead.


enter image description here

This answer is inspired by this answer. If someone wants to downvote me (again) for quoting others, go ahead.

The TikZ library decorations.text offers advanced options such as

\begin{tikzpicture}[decoration={text effects along path, 
text effects/.cd,
path from text angle=-90,
path from text,
characters={text along path},
character widths={inner xsep=1pt},
style characters=mw with {blue,inner xsep=0.4pt},
style characters=bdfhjklt with {red,inner xsep=1.5pt},
style characters=i with {orange,inner xsep=2.2pt},
style characters=gpqy with {inner xsep=1.2pt}}]
\path [ decorate,
text effects={characters/.append={/utils/exec=\pgftransformresetnontranslations}}] (1,0); \end{tikzpicture}

enter image description here

Here \pgftransformresetnontranslations is used to "unrotated" the characters.

And since there seems to be a desire to employ as little packages as possible: you don't need any.

\def\endpft{Yekitiyekitipeng}%<- something crazy

enter image description here

Whether or not it is worthwhile to have as little packages as possible is a different question. IMHO this is only the case if you get the same result with less packages. On the other hand, TikZ allows you to easily typeset the text along a curve, something that is hard to achieve without packages.

  • style characters=gpqy as far as I can see, none of these are actually part of the word “Environment”. Sep 11 '19 at 5:54
  • @HenriMenke Yes. This is meant to work for other words, too. The reason why I did that is that by default TikZ would space the characters according to their width, but after adding \pgftransformresetnontranslations the relevant dimension is the height. So these style characters also serve the purpose of "fixing" the spacing. (There are alternative ways such as rotate but as far as I can see none of them will work for arbitrary curves in the way \pgftransformresetnontranslations does.)
    – user194703
    Sep 11 '19 at 15:05

No TikZ, sorry.


  \tl_map_function:nN { #2 } \__tom_stack:n
\cs_new_protected:Nn \__tom_stack:n { #1 \\ }


x\stack{Environment}\qquad x\stack[t]{Environment}\qquad x\stack[b]{Environment}


We simply map the argument to populate a tabular. The optional argument sets the reference point just like for tabular (the x in the examples shows the reference point).

enter image description here


With MetaFun

string s ;
s := "Experiment" ;
for i = 1 upto length s:
    label(substring (i - 1, i) of s, (0,-i*.5cm)) ;
endfor ;

enter image description here

  • Just realized that in the original post it says “Environment”, not “Experiment”. Well... that is an exercise left to the reader. Sep 11 '19 at 5:55

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