{"id":269,"date":"2010-09-02T18:00:06","date_gmt":"2010-09-02T12:30:06","guid":{"rendered":"http:\/\/www.cvr.cc\/?p=269"},"modified":"2010-09-02T18:00:06","modified_gmt":"2010-09-02T12:30:06","slug":"mathml-3-and-tex4ht","status":"publish","type":"post","link":"https:\/\/cvr.cc\/?p=269","title":{"rendered":"MathML 3 and TeX4ht"},"content":{"rendered":"<p><a href=\"http:\/\/www.w3.org\/TR\/MathML3\/\"><small>M<\/small>ath<small>ML<\/small> 3<\/a> is about to be formalized and going to be released as the new standard for encoding mathematics in web. It differs from the previous standard 2. The main changes that have a bearing on the functionality of <a href=\"http:\/\/www.tug.org\/tex4ht\/\">T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X4ht<\/a> are discussed here.<!--more--><\/p>\n<h4 style=\"color: #27d;\">Linking<\/h4>\n<p><small>M<\/small>ath<small>ML<\/small> 1 and 2 didn&rsquo;t have any built in provisions to specify links for various elements in a math formula. The recommendation was to use <a href=\"http:\/\/www.w3.org\/TR\/xlink\/\"><small>XL<\/small>ink<\/a> since it was part of the original grand plan for <a href=\"http:\/\/www.w3.org\/standards\/xml\/\"><small>XML<\/small><\/a> in its formative years. However, <small>XL<\/small>ink didn&rsquo;t gain much popularity nor was it supported widely. Therefore, <small>M<\/small>ath<small>ML<\/small> 3 now specifies that any <small>M<\/small>ath<small>ML<\/small> element can accept an <code>href<\/code> attribute that takes an <small>URI<\/small> specifying a hyperlink same as in the <a href=\"http:\/\/dev.w3.org\/html5\/spec\/Overview.html\"><small>HTML<\/small><\/a> element, namely, <code>&lt;a&gt;<\/code>. So this has an implication in the current scheme of T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X4ht. If readers provide a few examples of how they want to include links in a math fragment in L<span style=\"position: relative; bottom: 0.3ex; margin-left: -0.36em; margin-right: -0.15em; text-transform: uppercase\"><small>a<\/small><\/span>T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X, it will help largely to make a stable and suitable conversion scheme for T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X4ht.<\/p>\n<h4 style=\"color: #27d;\">Line breaking<\/h4>\n<p>Previous standards of <small>M<\/small>ath<small>ML<\/small> had the same limitations as T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X in the matter of breaking long equations. In T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X, it is easy for an author to break equations while authoring content taking into consideration of the margin constrains and paper sizes. However, for web content, margin and line-length are irrelevant when the window sizes are unknown or potentially liable to dynamic changes. Therefore, new <small>M<\/small>ath<small>ML<\/small> 3 specifies a line breaking model and introduces several new attributes to control properties of line breaks and alignments.<\/p>\n<p>This has deeper implications on the rendering software than on the engine that creates <small>M<\/small>ath<small>ML<\/small>. However, since the specification allows newer properties for line breaks and alignments, we need to take care of those part in T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X4ht which at the moment obeys what the author has input in her L<span style=\"position: relative; bottom: 0.3ex; margin-left: -0.36em; margin-right: -0.15em; text-transform: uppercase\"><small>a<\/small><\/span>T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X document. Since T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X is incapable of determining the semantic meaning of equations and hence break points, we have to provide hooks to make T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X4ht aware of the real line breaks and obligatory line breaks to adjust with page sizes. A better option will be to make use of <code>breqn<\/code> package while authoring and T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X4ht to provide necessary extra functionality to take care of <a href=\"http:\/\/tug.ctan.org\/tex-archive\/macros\/latex\/contrib\/mh\/\"><code>breqn<\/code><\/a> features in combination with <small>M<\/small>ath<small>ML<\/small>&rsquo;s newer goodies.<\/p>\n<h4 style=\"color: #27d;\">Image inclusion<\/h4>\n<p>The usage of <code>&lt;glyph&gt;<\/code> element in the previous <small>M<\/small>ath<small>ML<\/small> specification has been deprecated now. <code>&lt;glyph&gt;<\/code> element was used to specify characters from non-standard fonts that do not correspond to Unicode code points. Since the usage becomes difficult in a web context, as one needs to make sure that the font is available, <code>&lt;mglyph&gt;<\/code> has been extended with an <code>src<\/code> attribute to facilitate inclusion of a glyph in image format. <code>&lt;mglyph&gt;<\/code> now acts as a general image reference element in <small>M<\/small>ath<small>ML<\/small> much like <small>HTML<\/small>&rsquo;s <code>&lt;img&gt;<\/code> element.<\/p>\n<h4 style=\"color: #27d;\">Elementary math layout<\/h4>\n<p>Elementary school math layout is difficult to typeset even with T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X. Usually people adopt a tabular layout with a lot of complex macros to control space and rules around various number segments. Previous <small>M<\/small>ath<small>ML<\/small> standards provide elementary school math layout, much like in T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X, with a lot of tabular structure which obstructs rendering of math other than visual, particularly audio, because of the interference of tabular elements. <small>M<\/small>ath<small>ML<\/small> 3 provides better layout elements and scheme which help to specify even borrows and carries and many different kind of layout.<\/p>\n<pre>\n   435.3\n   ______\n  3)1306\n    12\n    __\n     10\n      9\n     __\n      16\n      15\n      __\n       1.0\n         9\n         _\n         1\n<\/pre>\n<h4 style=\"color: #27d;\">MathML version of long division<\/h4>\n<p>Given below is the <small>M<\/small>ath<small>ML<\/small> 3 coding of the above long division.<\/p>\n<pre>\n&lt;mlongdiv longdivstyle=\"lefttop\"&gt;\n  &lt;mn&gt; 3 &lt;\/mn&gt;\n  &lt;mn&gt; 435.3&lt;\/mn&gt;\n  &lt;mn&gt; 1306&lt;\/mn&gt;\n  &lt;msgroup position=\"2\" shift=\"-1\"&gt;\n    &lt;msgroup&gt;\n      &lt;mn&gt; 12&lt;\/mn&gt;\n      &lt;msline length=\"2\"\/&gt;\n    &lt;\/msgroup&gt;\n    &lt;msgroup&gt;\n      &lt;mn&gt; 10&lt;\/mn&gt;\n      &lt;mn&gt; 9&lt;\/mn&gt;\n      &lt;msline length=\"2\"\/&gt;\n    &lt;\/msgroup&gt;\n    &lt;msgroup&gt;\n      &lt;mn&gt; 16&lt;\/mn&gt;\n      &lt;mn&gt; 15&lt;\/mn&gt;\n      &lt;msline length=\"2\"\/&gt;\n      &lt;mn&gt; 1.0&lt;\/mn&gt;\n    &lt;\/msgroup&gt;\n    &lt;msgroup position=\"-1\";&gt;\n       &lt;mn&gt; 9&lt;\/mn&gt;\n      &lt;msline length=\"3\"\/&gt;\n      &lt;mn&gt; 1&lt;\/mn&gt;\n    &lt;\/msgroup&gt;\n  &lt;\/msgroup&gt;\n&lt;\/mlongdiv&gt;\n<\/pre>\n<h4 style=\"color: #27d;\">Directionality<\/h4>\n<p><small>M<\/small>ath<small>ML<\/small> 3 provides support for right to left writing\/reading direction whereas previous versions didn&rsquo;t have this functionality. The new specifications provide the user to control both writing directions of the identifiers within a formula and layout direction of the formula itself separately. I am not sure, if this has any influence on the behavior of current version of T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X4ht which is based on <code>dvi<\/code> files generated by T<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X while support for <code>xdv<\/code>, extended dvi generated by XeT<span style=\"position: relative; top: 0.5ex; margin-left: -0.1667em; margin-right: -0.125em; text-transform: uppercase\">e<\/span>X, is still very basic which supports multi-directional scripts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MathML 3 is about to be formalized and going to be released as the new standard for encoding mathematics in web. It differs from the previous standard 2. The main changes that have a bearing on the functionality of TeX4ht are discussed here.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,15,16],"tags":[],"class_list":["post-269","post","type-post","status-publish","format-standard","hentry","category-mathml","category-tex","category-tex4ht"],"_links":{"self":[{"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/posts\/269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cvr.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=269"}],"version-history":[{"count":0,"href":"https:\/\/cvr.cc\/index.php?rest_route=\/wp\/v2\/posts\/269\/revisions"}],"wp:attachment":[{"href":"https:\/\/cvr.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cvr.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cvr.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}