Can I not put the title at the bottom in a diagram?

0 votes
asked Jan 28, 2016 by sky (130 points)
I do not see anyway of aligning or styling the diagram title. Am I missing something?

1 Answer

+1 vote
answered Jan 28, 2016 by plantuml (134,570 points)

Option are indeed limited with title.

WIth legends, you can have:

@startuml
legend bottom center
Foo
end legend
alice->bob : ok
@enduml


You can use bottom/top/left/right/center

Would you like to have the same options for titles ?

commented Jan 28, 2016 by sky (130 points)
Yes. I think we should have a minimum of "Top" and "Bottom" aligned center for the title. The usual paradigm when we are embedding the diagrams in documents or papers is to have a title at the bottom like, "Fig 1.1: The class diagram".  Title positioning options would really help there.
commented Jan 28, 2016 by plantuml (134,570 points)
Changing the default dehaviour for "title" is annoying because it will change existing diagrams.
We are thinking about adding a new keyword "caption" that will do the same as title, except that it will be printed at bottom.
Will this be ok for you ?
commented Jan 28, 2016 by sky (130 points)
Sure. That should do it.
commented Jan 29, 2016 by plantuml (134,570 points)
With last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
You can have:

@startuml
skinParam CaptionFontSize 10
skinParam CaptionFontColor blue
class AA
caption This is caption
@enduml

The default font size is 14 (default for title is 16, but it looks too much for caption). Do you agree ?

Few tests have been done, so feedback is welcome.
commented Jan 29, 2016 by sky (130 points)
I just tried it. That works really great. Thank you.
commented Mar 11, 2016 by sky (130 points)
The beta version you gave me here seems to be restricting the image size I can generate. For a big diagram to get the full image I have to decrease the dpi or the image is cropped. Also, if I use 'newpage' the image gets cropped upto that line. Either is a bug or is being restricted.

 Did the 'caption' keyword available in a release version now? Thank you.
commented Mar 11, 2016 by sky (130 points)
Version 8037 also seems to have the same problem.
commented Mar 12, 2016 by plantuml (134,570 points)
Cropping maybe related to http://plantuml.sourceforge.net/qa/?qa=4145/is-the-png-output-size-limited-to-4096-pixels-only
Could you check that ?

About 'newpage', could you provide a non-working example.
We have tested:

@startuml
caption This is a caption

Bob -> Alice : hello1
Bob -> Alice : hello2
newpage
Bob -> Alice : hello3
Bob -> Alice : hello4
newpage
Bob -> Alice : hello5
Bob -> Alice : hello6

@enduml

And this seems to work fine (to us).

Thanks!
commented Mar 15, 2016 by sky (130 points)
I use sublime plugin and tried it with version 8024 and 8037. The following:
------------
@startuml

a -> b : check
newpage
b -> c : verify

@enduml
---------------

generates:

a     b     c

check
---------->

a     b     c


Sorry about this ascii image. I don't know how to insert an image into the comments.
...