Is it possible to rotate text?

0 votes
asked Jan 11 in Question / help by Bob Cavanaugh

I am trying to set up a state transition table similar to one we already have (hand-drawn). The text for the row titles is horizontally-aligned (normal) but the text for the column titles is vertically-aligned to save space:








But the letters are rotated as a group so they are all aligned but on a different axis
Is there any way for me to specify in a table to vertically set the text label? I know I could do a work-around but it would be much nicer to be able to set it directly


2 Answers

0 votes
answered Feb 9 by Martin (8,280 points)
selected Feb 10 by plantuml
Best answer

You can rotate text inside a <latex> tag, and tables support this.  Here is an example:

| |<latex>\rotatebox{90}{heading1}</latex>|<latex>\rotatebox{270}{heading2}</latex>|<latex>\rotatebox{45}{heading3}</latex>|
|<latex>test</latex>| test2 | test3 | test4 |
end title

commented Mar 29 by tex
I assume you need to install some optional latex component to get this to work...
commented Apr 5 by anonymous
Thank you, I will try this.
commented Apr 5 by Bob Cavanaugh
Martin or Moderator:

I have looked at the documentation and I can generate latex files ala tikz, but I cannot get <latex>..</latex> to parse, just substitutes the text into my tables. Please let me know what JARs or packages I need to install? Thanks!
commented Apr 5 by Martin (8,280 points)

I see what you mean.  I must admit I had only used <latex> with the online server and not locally.  But I have managed to get it working.  The clue is on the page.  It looks like <latex> is supported in order to draw mathematical formulas.  At the bottom of the page it says:

Since JLatexMath is bigger, you have to download it separately, then unzip the 4 jar files (batik-all-1.7.jarjlatexmath-minimal-1.0.3.jarjlm_cyrillic.jar and jlm_greek.jar) in the same folder as PlantUML.jar.

For some reason the "download it" link doesn't work in my browser.  However, I found that if I navigate to​ then it offers me a list of files to download - the one you need is (from 2017!).  Unzip this into your folder containing plantuml's jar, and it should now work - well it does on mine.

commented Apr 6 by anonymous
That did it, Thanks!
0 votes
answered Jan 12 by plantuml (276,340 points)
This is a good suggestion. Could you post an example? It would help.

commented Jan 25 by Bob Cavanaugh

I tried to include an example but it wont finish adding the comment so...

Take a regular letter 'E'. Since this is the normal orientation its rotation value is 0. Now imagine the 'E' is rotated 180 degrees. Now the large bar of the 'E' is facing the top of the page, not the left. Extend that to a text string, where all the letters are oriented as starting from the top of the page, and what would normally be the bottom of the line is facing the left side of the page. If rotation is possible, it would be even more powerful of the rotation angle can be specified.