public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Kevin Vilbig <kvilbig-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: MathML to LaTeX producing extremely lossy output, especially with quotients
Date: Tue, 1 Nov 2016 13:38:00 -0700 (PDT)	[thread overview]
Message-ID: <48401935-a82d-44e6-afa5-810c580f9edf@googlegroups.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 11678 bytes --]

I am attempting to translate some MathML snipped from .docx files in 
Microsoft Word to LaTeX in order to make accessible materials for some 
visually impaired students. I was hoping to do it this way so that we could 
provide them with both a screen-readable HTML file AND a Nemeth Braille 
Transcription so as to give them multiple forms of presentation to avoid 
any issues with inaccurate translation or our mistakes.

I'm going to give up on this route and try something else, maybe trying to 
translate the whole docx file directly, or copying the MathType output 
straight to LaTeX.

$ pandoc --mathjax -f html -t latex exam2.htm
Powers of X Rule\\
if f( x )= x n then f ′ ( x )=n ( x ) n−1\\
Constant Rule\\
if f( x )=C then f ′ ( x )=0\\
Coefficient Rules\\
if f(x)=c•u(x) then f ′ ( x )=c• u ′ ( x )\\
if f(x)=k x n then f ′ (x)=kn x n−1\\
if f(x)=kx then f ′ (x)=k\\
Sum Rule\\
if f( x )=u( x )+v( x ) then f ′ ( x )= u ′ ( x )+ v ′ ( x )\\
Difference Rule\\
if f( x )=u( x )−v( x ) then f ′ ( x )= u ′ ( x )− v ′ ( x )\\
Product Rule\\
if f( x )=u( x )•v( x ) then f ′ ( x )=u( x )• v ′ ( x )+v( x )• u ′ ( x
)\\
Quotient Rule\\
if f( x )= u( x ) v( x ) then f ′ ( x )= v( x )• u ′ ( x )−u( x )• v ′ (
x ) ( v( x ) ) 2\\
Chain Rule or Power Rule\\
if f( x )= ( u( x ) ) n then f ′ ( x )=n ( u( x ) ) n−1 • u ′ ( x )\\
Logarithms\\
ln(MN)=lnM+lnN\\
ln( M N )=lnM−lnN\\
ln( M N )=NlnM\\
Derivative of Natural Log\\
if y = ln(x) then y ′ = 1 x\\
if y = ln u(x) then y ′ = 1 u(x) • u ′ (x)\\
Derivative of Exponential Function\\
if y= e x then y ′ = e x\\
if y= e u(x) then y ′ = e u(x) • u ′ (x)\\[2\baselineskip]


Here is the contents of exam2.htm

<html>Powers of X Rule<br>
if <math display='inline'>
 <mrow>
  <mi>f</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><msup>
   <mi>x</mi>
   <mi>n</mi>
  </msup>
  
 </mrow>
</math> then <math display='inline'>
 <mrow>
  <msup>
   <mi>f</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><mi>n</mi><msup>
   <mrow>
    <mrow><mo>(</mo>
     <mi>x</mi>
    <mo>)</mo></mrow>
   </mrow>
   <mrow>
    <mi>n</mi><mo>&#x2212;</mo><mn>1</mn>
   </mrow>
  </msup>
  
 </mrow>
</math>
<br>
Constant Rule<br>
if <math display='inline'>
 <mrow>
  <mi>f</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><mi>C</mi>
 </mrow>
</math> then <math display='inline'>
 <mrow>
  <msup>
   <mi>f</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><mn>0</mn>
 </mrow>
</math>
<br>
Coefficient Rules<br>
if <math display='inline'>
 <mrow>
  <mi>f</mi><mo stretchy='false'>(</mo><mi>x</mi><mo 
stretchy='false'>)</mo><mo>=</mo><mi>c</mi><mo>&#x2022;</mo><mi>u</mi><mo 
stretchy='false'>(</mo><mi>x</mi><mo stretchy='false'>)</mo>
 </mrow>
</math> then <math display='inline'>
 <mrow>
  <msup>
   <mi>f</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><mi>c</mi><mo>&#x2022;</mo><msup>
   <mi>u</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow>
 </mrow>
</math>
<br>if<math display='inline'>
 <mrow>
  <mi>f</mi><mo stretchy='false'>(</mo><mi>x</mi><mo 
stretchy='false'>)</mo><mo>=</mo><mi>k</mi><msup>
   <mi>x</mi>
   <mi>n</mi>
  </msup>
  
 </mrow>
