Page 1 of 1

DITA Composite Plus MathML

Posted: Mon Jan 20, 2020 2:42 pm
by tapo4ek999
Hi to all!
I use Oxygen XML v.17.1 to publish Ditamap to Webhelp. Ditamap consists of dita topics. I use <topic id="XXXXX"> to get fast access to this topic using folowing address in my browser "/webhelp/index.html?contextId=XXXXX" (after publishing).
Then I added "DITA Composite Plus MathML" page to my ditamap. And put the id attribute to topic section, same way like dita topic. Header of the document is following:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dita PUBLIC "-//FIRELAB//DTD DITA Composite Plus MathML//EN" "ditabase.dtd">
<dita>
<topic id="XXXXX">
  <title>Page title</title>
  <body>
So the problem is that a can't open "DITA Composite Plus MathML" pages (after publishing to Webhelp) using browser address "/webhelp/index.html?contextId=XXXXX". How can I deal with it?

Re: DITA Composite Plus MathML

Posted: Wed Feb 05, 2020 3:19 pm
by Radu
Hi,

Sorry for the delay.
I can reproduce this problem on our side and will add an internal issue to try and fix this.
As alternatives:
- Try to refer in the DITA Map directly to the inner topic ID, something like:

Code: Select all

<topicref href="topics/my_composite.dita#XXXXX"/>
- In the Oxygen 17.1 Preferences->"DITA" page you can switch to using DITA OT 2.x. After doing this you can embed MathML content directly in regular DITA topics because support for MathML has been added in the DITA 1.3 standard:

Code: Select all

<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic_ymw_3st_pkb">
  <title></title>
  <body>
    <p><mathml/></p>
  </body>
</topic>
- If all else fails I can try to give you an XSLT fix, suggest some changes in one of the publishing engine's stylesheets to try and fix the problem.

Regards,
Radu

Re: DITA Composite Plus MathML

Posted: Fri Feb 07, 2020 12:22 pm
by tapo4ek999
Hi, Radu!
Thank you for answer!
Unfortunately first solution doesn't work. Page still not open via "index.html?contextId=XXXXX" link.
Second one i tried before. It looks ok in author mode and published pdf. But in webhelp output it works only with mozilla browser, as i remeber. Only way to use mathml in webhelp we found is use MathJax engine with "Composite Plus MathML" document, which leaded to problem I wrote earlier.

Re: DITA Composite Plus MathML

Posted: Fri Feb 07, 2020 3:35 pm
by Radu
Hi,

Please see some answers below:
Unfortunately first solution doesn't work. Page still not open via "index.html?contextId=XXXXX" link.
I originally tested this workaround with Oxygen 21.1 (publish DITA content to WebHelp responsive) and the contexts.xml was generated to properly contain the topic ID.
Indeed I now tested this with Oxygen 17.1 and it does not work with it, probably it was a bug fix along the way...
Second one i tried before. It looks ok in author mode and published pdf. But in webhelp output it works only with mozilla browser, as i remeber. Only way to use mathml in webhelp we found is use MathJax engine with "Composite Plus MathML" document, which leaded to problem I wrote earlier.
I tested with Oxygen 17.1 referencing a topic like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="test">
  <title>test</title>
  <body>
    <p><mathml>
      <m:math
        display="block">
        <m:semantics>
          <m:mrow>
            <m:mrow>
              <m:mi mathvariant="bold">a</m:mi>
              <m:mo>=</m:mo>
              <m:mfrac>
                <m:mrow>
                  <m:mi mathvariant="bold">F</m:mi>
                </m:mrow>
                <m:mi>m</m:mi>
              </m:mfrac>
              <m:mo>=</m:mo>
              <m:mfrac>
                <m:mrow>
                  <m:mi>q</m:mi>
                  <m:mo>[</m:mo>
                  <m:mi mathvariant="bold">E</m:mi>
                  <m:mo>+</m:mo>
                  <m:mfenced>
                    <m:mrow>
                      <m:mi mathvariant="bold">v</m:mi>
                      <m:mi>X</m:mi>
                      <m:mi mathvariant="bold">B</m:mi>
                    </m:mrow>
                  </m:mfenced>
                  <m:mo>]</m:mo>
                </m:mrow>
                <m:mi>m</m:mi>
              </m:mfrac>
            </m:mrow>
          </m:mrow>
        </m:semantics>
      </m:math>
    </mathml></p>
  </body>
