Is it possible to rotate text?

+1 vote
asked Jan 11, 2022 in Question / help by Bob Cavanaugh
Hi,

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:

L

I

K

E

T

H

I

S
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

Thanks

2 Answers

+1 vote
answered Feb 9, 2022 by Martin (8,360 points)
selected Feb 10, 2022 by plantuml
 
Best answer

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

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

commented Mar 29, 2022 by tex
I assume you need to install some optional latex component to get this to work...
commented Apr 5, 2022 by anonymous
Thank you, I will try this.
commented Apr 5, 2022 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, 2022 by Martin (8,360 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 https://plantuml.com/ascii-math 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 http://beta.plantuml.net​ then it offers me a list of files to download - the one you need is plantuml-jlatexmath.zip (from 2017!).  Unzip this into your folder containing plantuml's jar, and it should now work - well it does on mine.

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

Thanks!
commented Jan 25, 2022 by Bob Cavanaugh
Hi,

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.
...