[tex4ht] two additional issues converting latex to HTML with mathjax.

2018-09-10 Thread Nasser M. Abbasi



I've found two additional issues in using make4ht to
convert using mathjax. (Thanks for Michal for earlier 2 fixes,
they worked very well).

These can also probably be fixed using some magic code by Michal
which is over my understanding and ability to figure out myself.

1) \Aboxed from mathtools do not work in mathjax. This is not
critical, I could always change the program not to use this if
needed, but would be nice to have as \boxed does not work inside
align. Here is MWE

-
\documentclass[11pt]{article}
\usepackage{amsmath,mathtools,amssymb}
\usepackage{mathtools} %for Aboxed
\begin{document}

\begin{align*}
A & B\\
\Aboxed{y &= x}
\end{align*}
\end{document}
---

2) \DeclareMathOperator  do not seem to work. This is a big problem
since I have so many such declarations in the latex code (over 40) for
many special functions.

So If  I can learn how to make one work in the .cfg file so that mathjax
renders it OK, I'll add the rest myself. Here is an example of two
such cases:

--
\documentclass[11pt]{article}
\usepackage{amsmath,mathtools,amssymb}
\DeclareMathOperator{\RootOf}{RootOf}
\DeclareMathOperator{\Ei}{Ei}
\begin{document}
\[
y = {{\rm e}^{\RootOf \left( {x}^{2}+2\,\Ei \left( 1,-{\it \_Z} \right) \right) 
}}
\]
\end{document}
--

screen shot

https://www.12000.org/tmp/relax/screen_shot_3.png

It should come out like this

https://www.12000.org/tmp/relax/screen_shot_4.png

All these compiled using same command I showed before, which is

make4ht -ulm draft -c ./nma_mathjax.cfg foo.tex
"htm,0,charset=utf-8" " -cunihtf -utf8"

Where nma_mathjax.cfg is

-
\RequirePackage{mathjax-latex-4ht}
\Preamble{xhtml}
\begin{document}
\EndPreamble
---


Thanks for any help on these.

--Nasser


Re: [tex4ht] make4ht with mathjax and \setlength{\fboxsep} problem

2018-09-10 Thread Michal Hoftich
Hi Nasser,

On Mon, Sep 10, 2018 at 5:37 PM, Nasser M. Abbasi  wrote:
> Does make4ht support for mathjax include \setlength{\fboxsep}?
>
> This MWE does not render correctly using mathjax but it does
> when not using mathjax:


This is the same issue as in the previous mail. MathJax supports just
subset of LaTeX syntax, mainly math related. It needs to be configured
to support other commands. Try the following configuration:

\RequirePackage{mathjax-latex-4ht}
\Preamble{xhtml}
\begin{document}
\Configure{@HEAD}{\HCode{\unexpanded{ MathJax.Hub.Config({
TeX: {Macros : {  relax: "{}", setlength: ["{}", 2]}},
});}}}
\EndPreamble

I cannot find details about the Macros configuration in MathJax
documentation, but I am sure it is somewhere.

Best,
Michal


Re: [tex4ht] adding support for \relax to make4ht mathjax style?

2018-09-10 Thread Michal Hoftich
Hi Nasser,

> I found small problem.
>
> Auto generated latex code sometimes uses \relax, and this seems
> not to be supported by the mathjax make4ht style file.

this is a MathJax issue, tex4ht just passes the literal LaTeX math
input to the HTML and it is then up to MathJax how it proceeds it. In
this particular case, you can use the following config file to remove
the \relax command:

\RequirePackage{mathjax-latex-4ht}
\Preamble{xhtml}
\begin{document}
\Configure{@HEAD}{\HCode{\unexpanded{ MathJax.Hub.Config({
TeX: {Macros : {  relax: "{}", }},
});}}}
\EndPreamble

Best regards,
Michal


[tex4ht] make4ht with mathjax and \setlength{\fboxsep} problem

2018-09-10 Thread Nasser M. Abbasi

Does make4ht support for mathjax include \setlength{\fboxsep}?

This MWE does not render correctly using mathjax but it does
when not using mathjax:

--
\documentclass[11pt]{article}
\usepackage{amsmath,mathtools,amssymb}
\begin{document}

