AntennaHouse / pdf5-ml

Antenna House PDF5-ML DITA-OT Plug-in
23 stars 9 forks source link

equation-figure and resizing of wide/"oversized" equations #102

Closed achall36 closed 4 years ago

achall36 commented 4 years ago

Hello Makita-san

I had been delaying to submit this example for reasons I cannot disclose. I have made some changes to the initial equation to obfuscate it but these changes do not materially affect the equation for the sake of this issue.

Reference: https://groups.google.com/forum/#!topic/dita-ot-users/XyQNy0XdwRY

When I set the equation-figure attribute expanse to "page", I observe no effect. As a result, the wide equation from exceeding the margins and right edge of the page (Letter size page).

I am also using the scale attribute and that has some effect but 50 is the lower limit of the scale attribute value and I cannot scale the equation down too much for legibility reasons.

I realize that my test equation does not need to be as wide as it as and could be broken up for the sake of display. That break-up work may be necessary. But if we can address this shortcoming in the pdf5-ml transformation, it would be a great help and the behavior would then correspond with the specification.

Reference: https://docs.oasis-open.org/dita/dita/v1.3/os/part1-base/langRef/attributes/displayAttributes.html

expanse="page" Places the element on the left page margin for left-to-right presentation, or right page margin for right-to-left presentation.

Based on what I observe currently, the equation-figure@expanse="page" has no effect for the pdf5-ml transformation. In defense of pdf5-ml, equation-figure@expanse="page" appears to have no impact on the FOP PDF transform nor the transform "DITA Map PDF - based on HTML5 & CSS".

equation-example-wide.txt

This is a DITA XML file but I changed the file extension to .txt to attach the file.

ToshihikoMakita commented 4 years ago

Hi Andy,

I could reproduce the problem you mentioned.

diff-20190913

What is the desired rendering result? Should I resize the equation-block to fit the page body width?

ToshihikoMakita commented 4 years ago

I applied @content-width="scall-down-to-fit" to fo:instream-foreign-object. However the formatting result did not changed.

2019-09-14

This may be the problem of AH Formatter itself.

achall36 commented 4 years ago

Thanks for looking into this. Here's an example of how I would like to have this equation sized and located in the AH PDF transformation. Please excuse the clumsy redactions!

image

achall36 commented 4 years ago

It looks like @content-width="scall-down-to-fit" includes typo and maybe that is the reason it did not succeed? Should it be @content-width="scale-down-to-fit"?

ToshihikoMakita commented 4 years ago

Yes, it was typo in this thread. In the actual XSL-FO file, I've coded as:

<fo:instream-foreign-object content-width="scale-down-to-fit">
  <m:math xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" xmlns:dita-ot="http://dita-ot.sourceforge.net/ns/201007/dita-ot">
    <m:mstyle displaystyle="true">
      <m:mrow>
      <m:mrow>
    ...

I will submit the question about this problem to the AH Formatter product group next week.

ToshihikoMakita commented 4 years ago

I have the information from AH Formatter group member.

I have attached sample DITA example.

mEquationTest.zip

The formatting result:

equation-break

This result may not satisfied one. However inserting <m:mspace linebreak="newline"/> is only solution for this problem.

RoxvilleRooster commented 4 years ago

Thanks for looking into this @ToshihikoMakita! Your example helped greatly. I was able to reproduce it using the AH formatter evaluation version that I am testing. I am referring to https://www.w3.org/TR/MathML3/chapter3.html#presm.linebreaking for guidance on where to insert the <m:mspace linebreak="newline"/> elements.