</math>
then<math display='inline'>
 <mrow>
  <msup>
   <mi>f</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mo stretchy='false'>(</mo><mi>x</mi><mo 
stretchy='false'>)</mo><mo>=</mo><mi>k</mi><mi>n</mi><msup>
   <mi>x</mi>
   <mrow>
    <mi>n</mi><mo>&#x2212;</mo><mn>1</mn>
   </mrow>
  </msup>
  
 </mrow>
</math>
<br>if<math display='inline'>
 <mrow>
  <mi>f</mi><mo stretchy='false'>(</mo><mi>x</mi><mo 
stretchy='false'>)</mo><mo>=</mo><mi>k</mi><mi>x</mi>
 </mrow>
</math> then <math display='inline'>
 <mrow>
  <msup>
   <mi>f</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mo stretchy='false'>(</mo><mi>x</mi><mo 
stretchy='false'>)</mo><mo>=</mo><mi>k</mi>
 </mrow>
</math><br>



Sum Rule<br>
if<math display='inline'>
 <mrow>
  <mi>f</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><mi>u</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>+</mo><mi>v</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow>
 </mrow>
</math>
then<math display='inline'>
 <mrow>
  <msup>
   <mi>f</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><msup>
   <mi>u</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>+</mo><msup>
   <mi>v</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow>
 </mrow>
</math>
<br>


Difference Rule<br>
if<math display='inline'>
 <mrow>
  <mi>f</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><mi>u</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>&#x2212;</mo><mi>v</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow>
 </mrow>
</math>
then<math display='inline'>
 <mrow>
  <msup>
   <mi>f</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><msup>
   <mi>u</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>&#x2212;</mo><msup>
   <mi>v</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow>
 </mrow>
</math>
<br>
Product Rule<br>
if<math display='inline'>
 <mrow>
  <mi>f</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><mi>u</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>&#x2022;</mo><mi>v</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow>
 </mrow>
</math>
then<math display='inline'>
 <mrow>
  <msup>
   <mi>f</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><mi>u</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>&#x2022;</mo><msup>
   <mi>v</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>+</mo><mi>v</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>&#x2022;</mo><msup>
   <mi>u</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow>
 </mrow>
</math>
<br>
Quotient Rule<br>
if<math display='inline'>
 <mrow>
  <mi>f</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><mfrac>
   <mrow>
    <mi>u</mi><mrow><mo>(</mo>
     <mi>x</mi>
    <mo>)</mo></mrow>
   </mrow>
   <mrow>
    <mi>v</mi><mrow><mo>(</mo>
     <mi>x</mi>
    <mo>)</mo></mrow>
   </mrow>
  </mfrac>
  
 </mrow>
</math>
then<math display='inline'>
 <mrow>
  <msup>
   <mi>f</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><mfrac>
   <mrow>
    <mi>v</mi><mrow><mo>(</mo>
     <mi>x</mi>
    <mo>)</mo></mrow><mo>&#x2022;</mo><msup>
     <mi>u</mi>
     <mo>&#x2032;</mo>
    </msup>
    <mrow><mo>(</mo>
     <mi>x</mi>
    <mo>)</mo></mrow><mo>&#x2212;</mo><mi>u</mi><mrow><mo>(</mo>
     <mi>x</mi>
    <mo>)</mo></mrow><mo>&#x2022;</mo><msup>
     <mi>v</mi>
     <mo>&#x2032;</mo>
    </msup>
    <mrow><mo>(</mo>
     <mi>x</mi>
    <mo>)</mo></mrow>
   </mrow>
   <mrow>
    <msup>
     <mrow>
      <mrow><mo>(</mo>
       <mrow>
        <mi>v</mi><mrow><mo>(</mo>
         <mi>x</mi>
        <mo>)</mo></mrow>
       </mrow>
      <mo>)</mo></mrow>
     </mrow>
     <mn>2</mn>
    </msup>
    
   </mrow>
  </mfrac>
  
 </mrow>
</math>
<br>
Chain Rule or Power Rule<br>
if<math display='inline'>
 <mrow>
  <mi>f</mi><mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><msup>
   <mrow>
    <mrow><mo>(</mo>
     <mrow>
      <mi>u</mi><mrow><mo>(</mo>
       <mi>x</mi>
      <mo>)</mo></mrow>
     </mrow>
    <mo>)</mo></mrow>
   </mrow>
   <mi>n</mi>
  </msup>
  
 </mrow>
