Table captions -- keep with previous

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Table captions -- keep with previous

Unread post by John Johann »

Background: In a set-up for CHM and PDF output, I have image toggles with toggle headers and a paragraph after the image with the image caption for PDF.

The toggle header is shown in the CHM using a condition. The image caption "Figure 1: xxx" is hidden in CHM using a condition. The reverse happens in the PDF output.

The image paragraph is formatted with "Keep with next" so that image and caption are on the same page in the PDF.

I have multiple tables (which sometimes split across pages).

I sometimes get orphaned table captions in the PDF output. How do I avoid this without manually going through every table and formatting the last row to "Keep with next"?

Would be cool if there was a "Keep with previous" format.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Table captions -- keep with previous

Unread post by Tim Green »

Hi John,

Formatting the last row of the table with "keep with next" won't actually help you here. That only formats the paragraphs inside the table cells, and each table cell is actually a separate document, so it would not have any effect on the paragraphs that come after the table. What you need to do is to format the paragraph containing the table with "keep with next". To do that you need to put the insertion point cursor between the table and the paragraph end mark. This is easier if you keep the marks display switched on, which you can activate in View > Program Options > Editor.

There are several ways to position the insertion point in the table paragraph:
  • Click to the right of the table with the mouse.
  • Put the cursor after the last character in the last cell and press the right arrow key once to move out of the table and into the table paragraph
  • Put the cursor before the first character in the first paragraph after the table and press the left arrow key once to move up into the table paragraph.
Then you can format the table paragraph -- you can also indent the table, center it, put indents on both sides to make it narrower than the res of the page, change the spacing before and after the table and so on.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Re: Table captions -- keep with previous

Unread post by John Johann »

Hi Tim,
Thanks.
Is there any way to do that automatically -- t'would be easier to define the caption style to "Keep with previous" than edit lots of tables :-).

On the same note, is there an easy way to stop table rows breaking across pages -- apart from formatting all the text therein to "Keep with next"?
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Table captions -- keep with previous

Unread post by Tim Green »

John Johann wrote:Is there any way to do that automatically

Define a paragraph style for your table paragraphs and assign a keyboard shortcut to it. Then you just need to click to the right of the table and hit the shortcut. It can't be done globally with search and replace -- unless you do it on the XML source code of the topics with an external tool and regular expressions.
On the same note, is there an easy way to stop table rows breaking across pages -- apart from formatting all the text therein to "Keep with next"?
The only way to achieve that is to configure the table not to break in its properties. But then you have to be very sure that it's going to be small enough to fit on a single page -- otherwise it will never fit anywhere. 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Post Reply