\[
\setlength{\fboxsep}{2.5\fboxsep}
  \boxed{y={\frac {2\,x-2\,\ln  \left( x \right) +C_{{1}}}{ \left( -1+x \right) 
^{2
\]
\end{document}
--

Compiled with

make4ht -ulm draft -c ./nma_mathjax.cfg foo.tex "htm,0,charset=utf-8" " -cunihtf 
-utf8"

Where nma_mathjax.cfg is

-
\RequirePackage{mathjax-latex-4ht}
\Preamble{xhtml}
\begin{document}
\EndPreamble
---

The HTML looks like this:

https://www.12000.org/tmp/relax/screen_shot_2.png

Using mathjax-latex-4ht.sty downloaded from

https://github.com/michal-h21/helpers4ht/blob/master/mathjax-latex-4ht.sty

When compiled using

make4ht -ulm draft foo.tex "htm,0,charset=utf-8" " -cunihtf -utf8"

Then it renders OK.

TL 2018
Thanks
--Nasser


[tex4ht] adding support for \relax to make4ht mathjax style?

2018-09-10 Thread Nasser M. Abbasi



I am trying to use make4ht with mathjax. As I find problems, will report them.

I found small problem.

Auto generated latex code sometimes uses \relax, and this seems
not to be supported by the mathjax make4ht style file.

Here is a MWE

\documentclass[11pt]{scrbook}%ext
\usepackage{amsmath,mathtools,amssymb}
\begin{document}

\begin{center}
$\begin{array}{c}
y \left( x \right) ={x}^{2}+x+3\\ \relax%
\end{array}$
\end{center}
  
\end{document}

--

Compiled with

make4ht -ulm draft -c ./nma_mathjax.cfg foo.tex "htm,0,charset=utf-8" " -cunihtf 
-utf8"

Where nma_mathjax.cfg is

-
\RequirePackage{mathjax-latex-4ht}
\Preamble{xhtml}
\begin{document}
\EndPreamble
---

The HTML looks like this:

https://www.12000.org/tmp/relax/screen_shot.png

Using mathjax-latex-4ht.sty downloaded from

https://github.com/michal-h21/helpers4ht/blob/master/mathjax-latex-4ht.sty

Thank you,
--Nasser


Re: [tex4ht] problem with new dvisvgm 2.6, all svg fies have horizontal lines with no math showing.

2018-09-10 Thread Martin Gieseking

Hi Nasser,

I just had a quick look at your files. None of your SVG files contain 
the required font/path data so that they can't be rendered correctly. 
Since I can't reproduce the issue here, your dvisvgm binary is probably 
broken. For example, if you linked against the wrong kpathsea library, 
the font files can't be found, which would explain the results. This 
happens if you installed the original TL (with tlmgr) but link dvisvgm 
against libkpathsea coming with Ubuntu that usually belongs to a 
different TL version and searches in a different directory tree.


TL doesn't provide packages of the header and static library files, so 
that the only possibility is probably to download the TL sources, update 
the dvisvgm code there and rebuild it.


Martin


Am 10.09.2018 um 07:37 schrieb Nasser M. Abbasi:

Hello;

Just finished compile of one large latex file.

This is the one I started yesterday. It took about 32 hrs.
(it seems slower this time than before).

But there is a big problem. This is using the new dvisvgm 2.6,
compiled from sources on Ubuntu with TL 2018.1. Had to use 2.6
due to size limitation of 2.5.

When I open any web page, all the math is just thin horizontal lines.
No actual math shows up. Here is screen shot

https://www.12000.org/tmp/091018/screen_shot.jpg

The SVG files are all generated. Hashing seems to work well,
as all the svg file names have the long hash name. But no math shows.
Tried on firefox and Chrome. Cleaned the cache, no help.

Could someone please have a look?

I put a zip file of the complete folder which contains
everything, and also dvi, idv. The main HTML is called index.htm,
in this folder:

https://www.12000.org/tmp/091018/

There seems to be something got corrupted somewhere.

May be it is due to large size of the IDV or DVI. I do not
know.

Here is an example of one SVG file:

---


xmlns='http://www.w3.org/2000/svg' 
xmlns:xlink='http://www.w3.org/1999/xlink'>














-

The zip file in the above folder is large, about 250 MB.

I also put the DVI and IDV files outside the zip file
in the above folder in case you just need to look at
them without having to download the large zip file.

The command I used to compile the index.tex is

make4ht -ulm default -e ./new.mk4 -c ./nma.cfg
    -f html5+dvisvgm_hashes index.tex
    "htm,3,pic-align,notoc*,p-width,svg"

So any one can try the same thing.

And I also put dvisvgm 2.6 I build as binary in the above
folder, just in case. It did build correctly, but who knows,
may be it using wrong font library. It was complicated to
build from sources, but that was only way to get 2.6 without
having to wait one year for TL 2019.

This is very frustrating. I have not been to convert this latex
to HTML for more than 2 weeks now. Nothing seems to work for
some reason. Tried mathjax with make4ht, but that also did not
work for this file.

Any suggestions what to try?


which dvisvgm

/usr/local/bin/dvisvgm


dvisvgm --version

dvisvgm 2.6

Thanks for any help.

TL 2018 on Ubuntu

--Nasser



Re: [tex4ht] problem with new dvisvgm 2.6, all svg fies have horizontal lines with no math showing.

2018-09-10 Thread Ulrike Fischer
Am Mon, 10 Sep 2018 00:37:12 -0500 schrieb Nasser M. Abbasi:

> The zip file in the above folder is large, about 250 MB.

Don't you have a small test suite? Which uses loops to test with
large numbers of math equations? Then you wouldn't have to dump such
large files on Michal and Martin. 


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/