</math>
then<math display='inline'>
 <mrow>
  <msup>
   <mi>f</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow><mo>=</mo><mi>n</mi><msup>
   <mrow>
    <mrow><mo>(</mo>
     <mrow>
      <mi>u</mi><mrow><mo>(</mo>
       <mi>x</mi>
      <mo>)</mo></mrow>
     </mrow>
    <mo>)</mo></mrow>
   </mrow>
   <mrow>
    <mi>n</mi><mo>&#x2212;</mo><mn>1</mn>
   </mrow>
  </msup>
  <mo>&#x2022;</mo><msup>
   <mi>u</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mrow><mo>(</mo>
   <mi>x</mi>
  <mo>)</mo></mrow>
 </mrow>
</math>
<br>
Logarithms<br>
<math display='inline'>
 <mi>ln</mi><mo stretchy='false'>(</mo><mi>M</mi><mi>N</mi><mo 
stretchy='false'>)</mo><mo>=</mo><mi>ln</mi><mi>M</mi><mo>+</mo><mi>ln</mi><mi>N</mi>
</math>
<br>
<math display='inline'>
 <mi>ln</mi><mrow><mo>(</mo>
  <mrow>
   <mfrac>
    <mi>M</mi>
    <mi>N</mi>
   </mfrac>
   
  </mrow>
 <mo>)</mo></mrow><mo>=</mo><mi>ln</mi><mi>M</mi><mo>&#x2212;</mo><mi>ln</mi><mi>N</mi>
</math>
<br>
<math display='inline'>
 <mi>ln</mi><mrow><mo>(</mo>
  <mrow>
   <msup>
    <mi>M</mi>
    <mi>N</mi>
   </msup>
   
  </mrow>
 <mo>)</mo></mrow><mo>=</mo><mi>N</mi><mi>ln</mi><mi>M</mi>
</math>

<br>
Derivative of Natural Log<br>
if y = ln(x) then <math display='inline'>
 <mrow>
  <msup>
   <mi>y</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mo>=</mo><mfrac>
   <mn>1</mn>
   <mi>x</mi>
  </mfrac>
  
 </mrow>
</math>
<br>
if y = ln u(x) then<math display='inline'>
 <mrow>
  <msup>
   <mi>y</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mo>=</mo><mfrac>
   <mn>1</mn>
   <mrow>
    <mi>u</mi><mo stretchy='false'>(</mo><mi>x</mi><mo 
stretchy='false'>)</mo>
   </mrow>
  </mfrac>
  <mo>&#x2022;</mo><msup>
   <mi>u</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mo stretchy='false'>(</mo><mi>x</mi><mo stretchy='false'>)</mo>
 </mrow>
</math>
<br>

Derivative of Exponential Function<br>
if <math display='inline'>
 <mrow>
  <mi>y</mi><mo>=</mo><msup>
   <mi>e</mi>
   <mi>x</mi>
  </msup>
  
 </mrow>
</math>
then <math display='inline'>
 <mrow>
  <msup>
   <mi>y</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mo>=</mo><msup>
   <mi>e</mi>
   <mi>x</mi>
  </msup>
  
 </mrow>
</math>
<br>
if <math display='inline'>
 <mrow>
  <mi>y</mi><mo>=</mo><msup>
   <mi>e</mi>
   <mrow>
    <mi>u</mi><mo stretchy='false'>(</mo><mi>x</mi><mo 
stretchy='false'>)</mo>
   </mrow>
  </msup>
  
 </mrow>
</math>
then <math display='inline'>
 <mrow>
  <msup>
   <mi>y</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mo>=</mo><msup>
   <mi>e</mi>
   <mrow>
    <mi>u</mi><mo stretchy='false'>(</mo><mi>x</mi><mo 
stretchy='false'>)</mo>
   </mrow>
  </msup>
  <mo>&#x2022;</mo><msup>
   <mi>u</mi>
   <mo>&#x2032;</mo>
  </msup>
  <mo stretchy='false'>(</mo><mi>x</mi><mo stretchy='false'>)</mo>
 </mrow>
</math>
<br>
<br>
</html>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/48401935-a82d-44e6-afa5-810c580f9edf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 20766 bytes --]

             reply	other threads:[~2016-11-01 20:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-01 20:38 Kevin Vilbig [this message]
     [not found] ` <48401935-a82d-44e6-afa5-810c580f9edf-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2016-11-01 22:15   ` John MacFarlane
2016-11-02 13:36   ` John MacFarlane
     [not found]     ` <20161102133632.GA5983-BKjuZOBx5Kn2N3qrpRCZGbhGAdq7xJNKhPhL2mjWHbk@public.gmane.org>
2016-11-16 19:47       ` Kevin Vilbig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48401935-a82d-44e6-afa5-810c580f9edf@googlegroups.com \
    --to=kvilbig-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).