ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* XML/HTML output of Math
@ 2019-08-07 23:06 Atsuhito Kohda
  2019-08-08  7:41 ` Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: Atsuhito Kohda @ 2019-08-07 23:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi all,
I used to compile a beamer file with LuaLaTeX to generate a PDF
for presentation then convert the beamer file to XHTML with LaTeXML
for Web page.
Recently I begin to use ConTeXt so I try to get a PDF for presentation
and also XML/HTML output from a single ConTeXt file.
I have a few questions about XML/HTML output of Math.

1. In case inline math mode with \displaystyle, we get wrong output
of "\int_a^b"; lower limit and upper limit are interchanged
and further "b" is a bit larger and an integral symbol is rather small.
(It looks "\displaystyle" is not effective, e.g see "\frac".)

In case display math mode, we get very weird output of "\int_a^b".
It is difficult to explain how weird it is but something like
an output of "b_{\int}^a". Please check an attatched sample.
We get the similar kind of weird output of "\sum_{n=0}^{\infty}".
Due to these, it is impossible to use XML/HTML output of ConTeXt
in real use.

2. \math{\Vmatrix{\vI, \vj, \vk; a_{1}, a_{2}, a_{3}; b_{1}, b_{2}, b_{3}}}
\vI, \vj, \vk are disappeared in xml/html output.  What happend?
BTW, if we put "a" (or any alphabet?) in fron of \vI, then
we get every elements (but of course we get unnecessary "a" also).
------------- bSample
\setupbackend[export=yes]
\definemathmatrix[vmatrix][matrix:bars]
                 [simplecommand=Vmatrix]
\define[1]\vsym{\text{\math{\bi #1}}}
\define\vI{\vsym{i}}
% \define\vi{\vsym{i}}
\define\vj{\vsym{j}}
\define\vk{\vsym{k}}
\starttext
A simple math. \m{y=\sin x}, \m{\displaystyle y=\frac{\log x}{x}},

\m{\mathbf{A+B=C}}, \m{\mathbb{R}}, \m{\mathfrak{A}}, \m{\mathcal{S}},

A bit complex math.
\m{\displaystyle\int_{a}^{b}x\sin x\,dx=-[x\cos x]_{a}^{b}+\int_{a}^{b}\cos
x\,dx}
\startformula
  \int_{a}^{b}x\sin x\,dx=-[x\cos x]_{a}^{b}+\int_{a}^{b}\cos x\,dx
\stopformula
\m{\displaystyle\sum_{n=0}^{\infty}\frac{x^n}{n!}}
\startformula
\sum_{n=0}^{\infty}\frac{x^n}{n!}
\stopformula
\math{\Vmatrix{\vI, \vj, \vk; a_{1}, a_{2}, a_{3}; b_{1}, b_{2}, b_{3}}}
\math{\Vmatrix{a\vI, \vj, \vk; a_{1}, a_{2}, a_{3}; b_{1}, b_{2}, b_{3}}}
\stoptext
------------- eSample

Thanks in advance.
Best regards,
Atsuhito Kohda

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

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: XML/HTML output of Math
  2019-08-07 23:06 XML/HTML output of Math Atsuhito Kohda
@ 2019-08-08  7:41 ` Taco Hoekwater
  2019-08-09  5:35   ` Atsuhito Kohda
  2019-08-09  9:01   ` Hans Hagen
  0 siblings, 2 replies; 6+ messages in thread
From: Taco Hoekwater @ 2019-08-08  7:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

