Is there a way to indent text inside a shape?

0 votes
asked Oct 13, 2017 in To be sorted by rd27 (460 points)

Is there a way to indent text inside a shape? I would like to just show some text indented by a couple spaces like the following:

line 1

  line 2

    line 3

But I can't seem to find a way to do that. Below is what I have tried. Only using characters like .. or __ works, but then those characters are visible of course. 

 

rectangle test_indent [
text
  text
* text
]

rectangle test_indent_as as "
text
  text
* text
*  text
 * text
<br>text
..text
__text
"

 

1 Answer

+1 vote
answered Oct 13, 2017 by plantuml (257,940 points)
selected Oct 9, 2018 by rd27
 
Best answer

You can use \t :

@startuml
rectangle test_indent [
text
\ttext
\t\ttext
]
@enduml

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuIfAJIv9p4lFILKeIIqkYS_CIqdDAr68vYf9hIZXYYc1Kb16B9T3QbuAK1i0

commented Oct 19, 2017 by rd27 (460 points)
Thanks! Is there anyway to do two character tabs rather than 4 characters>
commented Jan 25, 2018 by Anthony-Gaudino (5,740 points)
I guess that this may work:

skinparam tabSize 2
commented Oct 9, 2018 by rd27 (460 points)
Yes, that does work.  Thanks!
commented Nov 19, 2020 by jackson
It seems, this doesn't work anymore with newer versions.

Any suggestions?
asked Nov 20, 2020 in Bug by The-Lu (31,200 points) Indent text inside a shape broken [on 1.2020.20beta]
commented Nov 20, 2020 by plantuml (257,940 points)

Thanks for the report.

It should be fixed in last beta (1.2020.20beta14)  http://beta.plantuml.net/plantuml.jar

We will publish this new release in the incoming days.

...