Book a Demo

Author Topic: Keep diagram and caption on the same page in RTF  (Read 15656 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Keep diagram and caption on the same page in RTF
« on: June 19, 2015, 05:29:50 pm »
When generating RTF documents EA resizes my diagrams so they fit exactly on a page.

That is a good thing of course, but...
With each diagram we add a caption containing the figure number, and the name of the diagram.
Because the diagrams are resized to fit the page, the caption is consistently put on the next page.
So after generating the document we have to go over it and make each diagram a little bit smaller so the caption is on the same page as the actual diagram.

Is there any way we can tell EA that the diagram + caption need to fit on a page?

Geert

Marc Vanstraelen

  • EA User
  • **
  • Posts: 40
  • Karma: +6/-0
    • View Profile
Re: Keep diagram and caption on the same page in R
« Reply #1 on: June 19, 2015, 09:40:30 pm »
This would indeed be useful.

I experienced the following (not a solution but interesting to know). We generated rtf documents from a template that was set up in American "letter" format. When the document was generated, I routinely switched the format in Word to A4. This has the side effect that the captions are then on the same page as the diagrams they belong to.

Not really a solution, but at least with a single manipulation all diagrams are taken care of at once ;)

benc

  • EA Administrator
  • EA User
  • *****
  • Posts: 200
  • Karma: +0/-0
    • View Profile
Re: Keep diagram and caption on the same page in R
« Reply #2 on: June 19, 2015, 09:40:42 pm »
Hi Geert,

As far as I know there is not yet an option in EA for this. We have struck a similar issue before... I think it was the opposite end of the diagram though: trying to keep diagram headings or names together with diagram images.

So there is a submitted request for this - something like the "keep together" flag that exists for text, but it's not quite that simple of course...

How much should EA be allowed to shrink a diagram to force it on the same page as a bit of text (caption, heading, name, some other label)?
And maybe I have 'poster' diagrams that I don't want shrunk at all - so a global option to keep say headings+images together doesn't work for all scenarios.

I do think a "keep together" option would be nice and probably straightforward for your caption scenario, since it appears after the diagram image. But to make things work generically - especially for situations where the text/label/caption appears before the diagram image, anywhere on the page (for example near the end of a page) - I think a 'maximum scale-down' value and maybe a diagram-level overriding option would be useful.

Something like that was proposed in the original request. For now, the only workaround I know of is manual work, sorry.

Ben

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Keep diagram and caption on the same page in R
« Reply #3 on: June 19, 2015, 10:02:04 pm »
Hi Ben,

Thanks for your response. A "keep together" option would indeed be a solution for me as the diagram image and the caption will always be on the same template or fragment.

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Keep diagram and caption on the same page in R
« Reply #4 on: June 19, 2015, 10:04:01 pm »
Hi Marc,

Thanks for your suggestion. Too bad we already setup all the templates and fragments in A4, so I'm not really inclined to go for this workaround.

But it is really an ingenious workaround :)

Geert

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Keep diagram and caption on the same page in R
« Reply #5 on: June 20, 2015, 07:13:36 am »
Just reading this whilst eating breakfast. Here is a thought - try inserting section breaks and bringing in the side page margins by about 15 to 20 cm where you have the diagrams. EA fits the image to the width of the page margins I think.
Do let us know if it works as I haven't tried it yet.
Happy to help
:)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Keep diagram and caption on the same page in R
« Reply #6 on: June 22, 2015, 04:43:21 pm »
The width usually isn't an issue. It's mostly the length of the diagrams that  is the problem.

I don't see how the section break will solve anything. Won't it just add a section break on the next page?

Geert

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Keep diagram and caption on the same page in R
« Reply #7 on: June 22, 2015, 08:36:38 pm »
Fair enough I'll elaborate on the thought. By narrowing the margins the image will be made smaller ( height and width) and thus will fit on the page with the text underneath. You need section breaks so the narrower margins don't affect the normal text margins.
Another technique is to put the image into a table with three columns. The image goes into the centre column and the two outer columns act as margins keeping the image smaller so it can fit on the page with text underneath it.
Alternatively you could do some manual post processing by making the diagrams smaller.
Happy to help
:)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Keep diagram and caption on the same page in R
« Reply #8 on: June 22, 2015, 08:44:01 pm »
We have a lot of diagram that are much taller then they are wide. So limiting the width wouldn't necessarily have the desired effect.

