metanorma / metanorma-iso

Metanorma processor for ISO standards
BSD 2-Clause "Simplified" License
14 stars 5 forks source link

Table caption does not "stay together" with table when the table is too long #905

Closed ronaldtse closed 1 year ago

ronaldtse commented 1 year ago

This occurs in Table 33 of ISO 19115-3 (https://github.com/metanorma/iso-19115-3/commit/807d02f59714ec3aa45568e6ac562db6e450bded):

Screen Shot 2023-01-16 at 9 27 24 AM

This is after #888 was fixed.

"Keep with next" should also be applied to the table caption with the table.

ronaldtse commented 1 year ago

I am using latest Git gems, my Gemfile:

source "https://rubygems.org"

gem "metanorma-cli"
gem "metanorma-standoc", git: "https://github.com/metanorma/metanorma-standoc", branch: "main"
gem "metanorma-iso", git: "https://github.com/metanorma/metanorma-iso", branch: "main"
gem "isodoc", git: "https://github.com/metanorma/isodoc", branch: "main"
gem "sassc"
opoudjis commented 1 year ago

The keep-with-next is there (as you can see in Paragraph formatting). The issue is rather that each row is so huge, that Word is not coping with the page formatting of the whole thing. (The whole table is in fact longer than a page, but just 6 rows.) The limit of 10 rows kept together will need to change to deal with row contents: we will need a guess at row size, factoring in row contents.

opoudjis commented 1 year ago

I'm going to not keep the table body rows together if they look close to a full page in size. The most reliable metric for that is that there are 15 carriage return equivalents—<p> or <li> or <br>.