iho-ohi / S-102-Product-Specification

It is opened to develop S-102 Bathymetric Surface Product Specification. The contents of this repository are not offical publication in force, therefore please check the final version on the IHO website.
Other
28 stars 11 forks source link

Reduced size of figures in Word version #38

Closed rmalyankar closed 1 year ago

rmalyankar commented 1 year ago

The size of several figures in the published 2.2.0 (April 11, 2023) Word version should be increased to make their contents more legible. The dimensions of the image files in 2.2.0 Developing are large enough. Specifically:

RohdeBSH commented 1 year ago

I can absolutely understand that. Unfortunately, since version 2.2.0 has already been released, this will have to be integrated into one of the following versions. So for example 2.2.1 or 2.3.0 depending on what the next PT meeting decides (@AnnaWall01 to add to the agenda for PT13). @hasel001 before that, the pull request should be merged. So that version 2.2.0 is also in the main branch.

I have already done some research. It would make sense to use the full page width for the images, then they are automatically scaled in height accordingly. However, I guess there are a few problems with the different output formats. Not all of them accept the same parameters for the image width. Alternatively, an absolute size can be specified. While we're at it, to adjust something about the images, we might as well specify the alternative text to make the document more accessible.

We should first try the simple solution in a separate branch and analyze how it looks. I will try it out this week.

see also: https://docs.asciidoctor.org/asciidoc/latest/macros/image-size/ https://docs-as-co.de/news/asciidoc-image-size/

Simplest solution

image:test.png[alt=description, width=100%] However, this is supposed to work only since HTML5 and PDF probably causes problems as well.

More complex solution

image:test.png[alt=description, width=100%, scalewidth=17cm] The 17 cm are the width of the standard writing area of a DIN-A4 page. This is probably the safest solution. However, with a fixed width, which then does not fit the landscape format.

Absolute size

image::flower.jpg[alt=description, width=640,height=480]

AnnaWall01 commented 1 year ago

@RohdeBSH I have noted for the PT13 agenda regarding next version of S-102.

RohdeBSH commented 1 year ago

Hi @ronaldtse,

I am in despair. How to get the images bigger in Metanorma? I have tried a few things now, but never got the expected result for all output formats. The goal is to scale an image to the full page width. For PDF this works quite well. For HTML and Word not at all. It is about this image https://github.com/iho-ohi/S-102-Product-Specification/blob/38-reduced-size-of-figures-in-word-version/sources/2.2.0/images/figure-data-set-structure-s102.png in the sources/2.2.0/sections/04-data_content_struct.adoc . The size of the image is 15.8 x 13.2 cm (height x width). However, Word only scales the image to 10.58 x8.78 cm.

Do you have another hint?

I have already tried the following: image::../images/figure-data-set-structure-s102.png[alt="Data Set Structure of S-102", width=100%] image::../images/figure-data-set-structure-s102.png[alt="Data Set Structure of S-102", scaledwidth=100%] image::../images/figure-data-set-structure-s102.png[alt="Data Set Structure of S-102", scaledwidth=100vw] image::../images/figure-data-set-structure-s102.png[alt="Data Set Structure of S-102", pdfwidth=100%,width=100%, scalewidth=16cm] image::../images/figure-data-set-structure-s102.png[alt="Data Set Structure of S-102", pdfwidth=100%, role=full-width]

ronaldtse commented 1 year ago

@RohdeBSH sorry for this issue. Let us investigate and get back to you!

ronaldtse commented 1 year ago

@RohdeBSH Metanorma in Word and HTML does not mess with image scaling unless specified -- an image normally is placed in its original size, if it is too large, it will span page width.

This is a comparison of the PDF vs Word output of Figure 2:

Screenshot 2023-05-09 at 1 00 07 AM

Here, the size difference lies in the styling of the Metanorma Word vs Metanorma PDF:

We will remove the figure margin in Word and HTML, which will be done here:

opoudjis commented 1 year ago

Issue resolved in gem html2doc, just released to v1.5.4. It was not to do with margins, but with the calculation of page width for full-width images.

hasel001 commented 1 year ago

Per decision in PT14, I am closing this issue. While we recognize that some changes may be required to optimize formatting, we also agree that they are of sufficiently low priority to merit issue closure.

RohdeBSH commented 1 year ago

I can't see a problem with the size of the images in the PDF anymore. So it seems to have been solved as well.

The width parameter works now image::./images/figure-data-set-structure-s102.png[UML diagram depicting the Application Schema Data Set Structure as described between this figure and the Coverage Structure figure, width=50%]