Quote
Alternatively you could do some manual post processing by making the diagrams smaller.
That's what we do now, until Sparx comes up with an alternative.

Geert

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Keep diagram and caption on the same page in R
« Reply #9 on: June 23, 2015, 04:28:43 pm »
Quote
We have a lot of diagram that are much taller then they are wide. So limiting the width wouldn't necessarily have the desired effect.
Thats unfortunate.
I found putting the diagrams in a table and making the margins wider, along with keep with next in paragraph style fixed that problem for me even when the diagrams were longer than wide. However, my particular problem didn't have drastically different sized diagrams.  

Quote
That's what we do now, until Sparx comes up with an alternative.

Why did I know that already? You could write a script in the word processor you are using to automate the process if its really too tedious. Pretty sure you can do this in MS Word and Libre Office Writer. I'm sure you've probably considered it already. I know its always a balance of is it worth spending the time writing the script vs doing in manually.

One final thought to consider is trying eadocx and see if you can control the diagram with caption problem in that. But I guess if you've invested time & effort in creating those templates in Sparx EA you'll be reluctant to try that option.
Happy to help
:)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Keep diagram and caption on the same page in R
« Reply #10 on: June 23, 2015, 04:49:14 pm »
Quote
I found putting the diagrams in a table and making the margins wider, along with keep with next in paragraph style fixed that problem for me even when the diagrams were longer than wide. However, my particular problem didn't have drastically different sized diagrams.  
Maybe i need to give the table idea another go then huh? I'll let you know how it works out.

Quote
Why did I know that already? You could write a script in the word processor you are using to automate the process if its really too tedious. Pretty sure you can do this in MS Word and Libre Office Writer. I'm sure you've probably considered it already. I know its always a balance of is it worth spending the time writing the script vs doing in manually.
I'll see if it is worth it. After all, the users will probably go over the document anyway to verify the content and clean things up. It wouldn't be too much of a hassle to fix the diagrams sizes when they're at it.

Quote
One final thought to consider is trying eadocx and see if you can control the diagram with caption problem in that. But I guess if you've invested time & effort in creating those templates in Sparx EA you'll be reluctant to try that option.
I did consider eaDocX, but that didn't work out because of the complexity of my documents. I use a lot of virtual documents with model documents, document fragments (regular, SQL and Script) etc..

Geert

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Keep diagram and caption on the same page in R
« Reply #11 on: June 25, 2015, 03:27:39 pm »
MS Word paragraph styles provide a "keep with next" for paragraphs, same for Libre Office ....

It certainly appears like EA supports this,
but as far as I can see from using and testing the generated documents have dropped this setting in the generated style (and no I haven't reported it as a bug)

Setting of normal style in generated document:
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Keep diagram and caption on the same page in R
« Reply #12 on: June 25, 2015, 03:55:39 pm »
Interesting :-?

I'll check if I can use that somehow on my caption style.
There's some funny stuff going on with the normal style, so we decided to not use that style anymore. Hopefylly it does work with other styles.

To be continued...

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Keep diagram and caption on the same page in R
« Reply #13 on: June 25, 2015, 07:23:33 pm »
The keep with next/keep together options don't really help, even if they are ported to the Word style. The reason is that the diagram size fits the whole page, so regardless of the setting, the caption is moved to the next page.

I also tried the table with "margin" columns to the left and right. That somehow works, but the downside is that it limits the width of all diagrams, also if it isn't necesarry.
It only works effectively if you know the (median) height of the diagrams that will be reported.

Because of these donwsides I'm currently still going with the "manual postprocessing" option. :-/

Geert

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Keep diagram and caption on the same page in R
« Reply #14 on: June 26, 2015, 09:28:21 am »
Is the caption active in the document? I mean, have you set things up so that document references react to/capture the caption number and text, or the caption number automatically updates if diagrams are added or deleted? If not, you could use a Text element to put the caption number and text on the diagram itself, so that it is part of the diagram and stays with (in) it whatever resizing occurs.
Best Regards, Roy