{"id":205,"date":"2021-02-15T14:16:37","date_gmt":"2021-02-15T22:16:37","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/math-in-office\/?p=205"},"modified":"2021-02-15T14:16:37","modified_gmt":"2021-02-15T22:16:37","slug":"some-unicodemath-enhancements","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/math-in-office\/some-unicodemath-enhancements\/","title":{"rendered":"Some UnicodeMath Enhancements"},"content":{"rendered":"<p>In the years since <a href=\"https:\/\/www.unicode.org\/notes\/tn28\/UTN28-PlainTextMath-v3.1.pdf\">UnicodeMath 3.1<\/a> was published, some improvements have been made. The converter that converts UnicodeMath to <a href=\"https:\/\/docs.microsoft.com\/en-us\/archive\/blogs\/murrays\/officemath\">OfficeMath<\/a> also converts <a href=\"https:\/\/en.wikibooks.org\/wiki\/LaTeX\/Mathematics\">LaTeX<\/a> and <a href=\"https:\/\/docs.microsoft.com\/en-us\/archive\/blogs\/murrays\/nemeth-braille-the-first-math-linear-format\">Nemeth math braille<\/a> to OfficeMath. The converter needs ways to provide OfficeMath math-object arguments even when these arguments are not marked as such in the math format. The resulting infrastructure is available for converting all three formats to OfficeMath.<\/p>\n<h3><em>n<\/em>-aryands<\/h3>\n<p>With all three formats, the <em>n<\/em>-aryand, e.g., integrand or summand, may not be identified by surrounding delimiters. But <a href=\"https:\/\/docs.microsoft.com\/en-us\/archive\/blogs\/murrays\/officemath\">OfficeMath<\/a> and <a href=\"https:\/\/www.dessci.com\/en\/products\/mathtype\/\">MathType<\/a> have <em>n<\/em>-aryand arguments as described in the post <a href=\"https:\/\/docs.microsoft.com\/en-us\/archive\/blogs\/murrays\/integrands-summands-and-math-function-arguments\">Integrands, Summands, and Math Function Arguments<\/a>. UnicodeMath has the binary operator U+2592 (\u2592) to treat the expression that follows the \u2592 as the <em>n<\/em>-aryand (see Section 3.4 of <a href=\"https:\/\/www.unicode.org\/notes\/tn28\/UTN28-PlainTextMath-v3.1.pdf\">UnicodeMath 3.1<\/a>). In generalizing the conversion code for LaTeX and braille, it became clear that a space alone is adequate for starting <em>n<\/em>-aryands and we don\u2019t need the \u2592, which doesn\u2019t look like mathematics. So, the converter now makes the first expression that follows the <em>n<\/em>-ary operator and limits into the <em>n<\/em>-aryand. For example, the integral<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-content\/uploads\/sites\/65\/2021\/02\/integral-e1613425332545.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-208\" src=\"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-content\/uploads\/sites\/65\/2021\/02\/integral-300x69.jpg\" alt=\"Image integral\" width=\"300\" height=\"69\" \/><\/a><\/p>\n<p>can be given by the UnicodeMath 1\/2\u03c0 \u222b_0^2\u03c0 \u2146\u03b8\/(a+b sin \u03b8)=1\/\u221a(a^2-b^2) since the first expression that follows the \u222b_0^2\u03c0 is the fraction \u2146\u03b8\/(a+b sin \u03b8). This works for many integrands. More complicated integrands are usually enclosed in brackets, braces, or parentheses.<\/p>\n<h3>Matrix improvements<\/h3>\n<p>A \u201cbare\u201d matrix, that is, one with no enclosing brackets can be entered by typing the TeX control word \\matrix. In addition, there are five matrix constructs with enclosing brackets that can be entered as summarized in the following table in which \u2026 stands for the matrix contents.<\/p>\n<table class=\" aligncenter\">\n<tbody>\n<tr>\n<td><strong>LaTeX<\/strong><\/td>\n<td><strong>Char<\/strong><\/td>\n<td><strong>Code<\/strong><\/td>\n<td><strong>Form<\/strong><\/td>\n<\/tr>\n<tr>\n<td>\\matrix<\/td>\n<td>\u25a0<\/td>\n<td>U+25A0<\/td>\n<td>\u2026<\/td>\n<\/tr>\n<tr>\n<td>\\bmatrix<\/td>\n<td>\u24e2<\/td>\n<td>U+24E2<\/td>\n<td>[\u2026]<\/td>\n<\/tr>\n<tr>\n<td>\\pmatrix<\/td>\n<td>\u24a8<\/td>\n<td>U+24A8<\/td>\n<td>(\u2026)<\/td>\n<\/tr>\n<tr>\n<td>\\vmatrix<\/td>\n<td>\u24b1<\/td>\n<td>U+24B1<\/td>\n<td>|\u2026|<\/td>\n<\/tr>\n<tr>\n<td>\\Bmatrix<\/td>\n<td>\u24c8<\/td>\n<td>U+24C8<\/td>\n<td>{\u2026}<\/td>\n<\/tr>\n<tr>\n<td>\\Vmatrix<\/td>\n<td>\u24a9<\/td>\n<td>U+24A9<\/td>\n<td>\u2016\u2026\u2016<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The UnicodeMath syntax for a parenthesized 2\u00d72 matrix is \\pmatrix(a&amp;b@c&amp;d), which builds up as<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-content\/uploads\/sites\/65\/2021\/02\/Matrixabcd.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-219\" src=\"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-content\/uploads\/sites\/65\/2021\/02\/Matrixabcd-e1613426197290.png\" alt=\"Image Matrixabcd\" width=\"80\" height=\"58\" \/><\/a><\/p>\n<p>Sometimes you just want to enter a sample matrix quickly. If any of the six matrix control words are followed by a digit <em>d<\/em>, they insert a <em>d <\/em>\u00d7 <em>d<\/em> identity matrix. For example, typing \\pmatrix 3 enters<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-content\/uploads\/sites\/65\/2021\/02\/matrix3x3identity-e1613426376513.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-221\" src=\"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-content\/uploads\/sites\/65\/2021\/02\/matrix3x3identity-e1613426376513.png\" alt=\"Image matrix3x3identity\" width=\"100\" height=\"70\" \/><\/a><\/p>\n<p>This is easier to type than \\pmatrix(1&amp;0&amp;0@0&amp;1&amp;0@0&amp;0&amp;1), which displays the same identity matrix. Some of the matrix control words are missing in the default math autocorrect file. You can add them as described in the last section of this post.<\/p>\n<h2>sin \ud835\udc65\u00b2<\/h2>\n<p>This trigonometric expression is ambiguous: is it sin(\ud835\udc65\u00b2) or (sin \ud835\udc65)\u00b2? Without the parentheses, the UnicodeMath for the former is \u201csin x^2\u201d and for the latter is \u201csin x ^2\u201d. In the latter, the space following the x builds up the sin x into a math function object and then the ^2 squares the object. But the results are very different formulas. The converter avoids the ambiguity by building up \u201csin\u00a0x\u00a0^2\u201d to be the same math function object as \u201csin^2 x\u201d, that is, sin\u00b2 \ud835\udc65.<\/p>\n<h3>Some LaTex in UnicodeMath mode<\/h3>\n<p>You can enter the common LaTeX expressions \\frac{a}{b} and \\binom{n}{m} in UnicodeMath input mode provided you have added math autocorrect entries to convert \\frac to \u2341 (U+2341) and \\binom to \u249d (U+249D). To add math autocorrect entries, click on the lower-right box in the Equations\/Conversions ribbon option to display the dialog box<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-content\/uploads\/sites\/65\/2021\/02\/EquationOptions.png\"><img decoding=\"async\" class=\"wp-image-213 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-content\/uploads\/sites\/65\/2021\/02\/EquationOptions-157x300.png\" alt=\"Image EquationOptions\" width=\"276\" height=\"527\" srcset=\"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-content\/uploads\/sites\/65\/2021\/02\/EquationOptions-157x300.png 157w, https:\/\/devblogs.microsoft.com\/math-in-office\/wp-content\/uploads\/sites\/65\/2021\/02\/EquationOptions.png 251w\" sizes=\"(max-width: 276px) 100vw, 276px\" \/><\/a><\/p>\n<p>Then click on the Math AutoCorrect\u2026 button to see and add math autocorrect entries. For example, to add \\frac with U+2341, type as in the dialog box<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-content\/uploads\/sites\/65\/2021\/02\/MathAutoCorrect-e1613425997958.png\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-216\" src=\"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-content\/uploads\/sites\/65\/2021\/02\/MathAutoCorrect-300x154.png\" alt=\"Image MathAutoCorrect\" width=\"300\" height=\"154\" \/><\/a><\/p>\n<p>And then enter Alt+x to convert the 2341 to \u2341. Probably when you type LaTeX in UnicodeMath input mode, a dialog ought to appear asking you if you\u2019d like to switch to LaTeX input mode.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the years since UnicodeMath 3.1 was published, some improvements have been made. The converter that converts UnicodeMath to OfficeMath also converts LaTeX and Nemeth math braille to OfficeMath. The converter needs ways to provide OfficeMath math-object arguments even when these arguments are not marked as such in the math format. The resulting infrastructure is [&hellip;]<\/p>\n","protected":false},"author":40611,"featured_media":55,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-205","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-math-in-office"],"acf":[],"blog_post_summary":"<p>In the years since UnicodeMath 3.1 was published, some improvements have been made. The converter that converts UnicodeMath to OfficeMath also converts LaTeX and Nemeth math braille to OfficeMath. The converter needs ways to provide OfficeMath math-object arguments even when these arguments are not marked as such in the math format. The resulting infrastructure is [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/posts\/205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/users\/40611"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/comments?post=205"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/posts\/205\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/media\/55"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/media?parent=205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/categories?post=205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/math-in-office\/wp-json\/wp\/v2\/tags?post=205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}