</topic>
using in the Oxygen Preferences =>"DITA" page the "DITA-OT2.x" installation.
It seems to generate the proper Mathml content inside the HTML output.
Indeed this works for Firefox but not for Internet Explorer or Chrome.
If your original approach if using the composite topic worked with Chrome or IE, then you possibly customized the transformation scenario and added references to the MathJax libraries because neither approach works for me in Chrome and IE unless MathJax is used.
As far as I remember Chrome and IE just don't have MathML support so the MathJax javascript libraries convert the MathL to SVG in order to make this work.

Regards,
Radu

Re: DITA Composite Plus MathML

Posted: Mon Feb 10, 2020 11:38 am
by tapo4ek999
Radu wrote: Fri Feb 07, 2020 3:35 pm If your original approach if using the composite topic worked with Chrome or IE, then you possibly customized the transformation scenario and added references to the MathJax libraries because neither approach works for me in Chrome and IE unless MathJax is used.
That's right! I added reference to "mathjax_head_script.txt" as a value of parameter "webhelp.head.script". Text of head script if following:

Code: Select all

<script type="text/javascript"
  src="../../../webhelp_mj/MathJax.js?config=TeX-AMS-MML_SVG">
</script>

<script>
MathJax.Hub.Config({
  SVG: {
    scale: 125
  }
});
</script>

<script>
  MathJax.Hub.Config({
  "HTML-CSS": {
    imageFont: null
  }
});
</script>
I found this solution somewhere here.
May be there is some way to use MathJax with basic "dita topic", not with "dita composite plus mathml"? I think that my problem is because of the structure of "dita composite plus mathml", where <topic> is not a root element.

Re: DITA Composite Plus MathML

Posted: Mon Feb 10, 2020 12:04 pm
by Radu
Hi,

If that "webhelp.head.script" parameter is still set for the transformation, maybe you can publish a small DITA Map referring to a topic (and not composite) with that MathML script inside it, like the topic I exemplified in my last post. Then look in the output HTML document and see if your header script is still included. If it is still included, your header script seems to have a relative reference to a Javascript file. Please make sure that the relative reference is correctly specified in relation with the folder where the HTML topic is placed in the output folder.

Regards,
Radu

Re: DITA Composite Plus MathML

Posted: Wed Feb 12, 2020 2:58 pm
by tapo4ek999
I put the script from your example above and got error message than prefix "m" is not bound (see attachment) :roll:
Screenshot_2.png
Screenshot_2.png (23.2 KiB) Viewed 1957 times

Re: DITA Composite Plus MathML

Posted: Wed Feb 12, 2020 5:36 pm
by tapo4ek999
Tomorrow I will try use mathml with mathjax inside non-composit topic in 18.1 version, which I also licenzed and will give feedback. In version 18.1 <m:math> tags works ok as I know.

Re: DITA Composite Plus MathML

Posted: Wed Feb 12, 2020 5:59 pm
by adrian_sorop
Hi,

In Oxygen 17.1, the deafult DITA-OT selected in Oxygen Preferences =>"DITA" is the DITA-OT 1.8.
Change the DITA Open Toolkit to use the DITA-OT 2.x and the MathML content will be recognized.

Regards,
Adrian Sorop

Re: DITA Composite Plus MathML

Posted: Thu Feb 13, 2020 12:12 pm
by tapo4ek999
Radu, Adrian, thank you a lot guys! It works properly! even in 17.1 :D