Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fix \stackrel argument order in MathML #10

Merged
merged 2 commits into from over 2 years ago

2 participants

Norbert Pozar John MacFarlane
Norbert Pozar
rekka commented

The latex macro \stackrel shows the first argument above the second one, as a description. For instance

\stackrel{w}{\to}

should display as

w
→

However, the output was incorrect in MathML (since the order must be reversed: <mover> base overscript </mover>). This patch fixes the order and adds a test.

Unfortunately, I cannot check the OMML output, so that one might still need patching.

John MacFarlane jgm merged commit 0cfc25d into from
John MacFarlane jgm closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Apr 12, 2012
Norbert Pozar rekka add stackrel tests 6914338
Norbert Pozar rekka reverse stackrel arguments in MathML output b40dad9
This page is out of date. Refresh to see the latest.
2  Text/TeXMath/MathML.hs
@@ -83,7 +83,7 @@ binaryOps = M.fromList
83 83 , ("\\dfrac", withAttribute "displaystyle" "true" .
84 84 unode "mstyle" . unode "mfrac")
85 85 , ("\\sqrt", unode "mroot")
86   - , ("\\stackrel", unode "mover")
  86 + , ("\\stackrel", unode "mover" . reverse)
87 87 , ("\\overset", unode "mover")
88 88 , ("\\underset", unode "munder")
89 89 , ("\\binom", showBinom)
40 tests/stackrel.omml
... ... @@ -0,0 +1,40 @@
  1 +<?xml version='1.0' ?>
  2 +<m:oMathPara>
  3 + <m:oMathParaPr>
  4 + <m:jc m:val="center" />
  5 + </m:oMathParaPr>
  6 + <m:oMath>
  7 + <m:sSub>
  8 + <m:e>
  9 + <m:r>
  10 + <m:rPr />
  11 + <m:t>u</m:t>
  12 + </m:r>
  13 + </m:e>
  14 + <m:sub>
  15 + <m:r>
  16 + <m:rPr />
  17 + <m:t>n</m:t>
  18 + </m:r>
  19 + </m:sub>
  20 + </m:sSub>
  21 + <m:limUpp>
  22 + <m:e>
  23 + <m:r>
  24 + <m:rPr />
  25 + <m:t>w</m:t>
  26 + </m:r>
  27 + </m:e>
  28 + <m:lim>
  29 + <m:r>
  30 + <m:rPr />
  31 + <m:t>→</m:t>
  32 + </m:r>
  33 + </m:lim>
  34 + </m:limUpp>
  35 + <m:r>
  36 + <m:rPr />
  37 + <m:t>u</m:t>
  38 + </m:r>
  39 + </m:oMath>
  40 +</m:oMathPara>
2  tests/stackrel.tex
... ... @@ -0,0 +1,2 @@
  1 +u_n \stackrel{w}{\to} u
  2 +
21 tests/stackrel.xhtml
... ... @@ -0,0 +1,21 @@
  1 +<?xml version='1.0' ?>
  2 +<html xmlns="http://www.w3.org/1999/xhtml">
  3 + <head>
  4 + <meta content="application/xhtml+xml; charset=UTF-8" http-equiv="Content-Type" />
  5 + </head>
  6 + <body>
  7 + <math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
  8 + <mrow>
  9 + <msub>
  10 + <mi>u</mi>
  11 + <mi>n</mi>
  12 + </msub>
  13 + <mover>
  14 + <mo>→</mo>
  15 + <mi>w</mi>
  16 + </mover>
  17 + <mi>u</mi>
  18 + </mrow>
  19 + </math>
  20 + </body>
  21 +</html>
3  texmath.cabal
@@ -60,7 +60,8 @@ Data-Files: cgi/texmath.xhtml,
60 60 tests/unicode.tex, tests/unicode.xhtml, tests/unicode.omml,
61 61 tests/ensuremath.tex, tests/ensuremath.xhtml, tests/ensuremath.omml,
62 62 tests/macros.tex, tests/macros.xhtml, tests/macros.omml,
63   - tests/subsup.tex, tests/subsup.xhtml, tests/subsup.omml
  63 + tests/subsup.tex, tests/subsup.xhtml, tests/subsup.omml,
  64 + tests/stackrel.tex, tests/stackrel.xhtml, tests/stackrel.omml
64 65
65 66 Source-repository head
66 67 type: git

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.