public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* For .md to .html conversion with MathML, \mathbf and \mathrm are translated into mi instead of mo ?
@ 2019-05-26 14:56 J
       [not found] ` <dec7801e-f652-4bae-b2f6-186797c90cd4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: J @ 2019-05-26 14:56 UTC (permalink / raw)
  To: pandoc-discuss


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

The following minimum .md is used as an example
$A_1^2$ 

$\mathbf{A_1^2}$ 

$\mathrm{A_1^2}$ 


For .md to .pdf with LaTeX, the following command is used
pandoc ${mdname} --mathml --filter=pandoc-crossref --filter=pandoc-citeproc 
-s -o ${pdf_name} --pdf-engine=xelatex
. Note that the equations with \mathbf and \mathrm will be displayed as 
non-italic.

For .md to .html conversion with the --MathML option enabled, the following 
command is used
pandoc ${mdname} --mathml --filter=pandoc-crossref --filter=pandoc-citeproc 
-s -o ${html_name} -t html5
. Note that \mathbf and \mathrm are translated into mi tags instead of mo 
tags. As a result, the equation with \mathrm will be displaced italic, for 
example, when converted to .pdf through prince. Is this an unexpected bug ? 
If so, can it be corrected ?

Many thanks for your helpful efforts !

-- 
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/dec7801e-f652-4bae-b2f6-186797c90cd4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

[-- Attachment #2: MWE.md --]
[-- Type: text/markdown, Size: 47 bytes --]

$A_1^2$ 

$\mathbf{A_1^2}$ 

$\mathrm{A_1^2}$ 

[-- Attachment #3: MWE.pdf --]
[-- Type: application/pdf, Size: 5171 bytes --]

[-- Attachment #4: MWE.html --]
[-- Type: text/html, Size: 1489 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: For .md to .html conversion with MathML, \mathbf and \mathrm are translated into mi instead of mo ?
       [not found] ` <dec7801e-f652-4bae-b2f6-186797c90cd4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-05-27 19:04   ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2019-05-27 19:04 UTC (permalink / raw)
  To: J, pandoc-discuss


texmath translates \mathrm{x} internally into

EStyled TextNormal [EIdentifier "x"]

When rendering as MathML, texmath renders this as

  <mstyle mathvariant="normal">
    <mi>x</mi>
  </mstyle>

The "normal" variant is supposed to be non-italic
(since there's another variant "italic", but "roman"
isn't a defined variant, see
https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mi.)

Sounds to me as if this may be a bug in prince?

(Btw, if you want A to be treated as an operator, which
is what mo means, try \mathop{A}_1^2.)


J <lixichen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> The following minimum .md is used as an example
> $A_1^2$ 
>
> $\mathbf{A_1^2}$ 
>
> $\mathrm{A_1^2}$ 
>
>
> For .md to .pdf with LaTeX, the following command is used
> pandoc ${mdname} --mathml --filter=pandoc-crossref --filter=pandoc-citeproc 
> -s -o ${pdf_name} --pdf-engine=xelatex
> . Note that the equations with \mathbf and \mathrm will be displayed as 
> non-italic.
>
> For .md to .html conversion with the --MathML option enabled, the following 
> command is used
> pandoc ${mdname} --mathml --filter=pandoc-crossref --filter=pandoc-citeproc 
> -s -o ${html_name} -t html5
> . Note that \mathbf and \mathrm are translated into mi tags instead of mo 
> tags. As a result, the equation with \mathrm will be displaced italic, for 
> example, when converted to .pdf through prince. Is this an unexpected bug ? 
> If so, can it be corrected ?
>
> Many thanks for your helpful efforts !
>
> -- 
> 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/dec7801e-f652-4bae-b2f6-186797c90cd4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> $A_1^2$ 
>
> $\mathbf{A_1^2}$ 
>
> $\mathrm{A_1^2}$ 
>
> MWE
>
> A12A_1^2
>
> 𝐀12\mathbf{A_1^2}
>
> A12\mathrm{A_1^2}

-- 
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/m24l5f67no.fsf%40johnmacfarlane.net.
For more options, visit https://groups.google.com/d/optout.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-27 19:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-26 14:56 For .md to .html conversion with MathML, \mathbf and \mathrm are translated into mi instead of mo ? J
     [not found] ` <dec7801e-f652-4bae-b2f6-186797c90cd4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-05-27 19:04   ` John MacFarlane

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).