tex4ht + jsMath

22 views
Skip to first unread message

tlhiv

unread,
May 1, 2008, 2:38:59 AM5/1/08
to
I am wondering why a mathematical expression as simple as

$\displaystyle\int_a^x f(t) dt$

is translated by

htlatex foo.ltx "xhtml,jsmath" " -cmozhtf"

into the following jsMath

<span class="math">
{\mathop{\mathop{\mathop{&#x222B;}\nolimits }}
\nolimits }_{a}^{x}f(t)dt
</span>

Why isn't it translated to something that looks like

<span class="math">
\displaystyle\int_{a}^{x}f(t)dt
</span>

Specifically, I want to get a displaystyle (large) integral symbol
out.

Troy Henderson

Robert Marik

unread,
May 1, 2008, 8:12:58 AM5/1/08
to
Hi Troy,

I use the following definition

\def\int{\HCode{\string\int }\HCode{ }}

But the problem with this solution is, if I want to convert a piece of
text into a picture (large diagram with integrals, for example). I this
case I have to restore the original definition of \int.

I suppose that there is also a cleaner solution.

Robert Marik

tlhiv

unread,
May 1, 2008, 8:30:15 AM5/1/08
to
Robert,

This works *fairly* well. Thanks! I'll use this unless someone else
posts a *better* solution.

Troy

Eitan M Gurari

unread,
May 2, 2008, 6:29:10 AM5/2/08
to

>\def\int{\HCode{\string\int }\HCode{ }}
>
>But the problem with this solution is, if I want to convert a piece of
>text into a picture (large diagram with integrals, for example). I this
>case I have to restore the original definition of \int.

The following variant will resort the \int to its native latex
definition within environments that translate to images.

\def\temp{\HCode{\string\int }\HCode{ }}
\HLet\int=\temp

>> $\displaystyle\int_a^x f(t) dt$
>>
>> is translated by
>>
>> htlatex foo.ltx "xhtml,jsmath" " -cmozhtf"
>>
>> into the following jsMath
>>
>> <span class="math">
>> {\mathop{\mathop{\mathop{&#x222B;}\nolimits }}
>> \nolimits }_{a}^{x}f(t)dt
>> </span>
>>
>> Why isn't it translated to something that looks like
>>
>> <span class="math">
>> \displaystyle\int_{a}^{x}f(t)dt
>> </span>
>>
>> Specifically, I want to get a displaystyle (large) integral symbol
>> out.

It might be possible to catch \displaystyle symbol-wise, through new
fonts dedicated for jsmath, to get an output similar to

<span class="math">
{\displaystyle\int}_{a}^{x}f(t)dt
</span>

A global support for styles (e.g., $\int_a \displaystyle\int_a$) will
be more difficult to achieve.

The unicode representation ensures wide representations to symbols not
supported directly by jsmath. I'll need to take a look at upgrading
into latex representations cases like \int that are currently
supported by jsmath.

-eitan


Reply all
Reply to author
Forward
0 new messages