ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Interpreting MathJax HTML in MKIV
@ 2011-10-13 17:49 Mojca Miklavec
  2011-10-13 19:44 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Mojca Miklavec @ 2011-10-13 17:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 815 bytes --]

Hello,

I would like to manually create some HTML which would be displayed
nicely in both HTML and PDF (using MKIV for conversion from HTML). To
a certain degree I'm able to fake mathematics with

<span class="math"><span class="letter">ax</span><sup>2</sup> + <span
class="letter">bx</span> + <span class="letter">c</span> = 0</span>

where <span class="math"> signals TeX to use \mathematics{...} and
<span class="letter"> signals web browser that the letter has to be
displayed in italic (I could use class="math", but this would also
make numbers italic).

But this is very cumbersome to write. MathJax offers an excellent way
to enter math formulas in an easy way (see attached HTML), but I'm not
sure how I could convince the XML parser to treat contents literally.
Any ideas?

Thank you very much,
    Mojca

[-- Attachment #2: sample-tex.html --]
[-- Type: text/html, Size: 682 bytes --]

[-- Attachment #3: sample-conversion.tex --]
[-- Type: application/x-tex, Size: 680 bytes --]

[-- Attachment #4: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Interpreting MathJax HTML in MKIV
  2011-10-13 17:49 Interpreting MathJax HTML in MKIV Mojca Miklavec
@ 2011-10-13 19:44 ` Hans Hagen
  2011-10-13 19:52   ` Mojca Miklavec
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2011-10-13 19:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mojca Miklavec

On 13-10-2011 19:49, Mojca Miklavec wrote:
> Hello,
>
> I would like to manually create some HTML which would be displayed
> nicely in both HTML and PDF (using MKIV for conversion from HTML). To
> a certain degree I'm able to fake mathematics with
>
> <span class="math"><span class="letter">ax</span><sup>2</sup>  +<span
> class="letter">bx</span>  +<span class="letter">c</span>  = 0</span>
>
> where<span class="math">  signals TeX to use \mathematics{...} and
> <span class="letter">  signals web browser that the letter has to be
> displayed in italic (I could use class="math", but this would also
> make numbers italic).
>
> But this is very cumbersome to write. MathJax offers an excellent way
> to enter math formulas in an easy way (see attached HTML), but I'm not
> sure how I could convince the XML parser to treat contents literally.
> Any ideas?

$\xmlflushcontext{#1}$

another option is to use asciimath which is supported by the mathml 
module as annotation type

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Interpreting MathJax HTML in MKIV
  2011-10-13 19:44 ` Hans Hagen
@ 2011-10-13 19:52   ` Mojca Miklavec
  0 siblings, 0 replies; 3+ messages in thread
From: Mojca Miklavec @ 2011-10-13 19:52 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

On Thu, Oct 13, 2011 at 21:44, Hans Hagen wrote:
> On 13-10-2011 19:49, Mojca Miklavec wrote:
>>
>> Hello,
>>
>> I would like to manually create some HTML which would be displayed
>> nicely in both HTML and PDF (using MKIV for conversion from HTML). To
>> a certain degree I'm able to fake mathematics with
>>
>> <span class="math"><span class="letter">ax</span><sup>2</sup>  +<span
>> class="letter">bx</span>  +<span class="letter">c</span>  = 0</span>
>>
>> where<span class="math">  signals TeX to use \mathematics{...} and
>> <span class="letter">  signals web browser that the letter has to be
>> displayed in italic (I could use class="math", but this would also
>> make numbers italic).
>>
>> But this is very cumbersome to write. MathJax offers an excellent way
>> to enter math formulas in an easy way (see attached HTML), but I'm not
>> sure how I could convince the XML parser to treat contents literally.
>> Any ideas?
>
> $\xmlflushcontext{#1}$

But how do I "catch" the expression that has to be interpreted that
way? (I sent an attachment as example.)

Mojca
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2011-10-13 19:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-13 17:49 Interpreting MathJax HTML in MKIV Mojca Miklavec
2011-10-13 19:44 ` Hans Hagen
2011-10-13 19:52   ` Mojca Miklavec

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