> On 8 Aug 2019, at 01:06, Atsuhito Kohda <atsu10.kohda@gmail.com> wrote:
> 
> Hi all,
> I used to compile a beamer file with LuaLaTeX to generate a PDF
> for presentation then convert the beamer file to XHTML with LaTeXML
> for Web page.
> Recently I begin to use ConTeXt so I try to get a PDF for presentation
> and also XML/HTML output from a single ConTeXt file.
> I have a few questions about XML/HTML output of Math.
> 
> 1. In case inline math mode with \displaystyle, we get wrong output
> of "\int_a^b"; lower limit and upper limit are interchanged 
> and further "b" is a bit larger and an integral symbol is rather small.
> (It looks "\displaystyle" is not effective, e.g see "\frac”.)

I opened the xhtml with firefox and the only problem I see
is the ignored \displaystyle (which is why the integral looks small). 
Inline looks fine otherwise, no interchanging of limits.

Well, as fine as it can be in firefox, which is pretty bad.

> In case display math mode, we get very weird output of "\int_a^b”.

ConTeXt outputs b_a^\int in display mode; the order of the objects
inside the generated <msubsub> is wrong, which is clearly a bug.
And it seems to do this for all large operators.

> 
> 2. \math{\Vmatrix{\vI, \vj, \vk; a_{1}, a_{2}, a_{3}; b_{1}, b_{2}, b_{3}}}
> \vI, \vj, \vk are disappeared in xml/html output.  What happend?

I think this somehow triggered by the nested mode switch (\text{\math{}}) in the \vsym. 
If I change that definition to the more simple:

  \define[1]\vsym{{\textstyle\bi #1}}

it works ok. Whether that helps you ...

Best wishes,
Taco

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: XML/HTML output of Math
  2019-08-08  7:41 ` Taco Hoekwater
@ 2019-08-09  5:35   ` Atsuhito Kohda
  2019-08-09  7:47     ` Taco Hoekwater
  2019-08-09  9:01   ` Hans Hagen
  1 sibling, 1 reply; 6+ messages in thread
From: Atsuhito Kohda @ 2019-08-09  5:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Dear Taco, thanks for your reply.

> I opened the xhtml with firefox and the only problem I see
> is the ignored \displaystyle (which is why the integral looks small).
> Inline looks fine otherwise, no interchanging of limits.

Hmm, I use firefox 68.0.1 of Ubuntu 19.04 and firefox 60.8.0
of Debian/unstable.  I see the interchanging of limits with
both firefoxes.  BTW, it seems Chromium doesn't support MathML.
If any Linux users could test the xhtml with firefox (or any browsers)
I believe it would help us much.

> Well, as fine as it can be in firefox, which is pretty bad.

I'm not sure if I understand you correctly but I think MathJax
might be much better than MathML.

> ConTeXt outputs b_a^\int in display mode; the order of the objects
> inside the generated <msubsub> is wrong, which is clearly a bug.
> And it seems to do this for all large operators.

I see.

> I think this somehow triggered by the nested mode switch (\text{\math{}})
in the \vsym.
> If I change that definition to the more simple:

>   \define[1]\vsym{{\textstyle\bi #1}}

> it works ok. Whether that helps you ...

It helps me to some extent but with the original definition, we can
use \vI in both math mode (\math{\vI}) and text mode like "vector \vI".
So if ConTeXt could convert the nested mode switch correctly
it would be very nice.

Thanks for your info.
Best regards,
Atsuhito Kohda



>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

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

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: XML/HTML output of Math
  2019-08-09  5:35   ` Atsuhito Kohda
@ 2019-08-09  7:47     ` Taco Hoekwater
  2019-08-09 12:12       ` Atsuhito Kohda
  0 siblings, 1 reply; 6+ messages in thread
From: Taco Hoekwater @ 2019-08-09  7:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi,

> On 9 Aug 2019, at 07:35, Atsuhito Kohda <atsu10.kohda@gmail.com> wrote:
> 
> Dear Taco, thanks for your reply.
> 
> > I opened the xhtml with firefox and the only problem I see
> > is the ignored \displaystyle (which is why the integral looks small).
> > Inline looks fine otherwise, no interchanging of limits.
> 
> Hmm, I use firefox 68.0.1 of Ubuntu 19.04 and firefox 60.8.0
> of Debian/unstable.  I see the interchanging of limits with
> both firefoxes.  BTW, it seems Chromium doesn't support MathML.
> If any Linux users could test the xhtml with firefox (or any browsers)
> I believe it would help us much.

My firefox is 68.0.1 on MacOS. Small (ugly) screenshot attached.


[-- Attachment #1.2.1: Type: text/html, Size: 1275 bytes --]

[-- Attachment #1.2.2: Screenshot 2019-08-09 at 09.46.08.png --]
[-- Type: image/png, Size: 32026 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: XML/HTML output of Math
  2019-08-08  7:41 ` Taco Hoekwater
  2019-08-09  5:35   ` Atsuhito Kohda
@ 2019-08-09  9:01   ` Hans Hagen
  1 sibling, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2019-08-09  9:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 8/8/2019 9:41 AM, Taco Hoekwater wrote:

>> In case display math mode, we get very weird output of "\int_a^b”.
> 
> ConTeXt outputs b_a^\int in display mode; the order of the objects
> inside the generated <msubsub> is wrong, which is clearly a bug.
> And it seems to do this for all large operators.
i'll look into it

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: XML/HTML output of Math
  2019-08-09  7:47     ` Taco Hoekwater
@ 2019-08-09 12:12       ` Atsuhito Kohda
  0 siblings, 0 replies; 6+ messages in thread
From: Atsuhito Kohda @ 2019-08-09 12:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1.1: Type: text/plain, Size: 703 bytes --]

Hi all,

I will attach a screenshot of firefox on Ubuntu 10.04 but I'm not familiar
with Gmail so I'm uncertain if it goes well or not.

Thanks for your help.
Best regards,
Atsuhito Kohda

___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

[-- Attachment #1.1.2: Type: text/html, Size: 1647 bytes --]

[-- Attachment #1.2: Screenshot 2019-08-09 at 09.46.08.png --]
[-- Type: image/png, Size: 32026 bytes --]

[-- Attachment #2: sample.png --]
[-- Type: image/png, Size: 5002 bytes --]

[-- Attachment #3: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2019-08-09 12:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-07 23:06 XML/HTML output of Math Atsuhito Kohda
2019-08-08  7:41 ` Taco Hoekwater
2019-08-09  5:35   ` Atsuhito Kohda
2019-08-09  7:47     ` Taco Hoekwater
2019-08-09 12:12       ` Atsuhito Kohda
2019-08-09  9:01   ` Hans Hagen

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