[tex4ht] [bug #464] ! Bad register code (65536). because no new line used in long math?

2020-06-29 Thread Karl Berry
Update of bug #464 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #4:

think there is nothing more to do here, closing.


___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



Re: [tex4ht] [bug #464] ! Bad register code (65536). because no new line used in long math?

2020-05-11 Thread Michal Hoftich
> > it seems like issue in the LaTeX regular expression parser. We use it to fix
> > some issues in the code that is passed to MathJax. Your code seems to be too
> > long for that. Couldn't you break your huge equation into smaller pieces?
>
> The regex code uses toks registers to store tokens, and access them
> directly by number where the number is the position. luatex has only
> 65535 toks register. So regex will not be able to handle text longer
> than 65535 character (if the match is at the end).

I expected the issue will be similar.

I guess this can be fixed using some custom verbatim environments, but
these have other issues.

The easiest way to fix that is to change your code in Mathematica to
produce smaller output.

Best regards,
Michal


Re: [tex4ht] [bug #464] ! Bad register code (65536). because no new line used in long math?

2020-05-10 Thread Ulrike Fischer



> it seems like issue in the LaTeX regular expression parser. We use it to fix
> some issues in the code that is passed to MathJax. Your code seems to be too
> long for that. Couldn't you break your huge equation into smaller pieces?

The regex code uses toks registers to store tokens, and access them
directly by number where the number is the position. luatex has only
65535 toks register. So regex will not be able to handle text longer
than 65535 character (if the match is at the end).



-- 
Mit freundlichen Grüßen
Ulrike Fischer




Re: [tex4ht] [bug #464] ! Bad register code (65536). because no new line used in long math?

2020-05-10 Thread Nasser M. Abbasi

On 5/10/2020 2:47 PM, Michal Hoftich wrote:

Follow-up Comment #3, bug #464 (project tex4ht):

Hi Nasser,

it seems like issue in the LaTeX regular expression parser. We use it to fix
some issues in the code that is passed to MathJax. Your code seems to be too
long for that. Couldn't you break your huge equation into smaller pieces?

Best,
Michal


Hi Michal. The Latex is all auto-generated by CAS system
(Mathematica) and written to files which then read to process.

It is not possible to edit these by hand. Each time I run
Mathematica, new set of files gets written. There are hundreds
of thousands of files with math in them.

It works OK with lualatex. It only failed with using mathjax mode :(

It is too late to go back to using SVG for math images now, as I have
everything set to use mathjax mode, which I like better since it makes
compiling much faster and file sizes are much smaller (no image files
to upload to server).

For now, I edited this one bad latex file by hand and removed
the bad equations until tex4ht was happy so I can compile things
and go on the next set of files.

But if many such cases keep showing up it will be a problem to keep
doing this by hand.

Thanks
--Nasser


[tex4ht] [bug #464] ! Bad register code (65536). because no new line used in long math?

2020-05-10 Thread Michal Hoftich
Follow-up Comment #3, bug #464 (project tex4ht):

Hi Nasser,

it seems like issue in the LaTeX regular expression parser. We use it to fix
some issues in the code that is passed to MathJax. Your code seems to be too
long for that. Couldn't you break your huge equation into smaller pieces?

Best,
Michal

___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/



[tex4ht] [bug #464] ! Bad register code (65536). because no new line used in long math?

2020-05-10 Thread Nasser M. Abbasi
Follow-up Comment #2, bug #464 (project tex4ht):

Quick update. I think we are getting closer.

I found the line which causes it to fail. The \begin{align*}...\end{align*}
has in inside it now 39 equations, each now on one line.  This is all in file
foo_v2.tex which is in same folder https://www.12000.org/tmp/051020/

When I commented line 39 (last equation) inside the align environment, then it
compiles OK.

Uncommenting line 39 the error comes back.

So I thought may be tex4ht needs more resources? So edited 

/usr/local/texlive/2020/texmf.cnf  and added these

buf_size=9000
pool_size=900
main_memory=800

Then run 

sudo /usr/local/texlive/2020/bin/x86_64-linux/fmtutil-sys --all

But the problem is still there. So it is not resource problem. The problem is
in the 

/usr/local/texlive/2020/texmf-dist/tex/latex/base/ts1cmr.fd

And only shows when running tex4ht in mathjax mode.

I see nothing special about last equation in the align environment, so I do
not know why removing it removes the error.



___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/


[tex4ht] [bug #464] ! Bad register code (65536). because no new line used in long math?

2020-05-10 Thread Nasser M. Abbasi
Follow-up Comment #1, bug #464 (project tex4ht):


FYI.
I found the problem is not related to line length. I put new latex file which
does put a new line at end of each equation and the problem is still there.

The new file is called foo_v2.tex in same folder

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

And when I compile the above same way 

make4ht -ulm default -a debug foo_v2.tex "htm,mathjax"

it gives same error Bad register code (65536).

So the problem is something else. 

Any suggestion what else I can try? 

TL 2020 on linux.

___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/


[tex4ht] [bug #464] ! Bad register code (65536). because no new line used in long math?

2020-05-10 Thread Nasser M. Abbasi
URL:
  

 Summary: ! Bad register code (65536). because no new line
used in long math?
 Project: tex4ht
Submitted by: nma123
Submitted on: Sun 10 May 2020 11:19:59 AM EEST
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

I have one \begin{align*}...\end{align*} which contains few equations.

This is auto-generated from Mathematica. Now the only thing, is that there is
no new line between the equations. So it looks like this

\begin{align*} .\\  &=.. \\ ... &= \\ .. \end{align*}

All on one LONG line. 

This causes no problem at all to lualatex. It compiles OK and the output is
correct.

But when I do 

make4ht -ulm default -a debug foo.tex "htm,mathjax"

I get

--
(/usr/local/texlive/2020/texmf-dist/tex/generic/tex4ht/html5.4ht))
(./foo.aux)
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/ts1cmr.fd)
! Bad register code (65536).
\__regex_query_set:nnn ... \l__regex_curr_pos_int
  {#1}\int_incr:N
\l__regex_...

l.8 ...4 \left(7+2 \sqrt{14}\right)}}\\ \end{align*}

?
--

Since the file is long, I can not put it here (actually the file is only few
lines, but the line is over 110,000 characters long. It looks like

==
\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{align*} .\\ \end{align*}
\end{document}
==


So I put foo.tex and also foo.pdf (generated from lualatex) in this folder

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

Also, when I tried to compile it using

>make4ht -ulm default -a debug foo.tex "htm"

i.e. no mathjax, it did not crash, but tex4ht generated hundreds of image .png
files.  

Question is, why does it crash like this? Is there a limit on how long a line
can be in Latex for use with tex4ht/mathjax?

Using TL 2020.






___

Reply to this item at:

  

___
  Message sent via/by Puszcza
  http://puszcza.gnu.org.ua/