[tex4ht] [bug #627] Bad register code (65536) on 200 lines code

2024-06-19 Thread Nasser M. Abbasi
URL:
  

 Summary:  Bad register code (65536) on 200 lines code
 Project: tex4ht
Submitted by: nma123
Submitted on: Thu Jun 20 04:24:12 2024
Category: None
Priority: 5 - Normal
Severity: 7 - Important
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:


tex4ht fails with

make4ht -ulm default -a debug  -c ./nma_mathjax.cfg index.tex 'mathjax,htm'

---

/usr/local/texlive/2023/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
(./index.aux) (/usr/local/texlive/2023/texmf-dist/tex/latex/base/ts1cmr.fd))
! Bad register code (65536).
\__regex_query_set_aux:nN ...__regex_curr_pos_int 
 
{#1}\__kernel_intarray_gse...

l.209 \]
  

---

The code in index.tex is mostly Maple generated with few changes made by me.
It compiles with no problem with Lualatex.

I can't figure the cause. Since it is little long (I did not want to change
it, as not sure which line is the error coming from), I made ZIP file that
contains everything needed to run it. The maple.sty file and my .cfg file.

The code is just one array

\[
\begin{array}{lll}
...
\end{array}
\]

The content of the ZIP file is

>ls -lrt
total 519
-rwxrwxrwx 1 me autologin643 Jun 19 23:06 texput.log
-rwxrwxrwx 1 me autologin 135645 Jun 19 23:08 maple.sty
-rwxrwxrwx 1 me autologin  0 Jun 19 23:11 index.out
-rwxrwxrwx 1 me autologin 243929 Jun 19 23:11 index.pdf
-rwxrwxrwx 1 me autologin  77979 Jun 19 23:11 index.tex
-rwxrwxrwx 1 me autologin  17103 Jun 19 23:13 nma_mathjax.cfg
-rwxrwxrwx 1 me autologin  0 Jun 19 23:13 index.xref
-rwxrwxrwx 1 me autologin 21 Jun 19 23:13 index.tmp
-rwxrwxrwx 1 me autologin 83 Jun 19 23:13 index.4ct
-rwxrwxrwx 1 me autologin 92 Jun 19 23:17 index.aux
-rwxrwxrwx 1 me autologin 76 Jun 19 23:17 index.4tc
-rwxrwxrwx 1 me autologin  36921 Jun 19 23:17 index.log

After unzipping, cd to the folder june_20_2024/ created and run the command
make4ht above to see the error.

I am attaching the ZIP (if this does not work, will make link)

TL 2023

Thanks
--Nasser









___

File Attachments:


---
Date: Thu Jun 20 04:24:12 2024  Name: june_20_2024.zip  Size: 281kB   By:
nma123



___

Reply to this item at:

  

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



Re: [tex4ht] [bug #625] Bad register code (65536) again on auto-generated Latex code

2024-04-29 Thread Nasser M. Abbasi

Thanks for the info Michal;

Yes, I changed my texmf.cnf first thing when installing texlive
to increase the counters, else will not be able to compile
most of my files.

cat texmf.cnf 

buf_size=900
pool_size=900
main_memory=900
save_size=100
max_strings = 500
strings_free = 100
hash_extra=1000
stack_size=50


I've also just put the above file in the zip file:



I think for now, I'll just delete these long equations and
not write them to the latex file as this seems simplest solution.

Since this is all done in code, I changed my code to check
for large Latex equations.

Computer algebra systems tend to generate huge Latex expressions.

Regards,
--Nasser



On 4/29/2024 5:32 AM, Michal Hoftich wrote:

Follow-up Comment #2, bug #625 (project tex4ht):

Hi Nasser, this is not limited to TeX4ht but to l3regex, which is used to
clean the MathJax code. See this question, where they found the same issue:
https://tex.stackexchange.com/q/654633/2891

In theory, you could skip the regex cleaning using this configuration file:


\Preamble{xhtml}
\ExplSyntaxOn
\cs_set_protected:Npn \alteqtoks #1
{
   \HCode{\detokenize{#1}}
}
\ExplSyntaxOff
\begin{document}
\EndPreamble
%

The downside is that you can end with incorrect characters in your HTML, in
particular <, > and &. These can cause MathJax fail.

Also, to break your long strings, you can use this prefilter:

%%%
local max_len = 255
for line in io.lines() do
   line = line:gsub("\r", "")
   local str_len = string.len(line)
   if str_len > max_len then
 -- if the line is longer than maxlen, we will break it to a shorter
segments
 local curr_pos = max_len
 local prev_pos = 1
 while curr_pos < str_len do
   -- find next command preceded by spaces starting at the current
position
   curr_pos, len = string.find(line, "%s+\\", curr_pos)
   print(curr_pos, str_len,string.sub(line, prev_pos, curr_pos))
   prev_pos = curr_pos
   -- we must move the current position
   curr_pos = curr_pos + max_len
 end
 -- print rest of the line
 print(string.sub(line, prev_pos, str_len))
   else
 print(line)
   end
end



Use it as:

$ texlua format.lua < original.tex > formated.tex

It will format your long lines into much shorter chunks, preventing the "!
Unable to read an entire line---bufsize=20" error I encountered. I suppose
that you set the limit higher, but I didn't and couldn't compile your file
originally.

 ___

Reply to this item at:

   

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





[tex4ht] [bug #625] Bad register code (65536) again on auto-generated Latex code

2024-04-28 Thread Nasser M. Abbasi
Follow-up Comment #1, bug #625 (project tex4ht):

I have now a workaround.  So able to build my output.

I changed my program to check the length of each Latex equation generated by
Maple before writing them to the latex file.

If each equation (as string) has length > 10,000 then will not write the whole
Latex generated for that part.

I did not know what is the limit for tex4ht, so picked 10,000.

I found the equation that was causing this bad register code was over 300,000
length.

I know the latex generated by Maple could be better, but that is how it is
generated now.

So I am OK for now. But it will good to know why tex4ht generates this error
and not lualatex. 


Luckily, there are not too many such cases where such huge equations are
generated.

--Nasser

___

Reply to this item at:

  

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



[tex4ht] [bug #625] Bad register code (65536) again on auto-generated Latex code

2024-04-28 Thread Nasser M. Abbasi
URL:
  

 Summary: Bad register code (65536) again on auto-generated
Latex code
 Project: tex4ht
Submitted by: nma123
Submitted on: Sun Apr 28 23:19:37 2024
Category: None
Priority: 5 - Normal
Severity: 7 - Important
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:


Is there a way to fix this issue? 

(/usr/local/texlive/2023/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
No file A.aux.
(/usr/local/texlive/2023/texmf-dist/tex/latex/base/ts1cmr.fd)
! Bad register code (65536).
\__tl_analysis_a_space_test:w ...alysis_index_int 
  {\exp_not:n {
}}\__tl_anal...

l.53 \]


This happens only when using texht.

The Latex is auto-generated by Maple. I know it is due to one or few lines too
long. But it is impossible to edit by hand, since the program generated this
automatically using Maple each time it is run.

Why lualatex handles it OK but not tex4ht? Is there a way to edit some
configuration to make tex4ht not give this error?

Since the equations are large, I put everything in zip file including the
maple style file used.

The command to generate the error is


make4ht -ulm default -a debug A.tex 'mathjax,htm,nostyle'

The zip file is  

https://12000.org/tmp/bad_register_code_tex4ht.zip

When unzipping it will create folder bad_register_code_tex4ht where all the
files are there (A.tex and maple style file).

I am using texlive 2023 on Linux.

I hope there is a solution to this, otherwise I will no longer be able to
build to HTML now.

Thanks
--Nasser






___

Reply to this item at:

  

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



[tex4ht] [bug #624] File ended while scanning use of \AltMathOne. error

2024-04-25 Thread Nasser M. Abbasi
Follow-up Comment #1, bug #624 (project tex4ht):

I found a workaround. So I am OK for now.

In tex4ht mode, I changed to using \begin{array}{ccc} instead. And now it
compiled OK and produces same output as PDF. Here is the new MWE


-
\documentclass[12pt]{article}

\usepackage{amsmath}
\usepackage{longtable}
\usepackage{array}

\begin{document} 

\ifdefined\HCode 
\[
\begin{array}{ccc}
 & {} & \textrm{Let's solve} 
\\
 {} & {} & \left[y^{\prime}=1+2 x , y \left(0\right)=3\right] 
\end{array}
\]
\else 
\begin{longtable}{ >{$}c<{$} >{$}c<{$} >{$}c<{$} }
 & {} & \textrm{Let's solve} 
\\
 {} & {} & \left[y^{\prime}=1+2 x , y \left(0\right)=3\right] 
\end{longtable}
\fi 

\end{document}
---

But it will good to know why it failed in the first version just in case it is
a bug in tex4ht.

--Nasser


___

Reply to this item at:

  

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



[tex4ht] [bug #624] File ended while scanning use of \AltMathOne. error

2024-04-25 Thread Nasser M. Abbasi
URL:
  

 Summary: File ended while scanning use of \AltMathOne. error
 Project: tex4ht
Submitted by: nma123
Submitted on: Thu Apr 25 06:03:46 2024
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

This MWE compiles with no problem with lualatex but gives this error with
tex4ht

---
(/usr/local/texlive/2023/texmf-dist/tex/latex/lm/t1lmtt.fd))
Runaway argument?
\b:array> \ignorespaces {} & \textrm {Let's solve} \\ {} & {} & \left \ETC.
! File ended while scanning use of \AltMathOne.
 
\par 
<*> ...=utf-8,html5.a.b.c.\input "\detokenize{A.tex}"
  
? 
---


I am using code generated by Maple, and just putting this code inside
longtable.

I can not change the code generated. Here is MWE. I only added the lines
\begin{longtable}{...} and \end{longtable} and everything else in between is
auto-generated.


---
\documentclass[12pt]{article}

\usepackage{amsmath}
\usepackage{longtable}
\usepackage{array}

\begin{document} 


\begin{longtable}{ >{$}c<{$} >{$}c<{$} >{$}c<{$} }
 & {} & \textrm{Let's solve} 
\\
 {} & {} & \left[y^{\prime}=1+2 x , y \left(0\right)=3\right] 
\end{longtable}

\end{document}


Now compiled using

make4ht -ulm default -a debug A.tex 'mathjax,htm'

and it gave the error shown above.

No error compiling with lualatex.

Using tex4ht under TL 2023

>which make4ht
/usr/local/texlive/2023/bin/x86_64-linux/make4ht
>make4ht --version
make4ht version v0.3m

How can I make this compile with tex4ht?

Thanks
--Nasser








___

Reply to this item at:

  

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



Re: [tex4ht] tex4ht remove image id from HCode passed. Makes animation no longer work

2024-01-30 Thread Nasser M. Abbasi

I found the fix.

I just needed to do this

\HCode{
\Hnewline

instead of

\HCode{
\Hnewline

as I had it. I must have changed this myself without knowing. Now with this 
change the HTML
does indeeded has the id there:



THis is little strange that I had to do 
I had this code working for many years.

Now for some reason when I compiled the page again using tex4ht
in TL 2023 animations on the page no longer run in HTML.

After much debugging, I found that   losses the id=
part when HTML is generated.

The code I use must use specific id name which is passed to it
for the image in order for the HTML animations to work.

I use external javascript library (libgif), which uses this image id
to add a stop/start/pause for the animation. (not shown in this example)

Below I show MWE and the resulting HTML. We see the id=... is missing
from the  tag.

--- A.tex-
\documentclass[12pt]{book}

\ifdefined\HCode
\newcommand{\addGIFX}[4]
{
\HCode{
\Hnewline
   
   \Hnewline
   var #4 = new SuperGif({ gif: document.getElementById('#4') } );\Hnewline
   #4.load();\Hnewline
   \Hnewline
Pause\Hnewline
Play\Hnewline
Restart\Hnewline
Step 
forward\Hnewline
Step 
back\Hnewline
}
}
\fi

\begin{document}

\ifdefined\HCode
\addGIFX{"anim.gif"}{"750"}{"anim_COVER.png"}{codeperiodicanim}
\fi
\end{document}
---

Now when I compile the above using

make4ht -ulm default -a debug A.tex "mathjax,htm,fn-in,notoc*,p-width,nostyle"

This is the HTML










window.MathJax = { tex: { tags: "ams", }, }; 
   

 
 
var codeperiodicanim = new SuperGif({ gif: 
document.getElementById('codeperiodicanim') } );
codeperiodicanim.load();

Pause
Play
Restart
Step forward
Step back


   



-

The important part of all the above is this one line



You see, the id is missing. When I change the above manually and add
the id=... so it becomes



Now animation works (after loading external libgif on my end)

For some reason in current tex4ht the call

\addGIFX{"anim.gif"}{"750"}{"anim_COVER.png"}{codeperiodicanim}

Is not passing the 4th argument #4 which is the id to the javascript
code as it should using \newcommand given above.

Is there something I need to correct in the above newcommand
to make text4ht adds id= to the HTML  it generates using the 4th
argument as shown above?

TL 2023


which tex4ht

/usr/local/texlive/2023/bin/x86_64-linux/tex4ht

make4ht --version

make4ht version v0.3m


Thanks
--Nasser









[tex4ht] tex4ht remove image id from HCode passed. Makes animation no longer work

2024-01-30 Thread Nasser M. Abbasi

I had this code working for many years.

Now for some reason when I compiled the page again using tex4ht
in TL 2023 animations on the page no longer run in HTML.

After much debugging, I found that   losses the id=
part when HTML is generated.

The code I use must use specific id name which is passed to it
for the image in order for the HTML animations to work.

I use external javascript library (libgif), which uses this image id
to add a stop/start/pause for the animation. (not shown in this example)

Below I show MWE and the resulting HTML. We see the id=... is missing
from the  tag.

--- A.tex-
\documentclass[12pt]{book}

\ifdefined\HCode
\newcommand{\addGIFX}[4]
{
\HCode{
\Hnewline
 
 \Hnewline
 var #4 = new SuperGif({ gif: document.getElementById('#4') } );\Hnewline
 #4.load();\Hnewline
 \Hnewline
  Pause\Hnewline
  Play\Hnewline
  Restart\Hnewline
  Step 
forward\Hnewline
  Step 
back\Hnewline
  }
}
\fi

\begin{document}

\ifdefined\HCode
\addGIFX{"anim.gif"}{"750"}{"anim_COVER.png"}{codeperiodicanim}
\fi
\end{document}
---

Now when I compile the above using

make4ht -ulm default -a debug A.tex "mathjax,htm,fn-in,notoc*,p-width,nostyle"

This is the HTML










window.MathJax = { tex: { tags: "ams", }, }; 
 

 
 
var codeperiodicanim = new SuperGif({ gif: 
document.getElementById('codeperiodicanim') } );
codeperiodicanim.load();

Pause
Play
Restart
Step forward
Step back


 



-

The important part of all the above is this one line



You see, the id is missing. When I change the above manually and add
the id=... so it becomes



Now animation works (after loading external libgif on my end)

For some reason in current tex4ht the call

\addGIFX{"anim.gif"}{"750"}{"anim_COVER.png"}{codeperiodicanim}

Is not passing the 4th argument #4 which is the id to the javascript
code as it should using \newcommand given above.

Is there something I need to correct in the above newcommand
to make text4ht adds id= to the HTML  it generates using the 4th
argument as shown above?

TL 2023


which tex4ht

/usr/local/texlive/2023/bin/x86_64-linux/tex4ht

make4ht --version

make4ht version v0.3m


Thanks
--Nasser







[tex4ht] [bug #620] tex4ht breaks URL text leading to empty spaces between words generated in final HTML when \urldef

2024-01-15 Thread Nasser M. Abbasi
URL:
  

 Summary: tex4ht breaks URL text leading to empty spaces
between words generated in final HTML when \urldef
 Project: tex4ht
Submitted by: nma123
Submitted on: Mon Jan 15 23:27:58 2024
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

reference and screen shot at

https://tex.stackexchange.com/questions/707149/tex4ht-breaks-url-text-leading-to-empty-spaces-between-words-generated-in-final

I use \urldef in order to make href, because the names are folder/file path
which can contain many different strange characters.

This works fine in PDF with lualatex. But I noticed that the HTML generated by
tex4ht breaks the names into 2 lines, which causes BLANK space to show in the
name when looking at it on the screen in the page. This makes it hard to read
sometimes. Here is MWE


\documentclass[12pt,oneside]{book}
\usepackage{hyperref} 
\usepackage{url}

\begin{document}

\section{Tests completed}
\begin{enumerate}
\item
\urldef\mytarget\nolinkurl{test_cases/rubi_tests/0_Independent_test_suites/1_Apostol_Problems}
\href{test_cases/rubi_tests/0_Independent_test_suites/1_Apostol_Problems/output/report.htm}{\mytarget}
\hspace{5pt}  [175]
\item
\urldef\mytarget\nolinkurl{test_cases/rubi_tests/0_Independent_test_suites/2_Bondarenko_Problems}
\href{test_cases/rubi_tests/0_Independent_test_suites/2_Bondarenko_Problems/output/report.htm}{\mytarget}
\hspace{5pt}  [35]
\end{enumerate}
\end{document}
--

When compiled using

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

It gives

enter image description here

The reason this happens is because tex4ht breaks the name when it sees _. Here
is the raw html

--
 
 
 
 
 
 
 
 
window.MathJax = { tex: { tags: "ams", }, };  
   
 
0.1  
 Tests completed
  


 test_cases/rubi_tests/0_Independent_test_suites/1_
Apostol_Problems  [175]

 test_cases/rubi_tests/0_Independent_test_suites/2_
Bondarenko_Problems  [35]
 
 



If I edit the index.htm by hand and make the name one long line by removing
the extra CR it added, the HTML now becomes

--

 
 
 
 
 
 
 
 
window.MathJax = { tex: { tags: "ams", }, };  
   
 
0.1  
 Tests completed
  


 test_cases/rubi_tests/0_Independent_test_suites/1_Apostol_Problems
 [175]

 test_cases/rubi_tests/0_Independent_test_suites/2_Bondarenko_Problems
 [35]
 
 


--

and on screen it now looks like this

enter image description here

How to fix tex4ht so it does not break long names in href and keep the name on
same line?

TL 2023 installed few days ago on Linux.





___

Reply to this item at:

  

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



Re: [tex4ht] [bug #618] Incomplete XML Document, domfilter error, truncated build on large file.

2023-12-15 Thread Nasser M. Abbasi

On 12/15/2023 6:21 AM, CV Radhakrishnan wrote:

On 12/14/23 20:32, Nasser M. Abbasi wrote:

[...]


The above build.sh assumes you are using TL 2023, if not please change
the path shown.


Yes, I have TL 2023.


After you start ./build.sh it will take about 12-16 hrs or so depending
on the speed and memory of your PC.


This is the biggest problem. In the first place, the single source TeX
file with huge size (145MB) makes it an unmanageable beast. Need to
waste another 12 to 18h of machine time even if we could pinpoint the
error causing line.

Hence, I split the source into several files of each with 100,000 lines.
Located that the table in line number 382889 (original source) had


Yes. Exactly ! This is where the problem is. It is at that
table, where tex4ht stops and gives the XML and domfilter error
and truncate everything.

And yes, splitting the document to smaller files fixes the problem
and this is what I ended doing. I split the file to 4 files.


broken the html generation which I found its place in the fourth segment
of split files (file-4.tex).

When I ran this by inputting to the introductory chapter to replicate
the problem, it went well to my surprise. Of course, it is not usable as
the cross references would be wrong.

I had encountered two problems.

   * Found two packages missing (i) myspace.sty and (ii) maple.sty. Would
 you kindly send these as well?


Sorry. I've updated the ZIP file with these missing files.

<https://12000.org/tmp/tex4ht_XML_DVI_problem/210_Hebisch.zip>

I've also put them there outside the zip file in case you just need
to download them on their own without having to download the whole
zip file

<https://12000.org/tmp/tex4ht_XML_DVI_problem/maple.sty>
<https://12000.org/tmp/tex4ht_XML_DVI_problem/myspaces.4ht>
<https://12000.org/tmp/tex4ht_XML_DVI_problem/myspaces.sty>



   * \usepackage[]{marginnote} has been loaded without the option 'quiet'
 that caused unwanted verbose aux writing about the xpos of the
 margin notes which should have been handled in a different way in
 html mode (with css directive like float) so that TeX will not spend
 too much time on the computation of the exact location of the margin
 note in the dvi. That indeed sped up my part compilation.



Sure. I will add that option on my end. I did not know marginnote has quite 
mode.


The document in whole is running in another system, will get back with
the results soon.

Regards


Thanks for the help and for trying it.

--Nasser



Re: [tex4ht] [bug #618] Incomplete XML Document, domfilter error, truncated build on large file.

2023-12-14 Thread Nasser M. Abbasi

On 12/14/2023 5:09 PM, Karl Berry wrote:

 and see if they can reproduce these errors,

Thanks for all this.

The main thing I need to even make a start at debugging the binary is
the exact invocation of the tex4ht executable (and t4ht, if it makes
that far).

I think/hope make4ht will output that with -a debug, but I admit I'm not
sure.

Any chance you could try to find the invocations, so I can just start
from the dvi you previously sent? --thanks, karl.


I am sorry, I do not understand.  I use make4ht, and it internally
calls tex4ht. I never call tex4ht myself.

Everything is in rhe report.log is in the ZIP file I linked to
in the earlier message.

I see this at the top of the log file

**\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCo
de"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.
{\AddToHook{class/before}{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documents
tyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\e
ndcsname{#1,html}\def\HCode1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\
documentstyle[tex4ht]}}}\makeatother\HCode ./nma_mathjax.cfg,mathjax,htm,4,fn-i
n,notoc*,p-width,charset=utf-8,cut-fullname,nostyle,charset=utf-8,html5.a.b.c.\
input "\detokenize{report.tex}"


What other command should I search for? isn't all such commands should
be in the log file? Here is a link to the report.log file itself also
from the zip file. May be this makes it easier:



regards,
--Nasser





Re: [tex4ht] [bug #618] Incomplete XML Document, domfilter error, truncated build on large file.

2023-12-14 Thread Nasser M. Abbasi



In case someone would like to try compiling this in tex4ht,
and see if they can reproduce these errors, here are the
instructions:

The errors you should see at the end are these:



The following ZIP file contains the folder with all files
needed to compile report.tex in it



It is 450 MB.

After downloading and unzipping, cd to the folder it creates.

There is a file called build.sh, so all what you need to do is

   ./build.sh

The file is

---
#!/bin/bash
echo "starting compile..."
export TEXMFCNF=.:/usr/local/texlive/2023/texmf-dist/web2c
make4ht  --shell-escape -ulm default -a debug -f html5+join_colors  -c ./nma_mathjax.cfg -e 
./MAIN.mk4 report.tex 
"mathjax,htm,4,fn-in,notoc*,p-width,charset=utf-8,cut-fullname,nostyle" "-cunihtf 
-utf8"
---

The reason I have export TEXMFCNF=.:/usr/local/texlive/2023/texmf-dist/web2c in
the above is because I have my own texmf.cnf in this folder. This is needed
to increase the counters to handle this file, else it will fail:

--- my texmf.cnf-
% (Public domain.)
% This texmf.cnf file should contain only your personal changes from the
% original texmf.cnf (for example, as chosen in the installer).
%
% That is, if you need to make changes to texmf.cnf, put your custom
% settings in this file, which is .../texlive//texmf.cnf, rather than
% the distributed file (which is .../texlive//texmf-dist/web2c/texmf.cnf).
% And include *only* your changed values, not a copy of the whole thing!
%
buf_size=900
pool_size=900
main_memory=800
save_size=100
max_strings = 500
strings_free = 100
hash_extra=1000
stack_size=50
--

If you do not want to use the export command above, the other option is
to copy my texmf.cnf to your /usr/local/texlive/2023/texmf.cnf as root.

The above build.sh assumes you are using TL 2023, if not please change
the path shown.

After you start ./build.sh it will take about 12-16 hrs or so depending
on the speed and memory of your PC.

I tested the above in new Linux installation with new TL 2023 installed
and it works.

Any problems running the build please let me know.

Thanks
--Nasser







Re: [tex4ht] [bug #618] Incomplete XML Document, domfilter error, truncated build on large file.

2023-12-13 Thread Nasser M. Abbasi

On 12/13/2023 4:10 PM, Karl Berry wrote:

 Hi Karl, Nasser's original DVI file is included in the zip file, so it
 is possible to execute tex4ht on it. It fails silently, it looks like
 some \special instruction causes immediate stop.

Please point me to the zip. (No promises. :) --thanks, karl.


Hello Karl;

If you just need the DVI file and do not need to run make4ht,
here is link to the DVI in ZIP file:

https://12000.org/tmp/tex4ht_XML_DVI_problem/report.zip

The DVI file is 1.3 GB but the above zip file is 100 MB
which has the DVI file inside it.

If you need to also run make4ht please me know and will
upload the whole folder also.

Thanks
--Nasser



Re: [tex4ht] [bug #618] Incomplete XML Document, domfilter error, truncated build on large file.

2023-12-13 Thread Nasser M. Abbasi

On 12/12/2023 8:45 AM, Michal Hoftich wrote:

Follow-up Comment #1, bug #618 (project tex4ht):

It seems that something causes tex4ht command to stop processing your DVI file
abruptly. Maybe some wrong \special command. There are no errors in the log
file. It seems that LaTeX compiled the whole file. The problem is with the DVI
file.

But I cannot compile the sample you sent me; it is too large for my computer.
I've made a smaller example that contains text up to the point where it fails
on your system, and the compilation succeeded. So it is even more mysterious
than I expected.



No problem Michal, thanks for trying.

I ended up splitting that one large file into 4 smaller
files. i.e. made it 4 books instead of one book. Each builds
on its own, and in its own separate folder.

Now everything compiles OK. All tables show up and no XML error.

The same exact Latex, the difference is that each file is smaller.
So I have 4 web pages instead of just one web page now.

So there is a problem with the size of file. May be if the
number of subsections or tables becomes too large, tex4ht
runs into some memory problem or hits some internal limit which
causes some corruption. I do not know.

But the zip file I send you is good to keep, as it shows an
internal problem somewhere wit DVI. When in the future you
get bigger PC that can handle the file, you can always try it
again and use it to stress test tex4ht on large files.

regards,
--Nasser


 ___

Reply to this item at:

   

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





Re: [tex4ht] [bug #618] Incomplete XML Document, domfilter error, truncated build on large file.

2023-12-11 Thread Nasser M. Abbasi

On 12/11/2023 9:06 PM, William F Hammond wrote:

Hello Nasser,

You don't give us much to go on.  But it does provoke my curiosity.



Sorry, but I did send Michal detailed information on this.
I just added bug for tracking and did not think anyone else will
be interested in all the boring details of  my build.


I assume that you are able to build the 57,000 page pdf from the tex source
that you want to process with tex4ht.



Oh, yes ofcourse. The file builds OK in lualatex. Here is the link

<https://12000.org/my_notes/CAS_integration_tests/reports/summer_2023_Rubi_4_17_3/test_cases/210_Hebisch/report.htm>

THere are over 10,000 subsections,. and tex4ht breaks down on
reportsubsection1100

Which is this

<https://12000.org/my_notes/CAS_integration_tests/reports/summer_2023_Rubi_4_17_3/test_cases/210_Hebisch/reportsubsection1100.htm#x1117-109610003.10.84>

If you click  from the top of the above page you get error link not found
since no more subsections are processed after that. There is almost 9,000
subsections that should be there. All are not generated.



Is html output the final tex4ht target?  I'm assuming it is.



Yes, only HTML (mathjax) mode.


You say:

[INFO]make4ht-lib: parse_lg process file: reportsubsection1100.htm
[WARNING] domfilter: DOM parsing of reportsubsection1100.htm failed:
[WARNING] domfilter:
...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Incomplete
XML Document [char=33675]

From this I deduce that the 57,000 page document is being written in HTML

pieces by tex4ht, "reportsubsection1100.htm" is one of those pieces, and
perhaps not all expected pieces have been generated.

Have you checked whether "reportsubsection1100.htm" is well-formed XML
using, say, the tool "xmlwf" found in the expat distribution?



I build that code in reportsubsection1100.htm on its own, and it builds OK
with make4ht. It is only when the code is part of report.tex (the full
latex file which includes everything) where this problem is found.

I do not know xmlwf. I just see these domfilter and XML messages show
up and that is all. I really know very little about these.

But to help Michal, I send him ZIP file with everything in it so he can
reproduce this on his computer also.

It seems related to use tables, since that is the place where it fails.

--Nasser


 -- Bill


William F Hammond
Email: gel...@gmail.com
https://www.facebook.com/william.f.hammond
http://www.albany.edu/~hammond/

푻풉풆 풕풊풎풆 풕풐 풔풂풗풆 풂 풅풆풎풐풄풓풂풄풚 풊풔 풃풆풇풐풓풆 풊풕
풊풔 풍풐풔풕.   -- 퐊퐞퐧 퐁퐮퐫퐧퐬




On Mon, Dec 11, 2023 at 5:04 PM Nasser M. Abbasi 
wrote:


URL:
   <http://puszcza.gnu.org.ua/bugs/?618>

  Summary: Incomplete XML Document, domfilter error,
truncated
build on large file.
  Project: tex4ht
 Submitted by: nma123
 Submitted on: Tue Dec 12 01:04:12 2023
 Category: None
 Priority: 5 - Normal
 Severity: 7 - Important
   Status: None
  Privacy: Public
  Assigned to: None
 Originator Email:
  Open/Closed: Open
  Discussion Lock: Any

 ___

Details:

I have been working with Michal on this via private email but thought to
enter
a bug report on this just for tracking and documentation.

I have one large file (57,000 PDF pages) that when compiled with tex4ht
(takes
14 hrs), and at about 10% when generating the final HTML pages, it gets XML
error and stops.

i.e. the 90% rest of the sections are missing from the final web pages.

---

[INFO]make4ht-lib: parse_lg process file: reportsubsection1100.htm
[WARNING] domfilter: DOM parsing of reportsubsection1100.htm failed:
[WARNING] domfilter:
...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Incomplete
XML Document [char=33675]

[INFO]make4ht-lib: parse_lg process file: reportsubsection1100.htm
[WARNING] domfilter: DOM parsing of reportsubsection1100.htm failed:
[WARNING] domfilter:
...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Incomplete
XML Document [char=33675]

[INFO]make4ht-lib: parse_lg process file: reportsubsection1100.htm

--

I've just send Michal a link to complete self contained ZIP file (450 MB)
with
instructions how to run as standalone in order to see these errors on his
end.


I tried this on latest texlive 2023 on new Linux installation.

I will work with Michal to provide any additional information he needs from
me, to hopefully find the cause of this problem.

This happens only on this file. I think may be due to the large size, since
the Latex code is all generated by same program and only this file gives
this
error.

--Nasser





 ___

Reply to this i

[tex4ht] [bug #618] Incomplete XML Document, domfilter error, truncated build on large file.

2023-12-11 Thread Nasser M. Abbasi
URL:
  

 Summary: Incomplete XML Document, domfilter error, truncated
build on large file. 
 Project: tex4ht
Submitted by: nma123
Submitted on: Tue Dec 12 01:04:12 2023
Category: None
Priority: 5 - Normal
Severity: 7 - Important
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

I have been working with Michal on this via private email but thought to enter
a bug report on this just for tracking and documentation.

I have one large file (57,000 PDF pages) that when compiled with tex4ht (takes
14 hrs), and at about 10% when generating the final HTML pages, it gets XML
error and stops. 

i.e. the 90% rest of the sections are missing from the final web pages. 

---

[INFO]make4ht-lib: parse_lg process file: reportsubsection1100.htm
[WARNING] domfilter: DOM parsing of reportsubsection1100.htm failed:
[WARNING] domfilter:
...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Incomplete
XML Document [char=33675]

[INFO]make4ht-lib: parse_lg process file: reportsubsection1100.htm
[WARNING] domfilter: DOM parsing of reportsubsection1100.htm failed:
[WARNING] domfilter:
...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Incomplete
XML Document [char=33675]

[INFO]make4ht-lib: parse_lg process file: reportsubsection1100.htm

--

I've just send Michal a link to complete self contained ZIP file (450 MB) with
instructions how to run as standalone in order to see these errors on his end.


I tried this on latest texlive 2023 on new Linux installation.

I will work with Michal to provide any additional information he needs from
me, to hopefully find the cause of this problem.  

This happens only on this file. I think may be due to the large size, since
the Latex code is all generated by same program and only this file gives this
error.

--Nasser





___

Reply to this item at:

  

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



Re: [tex4ht] [bug #617] The fancyvrb LaTeX package produces blank lines with the `\VerbatimInput` command

2023-12-11 Thread Nasser M. Abbasi




### Discussion

It seems that the issue stems from the lack of support for the
`\VerbatimInput` command in TeX4ht. However, the `\VerbatimCommand` is used to
input verbatim text in the LaTeX definitions of the Markdown package for TeX
and cannot be easily substituted with the `Verbatim` environment. A fix or a
workaround would be appreciated.


I can confirm the extra \n in the HTML version of the \VerbatimInput between
the lines.

But do you have to use \VerbatimInput? I have not myself used Verbatim
for years now, in pdf nor in HTML. I switched to listings
package for everything now. inline input and from file.

It works very well in pdf and HTML with tex4ht.

May be there is a way to renewcommand that \VerbatimCommand you
mentioned to use listings instead?

--Nasser





Re: [tex4ht] Can one use tex4ht log file to check if more runs are needed?

2023-12-04 Thread Nasser M. Abbasi

On 12/4/2023 5:29 AM, Michal Hoftich wrote:

Hi Nasser,


My question here is this: Could I use similar method
for tex4ht and just check the tex4ht log file for messages?

This is easier for me to do, since I can use the same
"grep -E" command.


TeX4ht on its own doesn't produce such messages, AFAIK. The method
with log checking should be safer. 


Hello Michal. I am little confused. You say tex4ht does not generate
such messages, but then you say log checking is safer.

Can I check for same messages when compiling with tex4ht as
I do with lulatex? This is my question.


Also the rerunfilecheck package is
also based on checksums of temporary files, so it should work
similarly.



I do not want to use rerunfilecheck package as I do not understand it.

I just want a simple method, which is to to check myself for messages
in the log file, that is why I asked.

I assumed tex4ht generates its own messages different
from lualatex to indicate more runs are needed or not.

Ofcourse, I can try and find out, but the problem is that it is hard to
know by looking at the HTML pages sometimes if the build was
complete or not.

I am asking all this, because one build with tex4ht
takes 24 and more hours on some of my large files and was
wondering if it is calling tex4ht more times than needed.


Best,
Michal


Thanks
--Nasser


[tex4ht] Can one use tex4ht log file to check if more runs are needed?

2023-12-03 Thread Nasser M. Abbasi



Currently, when I compile using lualatex, the script checks
at the end of each compilation if some specific messages
are in the log file, which tells it to call lualatex one more
time. Over the years I collected these messages


   Rerun.
   Rerun,
   Rerun to get outlines right
   Rerun to get it removed
   Temporary extra page added at the end
   may have changed
   Rerun to get cross-references right
   shipout/lastpage|Table widths have changed

(I can't just check for "Rerun" because that can give false
positive, since package rerunfilecheck generate log message
with the word "Rerun" in it. I do not even load this package,
but is loaded by other packages).

For tex4ht, I use Michal's lua script that he kindly
wrote for me long time ago which does some magic and
checksums to decide if more runs are needed with
maximum number of 6 runs.

But always not sure if it is running more times than
needed or not.

My question here is this: Could I use similar method
for tex4ht and just check the tex4ht log file for messages?

This is easier for me to do, since I can use the same
"grep -E" command.

If so, will searching for same messages above work for tex4ht?

Or does it generate other messages not listed above
which indicates more calls to make4ht is needed?

I know by default make4ht will run 3-times, but I can
change it to run one time only each time it is called, and
this way I can call it from the script as many times as
needed based on if I find it needs to run again.

Thanks
--Nasser


[tex4ht] [bug #616] \downarrow is not centered in table when using tex4ht with column type centered paragraph

2023-11-22 Thread Nasser M. Abbasi
URL:
  

 Summary: \downarrow is not centered in table when using
tex4ht with column type centered paragraph
 Project: tex4ht
Submitted by: nma123
Submitted on: Wed Nov 22 08:45:13 2023
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

reference and screen shot at 

https://tex.stackexchange.com/questions/701975/downarrow-is-not-centered-in-table-when-using-tex4ht-with-column-type-centered

I am making a table, with one column. The table is centered. The column type
is centered paragraph.

I am using \downarrow for annotation between each row to indicate
transformation made.

In pdf, everything is centered. But in HTML, the math is centered, but the
arrows are not. This happens only when I use column type as centered
paragraph. If I use just c, then the arrows are centered.

But I have to use centered paragraph and not c for column type, because I am
using displayed math in table, which needs paragraph. I am using displayed
math because the math is little larger and easier to read.

Here is an example that works same way in PDF and HTML, which using c. Then
below that I show an example which does not work in HTML when I change the
column type to centered paragraph

-
\documentclass[12pt,oneside]{book}  

%added nov 23, 2023 to enlarge vertical arrow.
%https://tex.stackexchange.com/questions/213811/how-to-elongate-down-arrow
\newcommand{\xdownarrow}[1]{%
  {\left\downarrow\vbox to #1{}\right.\kern-\nulldelimiterspace}
}
\usepackage{amsmath}

\begin{document}

\begin{table}
\centering
\begin{tabular}{c}
$\int \frac{e^{x+e^x} \left(e^x+1\right)}{x+e^x} \, dx$\\
$\Big\downarrow$ 7258\\
$\int \frac{e^{x+e^x}}{x+e^x}d\left(x+e^x\right)$\\
$\Big\downarrow$ 2609\\
$\operatorname{ExpIntegralEi}\left(x+e^x\right)$
\end{tabular}
\end{table} 
\end{document}
---

Compiling with lualatex and with tex4ht using

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

Output is similar. good. arrows are centered as well as table and math.

enter image description here

Now I modified the MWE to using column type centered paragraph so I can use
display math

---
\documentclass[12pt,oneside]{book}  
%added nov 23, 2023 to enlarge vertical arrow.
%https://tex.stackexchange.com/questions/213811/how-to-elongate-down-arrow
\newcommand{\xdownarrow}[1]{%
  {\left\downarrow\vbox to #1{}\right.\kern-\nulldelimiterspace}
}

\usepackage{array}
%see
https://tex.stackexchange.com/questions/12703/how-to-create-fixed-width-table-columns-with-text-raggedright-centered-raggedlef
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\usepackage{amsmath}

\begin{document}

\begin{table}
\centering
\begin{tabular}{C{\textwidth}}
$\displaystyle \int \frac{e^{x+e^x} \left(e^x+1\right)}{x+e^x} \, dx$\\
$\Big\downarrow$ 7258\\
$\displaystyle \int \frac{e^{x+e^x}}{x+e^x}d\left(x+e^x\right)$\\
$\Big\downarrow$ 2609\\
$\displaystyle \operatorname{ExpIntegralEi}\left(x+e^x\right)$
\end{tabular}
\end{table}
\end{document}
---

Now lualatex gives

enter image description here

But tex4ht gives using same command as above this:

enter image description here

The arrows for some reason no longer are centered like in PDF.

Is there an easy workaround for this?

TL 2023 updated about 2 months ago.






___

Reply to this item at:

  

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



[tex4ht] [bug #614] tex4ht in TL 2023 generates funny characters in table

2023-10-31 Thread Nasser M. Abbasi
URL:
  

 Summary: tex4ht in TL 2023 generates funny characters in
table
 Project: tex4ht
Submitted by: nma123
Submitted on: Wed Nov  1 04:16:14 2023
Category: None
Priority: 5 - Normal
Severity: 7 - Important
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

reference and screen shots at 

https://tex.stackexchange.com/questions/700090/why-tex4ht-in-tl-2023-generates-funny-characters-in-table-when-using-beginsmal

I noticed tex4ht generates funny characters now in table when surrounding
table with \begin{small}...\end{small} and at same time using p-width as
option. This happens only in TL 2023. Here is MWE and command to reproduce it

--
\documentclass[12pt]{book}
\begin{document}
\begin{small}
\begin{tabular}[c]{|p{0.9in}|l|c c c c c c c c|}\hline
1& Optimal\\ \hline
\end{tabular}
\end{small}
\end{document}


Compiled using

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

Gives

enter image description here

During compilation it says

--
INFO]make4ht-lib: parse_lg process file: foo.htm
[WARNING] domfilter: DOM parsing of foo.htm failed:
[WARNING] domfilter:
...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced
Tag (/span) [char=1256]
---

Two ways to fix this, Either remove the p-width option, or remove the
\begin{small}\end{small}. So this MWE

-
\documentclass[12pt]{book}
\begin{document}
\begin{tabular}[c]{|p{0.9in}|l|c c c c c c c c|}\hline
1& Optimal\\ \hline
\end{tabular}
\end{document}
--
And using same exact command to compile gives

enter image description here

The above happens only in TL 2023. I tested in under TL 2022 and it works OK
in both cases.

Why does this happen? I use p-width all the time, here is reference and this
is first time I see this problem. Btw, replacing \begin{small}...\end{small}
with \small \normalsize does not fix the problem. So this MWE still gives
same problem on TL 2023

--
\documentclass[12pt]{book}
\begin{document}
\small 
\begin{tabular}[c]{|p{0.9in}|l|c c c c c c c c|}\hline
1& Optimal\\ \hline
\end{tabular}
\normalsize
\end{document}
---







___

Reply to this item at:

  

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



Re: [tex4ht] Problems generating svg when tikz is involved with tex4ht

2023-10-24 Thread Nasser M. Abbasi

On 10/24/2023 6:06 AM, Michal Hoftich wrote:


I cannot reproduce these issues, both at work and at home, but I don't
think it is caused by Dvisvgm. Two things that you can try is to
remove the "htm" option, because it seems to produce strange image
filenames, and also the up-to-date driver from here:
https://github.com/michal-h21/dvisvgm4ht

Best,
Michal


Thanks for checking. some update: using your new driver


pwd

/mnt/g/public_html/styles/texmf/tex/generic/dvisvgm4ht

ls -lrt

total 28
-rwxrwxrwx 1 me autologin  2857 Oct 24 15:28 README.md
-rwxrwxrwx 1 me autologin  2569 Oct 24 15:28 pgfsys-dvisvgm4ht.def
-rwxrwxrwx 1 me autologin 17762 Oct 24 15:28 pgfsys-tex4ht-updated.def




Now the HTML shows the tikz shapes. But all the text is missing.
i.e. for this MWE

---
\documentclass[12pt]{article}
\ifdefined\HCode
  \def\pgfsysdriver{pgfsys-tex4ht-updated.def}
\fi
\usepackage{amsmath}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\node at (0,0) [circle, fill=yellow, inner sep=1pt] { some text};
\end{tikzpicture}

after tikz
\end{document}
---

Compiled using

make4ht --shell-escape -ulm default -a debug foo3.tex 'mathjax,htm'

The generated html shows now the yellow circle. But "some text" is missing.

Ofcourse the pdf show the text in the tikz picture.

I tried with htm and without and tried with mathjax and without.
All math and text are missing from the tikzpicture in the .svg file generated.


which make4ht

/usr/local/texlive/2023/bin/x86_64-linux/make4ht

make4ht --version

make4ht version v0.3m

I've put a new zip file that includes all the above MWE with
all files generated in this folder

https://12000.org/tmp/oct_23_2023/

The zip file is

   tikz_problem_with_tex4ht_v2.zip

So some progress is made by using make4ht updated driver. But the
question now is why no labels and no text show up for me.

But if all else fails, I can generate images for the tikzpics
and includes this as graphics for HTML.

Thanks
--Nasser



Re: [tex4ht] Problems generating svg when tikz is involved with tex4ht

2023-10-24 Thread Nasser M. Abbasi

Fyi;
I do not know if this is dvisvgm issue or not. But on TL 2023 it says


which dvisvgm

/usr/local/texlive/2023/bin/x86_64-linux/dvisvgm

dvisvgm --version

dvisvgm 3.0.3

But current version is supposed to be

https://dvisvgm.de/Downloads/

3.1.2  and on my Linux Manjaro, I could if I want install dvisvgm 3.1.1.1
according to the packag manager. But I have not done so yet, so still
using the one that comes with TL 2023.

I could try to install 3.1.1.1 and see if this makes any difference
or not.

--Nasser

On 10/24/2023 12:51 AM, Nasser M. Abbasi wrote:

I've been having problems with TL 2023 using tex4ht when
tikz is involved.

The svg images generated are bad according to the browsers.

Here is a MWE taken from 4 years old answer

https://tex.stackexchange.com/questions/488733/what-is-current-status-of-using-tikz-with-tex4ht

When compiling the above code using the command

   make4ht --shell-escape -ulm default -a debug foo3.tex 'mathjax,htm'

The output is all mangled and does not display right.

I've put a zip file with everything in it in this folder

https://12000.org/tmp/oct_23_2023/

The zip file is called tikz_problem_with_tex4ht.zip

The tex file is exactly the same from the answer above and
is inside the zip file. Here it is again:

-
\documentclass[12pt]{article}
% it makes no difference to comment or not
%\ifdefined\HCode
%   \def\pgfsysdriver{pgfsys-dvisvgm4ht.def}
%\fi

\usepackage{tikz}
\usepackage{amsmath}
\begin{document}

\begin{tikzpicture}
\coordinate[label =above:$0$,   label =below:{$u=0$}] (A) at (0,0);
\coordinate[label =above:$\pi$, label =below:{$u_x=0$}] (B) at (4,0);

\draw (A) -- node[above] {$u_t = k u_{xx} $}  node[below] {$f(x)$} ++ (B);

\node at (A)[circle,fill,inner sep=1pt]{};
\node at (B)[circle,fill,inner sep=1pt]{};

\end{tikzpicture}
\end{document}
---

Could someone please try to compile it and see if they get same
problem? May be there is a problem on my Linux?

Also when I open one svg image generated it says at the top

--
The old, written in PostScript, PDF interpreter has been removed entirely.
You should cease using -dNEWDPF as it has no effect n
-

And when I click on the image the browser says

--
This page contains the following errors:
error on line 1 at column 1: Document is empty
Below is a rendering of the page up to the first error.
--

I am on Linux, on Virtual box. Using TL 2023 updated 2 days ago.

I've asked what I think is related to this problem here

<https://tex.stackexchange.com/questions/699129/problem-using-tex4ht-with-algpseudocodex-package-when-adding-indent-guide-lines>

With same bad display from bad svg images. Because the indent lines in
the above package uses tikz.

But Michal is not able to reproduce it on his computer.

Any suggestion what else to try?

Thanks
--Nasser




[tex4ht] Problems generating svg when tikz is involved with tex4ht

2023-10-23 Thread Nasser M. Abbasi

I've been having problems with TL 2023 using tex4ht when
tikz is involved.

The svg images generated are bad according to the browsers.

Here is a MWE taken from 4 years old answer

https://tex.stackexchange.com/questions/488733/what-is-current-status-of-using-tikz-with-tex4ht

When compiling the above code using the command

 make4ht --shell-escape -ulm default -a debug foo3.tex 'mathjax,htm'

The output is all mangled and does not display right.

I've put a zip file with everything in it in this folder

https://12000.org/tmp/oct_23_2023/

The zip file is called tikz_problem_with_tex4ht.zip

The tex file is exactly the same from the answer above and
is inside the zip file. Here it is again:

-
\documentclass[12pt]{article}
% it makes no difference to comment or not
%\ifdefined\HCode
%   \def\pgfsysdriver{pgfsys-dvisvgm4ht.def}
%\fi

\usepackage{tikz}
\usepackage{amsmath}
\begin{document}

\begin{tikzpicture}
\coordinate[label =above:$0$,   label =below:{$u=0$}] (A) at (0,0);
\coordinate[label =above:$\pi$, label =below:{$u_x=0$}] (B) at (4,0);

\draw (A) -- node[above] {$u_t = k u_{xx} $}  node[below] {$f(x)$} ++ (B);

\node at (A)[circle,fill,inner sep=1pt]{};
\node at (B)[circle,fill,inner sep=1pt]{};

\end{tikzpicture}
\end{document}
---

Could someone please try to compile it and see if they get same
problem? May be there is a problem on my Linux?

Also when I open one svg image generated it says at the top

--
The old, written in PostScript, PDF interpreter has been removed entirely.
You should cease using -dNEWDPF as it has no effect n
-

And when I click on the image the browser says

--
This page contains the following errors:
error on line 1 at column 1: Document is empty
Below is a rendering of the page up to the first error.
--

I am on Linux, on Virtual box. Using TL 2023 updated 2 days ago.

I've asked what I think is related to this problem here



With same bad display from bad svg images. Because the indent lines in
the above package uses tikz.

But Michal is not able to reproduce it on his computer.

Any suggestion what else to try?

Thanks
--Nasser


[tex4ht] [bug #613] Problem using tex4ht with algpseudocodex package when adding indent guide lines

2023-10-21 Thread Nasser M. Abbasi
URL:
  

 Summary: Problem using tex4ht with algpseudocodex package
when adding indent guide lines
 Project: tex4ht
Submitted by: nma123
Submitted on: Sat Oct 21 10:28:56 2023
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

reference and screen shots at 

https://tex.stackexchange.com/questions/699129/problem-using-tex4ht-with-algpseudocodex-package-when-adding-indent-guide-lines

When using https://ctan.org/pkg/algpseudocodex?lang=en with tex4ht and using
guide lines, then tex4ht generates image files which are empty or invalid and
this result on the web page that looks like this

enter image description here

While the pdf look like this

enter image description here

I am using latest TL 2023 updated now.

Here is the code for the above

---
\documentclass{article}
\usepackage{amsmath}
\usepackage[noEnd=false, indLines=true ]{algpseudocodex}
\usepackage{algorithm}

\begin{document}
\begin{algorithm}
\caption{Series method for first order ode}\label{seriesMethodFirstOrderOde}
\begin{algorithmic}[0]
\Require First order ode $F(x,y,y')=0$
%
\If{$f(x,y)$ analytic at $x_0$}
\State Apply Taylor series defintion directly to find the series
expansion. Let
\Else 
 \State do something else
\EndIf
\end{algorithmic}
\end{algorithm}
\end{document}
-

Compiled using

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

The solution is to replace indLines=true with indLines=false when compiling
with tex4ht. Now it gives this html

enter image description here

So the guide lines are giving tex4ht hard time. It is generating lots of empty
or invalid .svg images for these lines and that why the browser shows these
dots on the page.

Is it possible to have the guide line show in html also like in PDF? If not,
may be tex4ht can ignore this option?


TL 2023.





___

Reply to this item at:

  

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



Re: [tex4ht] How to add custom Css code into the configuration file? @media

2023-10-14 Thread Nasser M. Abbasi

On 10/14/2023 3:24 PM, Michal Hoftich wrote:

Hi Nasser,



It is because it is trying to copy the style file nma.css to the output 
directory!

And so ofcourse there is no folder /styles/css/ on the Linux disk. This is
meant only for the web server to use from its root public_html.



In this case, you can use this configuration instead:

\Configure{@HEAD}{}




Thanks Michal. THis is a very good solution. I removed \Configure{AddCss}
and replaced by the following:

You had small typo, I found I need \Hcode in there. So it is now

\Configure{@HEAD}{\HCode{}}

Now I can use output directory option and no files  needs to be copiled.


Why is make4ht trying to copy to the output_dir what is defined in 
\Configure{AddCss}?


Because that file is registered, and all registered files are copied
to the output directory.

Best regards,
Michal


Thanks
--Nasser


[tex4ht] How to only remove temporary files after calling make4ht to compile a file?

2023-10-14 Thread Nasser M. Abbasi



I can't figure after looking at https://texdoc.org/serve/make4ht/0  how to only
remove temporary files generated after calling make4ht to compile a file.

If I do

make4ht ...  index.tex
make4ht make4ht -m clean -a info index.tex

This will delete, not on the temporary files (index.log, index.idv, etc...)
but will also delete the html I just build !

Ofcourse, I could delete these files myself later, since I know
all the extensions of all these files.

But I think -m clean should really only delete the temporary
files generated from the compile step and nothing else. No images
and no .css and no htm files should be deleted.

Thank you,
--Nasser


Re: [tex4ht] How to add custom Css code into the configuration file? @media

2023-10-14 Thread Nasser M. Abbasi

On 8/30/2023 2:53 AM, Michal Hoftich wrote:

Hi Nasser,


Ok, fixed. Found my mistake. I forget to escape % and #
when I copied the code from the .css to try it in .cfg !

This now works in the .cfg.



In your case, you can use jurt \Configure{AddCss}{filename.css}. It
will include link to the CSS file, which you need to place somewhere.
The good thing is that you can use also URL. See
https://www.kodymirus.cz/tex4ht-doc/Configurations.html#document-styling-using-css
for more details.

Best regards,
Michal


Hello Michal;

I found small problem using \Configure{AddCss}{...}

I currently have this in my .cfg file

\Configure{AddCss}{/styles/css/nma.css}

Where /styles/css/ is folder that sits under the top of my server site. i.e.
in

public_html/styles/

This has been working great. In the HTML geneated I see it creates this HTML
in the header:



Everything is great so far. Web server can see nma.css since it is under
public_html on the server (external or local server on my PC).

But now I wanted to use --output-dir option for make4ht. But now it gives error

make4ht  --shell-escape -ulm default -d REPORT 

INFO]mkutils: Copy: cp "/styles/css/nma.css" "REPORT/styles/css"
[ERROR]   mkutils: File /styles/css/nma.css doesn't exist
cp: cannot stat '/styles/css/nma.css': No such file or directory

It is because it is trying to copy the style file nma.css to the output 
directory!

And so ofcourse there is no folder /styles/css/ on the Linux disk. This is
meant only for the web server to use from its root public_html.

Why is make4ht trying to copy to the output_dir what is defined in 
\Configure{AddCss}?

Is there a way to not make it not do that? As this file is meant to
be global file sitting in one place and accessed from each web page
and this has to work for when using --output-dir and when not using this option.

Any suggestions how to make this work for both options?

Thank you,
--Nasser




[tex4ht] [bug #612] tex4ht gives compile error when using transparent package

2023-10-13 Thread Nasser M. Abbasi
URL:
  

 Summary: tex4ht gives compile error when using transparent
package
 Project: tex4ht
Submitted by: nma123
Submitted on: Fri Oct 13 08:01:32 2023
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

Reference:

https://tex.stackexchange.com/questions/698403/tex4ht-gives-compile-error-when-using-transparent-package


I was trying https://ctan.org/pkg/transparent package. I get an error when
using it with tex4ht. Same code works OK in lualatex and pdf.

Is there a way to make it work with tex4ht? Here is MWE


\documentclass[12pt]{book}
\usepackage{graphicx}
\usepackage{transparent}
\begin{document} 

some text here

More text here

\transparent{1}\includegraphics[width=0.5\textwidth]{example-image-a}

More text here

More text here
\end{document}


Compiled using

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

gives

--
/usr/local/texlive/2023/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
(./foo2.aux) (/usr/local/texlive/2023/texmf-dist/tex/latex/base/ts1cmr.fd)
! Undefined control sequence.
l.12 \transparent
   {1}\includegraphics[width=0.5\textwidth]{example-image-a}
? 
-


TL 2023 on Linux.

--Nasser




___

Reply to this item at:

  

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



Re: [tex4ht] How to \includegraphics using absolute path with tex4ht?

2023-10-08 Thread Nasser M. Abbasi

May be even lua can be used to automatically convert absolute path in
\includegraphics to relative one?

\includegraphics[width=textwidth]{/mnt/g/public_html/my_notes/images/my_image}

to

\includegraphics[width=textwidth]{../../my_notes/images/my_image}

This will solve all the problem.




fyi;

It seems Lua has support for finding relative path given absolute one.
Here is one link among others I found

https://stackoverflow.com/questions/13224664/how-to-convert-absolute-path-in-relative-path-using-lua

May be this will make it easy to do this conversion automatically since
make4ht is written in lua?

--Nasser



Re: [tex4ht] How to \includegraphics using absolute path with tex4ht?

2023-10-08 Thread Nasser M. Abbasi

On 10/8/2023 5:38 AM, Nasser M. Abbasi wrote:

Is there a way to make copy_images adjust the "src=" automatically
to new copy location?



I think there is a better solution to all of this. no need
to copy images and do any of this.

There are tools that automatically converts absolute path to relative path.
I only use Linux to build.

https://stackoverflow.com/questions/2564634/convert-absolute-path-into-relative-path-given-a-current-directory-using-bash
https://unix.stackexchange.com/questions/522012/how-to-convert-absolute-path-to-relative-path

and so on.

So given the example I have

\includegraphics[width=textwidth]{/mnt/g/public_html/my_notes/images/my_image}

If make4ht can detect that the image path is absolute (i.e. it starts with /),
and since current directory is always known "." then it can do

realpath --relative-to=. /mnt/g/public_html/my_notes/images/my_image

To automatically generate relative path and use that in the src= for the image
which could look now something like

  src="../../my_notes/images/my_image.svg"

as an example. I just tried it on a real path and it works

-

pwd

/mnt/g/public_html/my_notes/solving_ODE/current_version/TESTS/bad_title


realpath --relative-to=.  
/mnt/g/public_html/my_notes/solving_ODE/current_version/images/king_billingham_otto_2003.svg


../../images/king_billingham_otto_2003.svg
-

May be even lua can be used to automatically convert absolute path in
\includegraphics to relative one?

\includegraphics[width=textwidth]{/mnt/g/public_html/my_notes/images/my_image}

to

\includegraphics[width=textwidth]{../../my_notes/images/my_image}

This will solve all the problem.

Thanks,
--Nasser



Re: [tex4ht] How to \includegraphics using absolute path with tex4ht?

2023-10-08 Thread Nasser M. Abbasi

On 6/20/2023 10:21 AM, Michal Hoftich wrote:

If it works for you, I can add it to make4ht as a new extension, so it
could be then enabled from the command line.


I've added a new extension to make4ht, copy_images. It should fix this issue.

Best regards,
Michal


Thanks Michal for adding copy_images,

I am trying this option now, but I do not think it is working.
If I can explain with an example:

I have this latex file

---
\documentclass[12pt]{book}
\usepackage{graphicx}
\begin{document}
\includegraphics[width=textwidth]{/mnt/g/public_html/my_notes/images/my_image}
\end{document}
-

Using absolute path for image. I compile using

make4ht -ulm default -d . foo.tex "mathjax,htm,nostyle,copy_images"

Where I said the output_dir is current directory. This is what  "-d ." for.

Then added "copy_images" extension.

I see that make4ht did copy the image tree to the local directory
correctly and now I have in the current directory this new tree
created

mnt/g/public_html/my_notes/images/my_image.svg

But the problem is that the HTML still has the absolute path in it!



So even though the image was copied to local directory, the
HTML itself still pointing the original image, and not
to the copied one.

Is one supposed to now edit the HTML and remove the first "/" from the src=
manually each time?

This is really a big problem for me. Since I have lots of images in
one central location and I need to include them from different places.
Using relative path is very hard to manage. An absolute path is
much easier to use.

If I copy an image to different place each time I need to include
it, then things will get out of sync very quickly and I will have
many copies all over the place.

Is there a way to make copy_images adjust the "src=" automatically
to new copy location?

Thanks
--Nasser







[tex4ht] [bug #610] How to use verbatimbox in tex4ht? Compile error. OK in pdf

2023-10-01 Thread Nasser M. Abbasi
URL:
  

 Summary: How to use verbatimbox in tex4ht? Compile error. OK
in pdf
 Project: tex4ht
Submitted by: nma123
Submitted on: Mon Oct  2 04:41:15 2023
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

reference and screen shots at

https://tex.stackexchange.com/questions/697413/how-to-use-verbatimbox-in-tex4ht-compile-error-ok-in-pdf


I found great solution in
https://tex.stackexchange.com/questions/216366/how-do-i-puttext-as-the-body-of-a-link/216380#216380
which allows one to use verbatim as second argument for href. It is the only
solution I found after trying many, where I can use verbatim as second
argument of href. (No, I do not want to use \url, I need to use href as I want
to use specific shorter target names, as the URL can be very long to use)

It worked in pdf. When I tried it in tex4ht I get a compile error. Here is
MWE

---
\documentclass[12pt,notitlepage]{article}
\usepackage{hyperref}
\usepackage{verbatimbox}

\begin{document} 

\begin{myverbbox}{\myTarget}https://some_url_with_^many_%*?_strange_characters/report.htm\end{myverbbox}

\href{https://some_url_with_^many_%*?_strange_characters/report.htm}{\myTarget}

\end{document}
--

This compiles in lualatex to pdf with no problem

enter image description here

But in tex4ht it gives error

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

...
(/usr/local/texlive/2023/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
(./main.aux) (/usr/local/texlive/2023/texmf-dist/tex/latex/base/ts1cmr.fd)
(/usr/local/texlive/2023/texmf-dist/tex/latex/lm/t1lmtt.fd)
! Missing \endcsname inserted.
 
\hbox 
l.59 ...strange_characters/report.htm\end{myverbbox}

Does tex4ht not support verbatimbox? How to make it work in tex4ht also?

TL 2023





___

Reply to this item at:

  

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



Re: [tex4ht] question on split levels for tex4ht

2023-10-01 Thread Nasser M. Abbasi

On 10/1/2023 7:41 AM, Michal Hoftich wrote:


But with the new option, one do not have to worry changing the command
to get the numbers right, if they change from article to
book.


I am not sure about this. If you take a look at the html4.4ht file,
you will find that the code for the numerical options is quite
complex. For example, search for \:CheckOption{7} and then try to find
\CheckOption{1}. It is quite a lot of code. And it is duplicated for
every document class. It would be another several hundreds of
kilobytes if we added that.

Best regards,
Michal


Hello Michal;

I was thinking this will just be a very thin API, where
only make4ht will handle, and simply process this option
split_at and determines the split number needed and then pass it
to tex4ht as before.

i.e. no code changes needed at all internally for tex4ht.
I was thinking make4ht will do something like (translate to lua code)

IF split_at="section" THEN
   IF article class THEN
  split =2
   ELIF book class THEN
  split = 3
   END IF
   ELIF split_at="subsection" THEN
  etc...
   END IF

And now make4ht will call tex4ht as before, nothing
changed. But using split number that was determined by the above code
so user does not have to figure it out.

I do not know how make4ht works, but I assume it takes all the
arguments passed from command line and passes these to
lower level calls to tex4ht? But maybe I was wrong about this.

Best
--Nasser





[tex4ht] question on split levels for tex4ht

2023-09-30 Thread Nasser M. Abbasi

Per post by Michal at

https://tex.stackexchange.com/questions/631604/how-to-split-an-article-at-the-subsubsection-level-using-tex4ht


For document classes with \chapter command:

1 - split at \part
2 - split at \chapter
3 - split at \section
4 - split at \subsection
5 - split at \subsubsection
6 - split at \paragraph

You stopped trying numbers too early. The numbers seem to work like this:

For document classes with \chapter command:

1 - split at \part
2 - split at \chapter
3 - split at \section
4 - split at \subsection
5 - split at \subsubsection
6 - split at \paragraph
For document classes without \chapter (like article):

1 - split at \part
2 - split at \section
3 - split at \subsection
5 - split at \subsubsection
6 - split at \paragraph
-

My question is: Why does in article, it skips split level 4, and
goes from 3 to 5? I find this confusing. May be there is reason
internally when tex4ht does this?

I'd like to suggest for some future version that this
option should be redone. May be add new option calling it
"split_at" so current method stays backward compatible.

The new option will have the form

   split_at="name"

where name can be "part" or "chapter" or "section" or "subsection"
and so on.

So one can now do

make4ht   foo.tex 'html,mathjax,split_at="section"'

If string does not work for value, it can just name, as in

make4ht   foo.tex 'html,mathjax,split_at=section'

Not only is this much more clear than

make4ht   foo.tex 'html,mathjax,3'

But with the new option, one do not have to worry changing the command
to get the numbers right, if they change from article to
book.

It is also much more clear looking at the command, where the split
will happen, since it is a name and not a magic number.

Thank you,
--Nasser




Re: [tex4ht] is it possible to have complete support for breqn package in tex4ht?

2023-09-25 Thread Nasser M. Abbasi

On 9/25/2023 1:00 PM, Michal Hoftich wrote:



Maybe the Breqn maintainers could find what is the issue, they
probably understand their code better than me. Well, I don't
understand it at all, I just tried to change some dimensions, because
I expected that it could help.



Hello Michal;

Fyi;

I just added an issue in breqn github asking for to see
if someone could help make breqn work with tex4ht and find
out why long equation do not break there.


https://github.com/wspr/breqn/issues/55

Thanks
--Nasser



Re: [tex4ht] is it possible to have complete support for breqn package in tex4ht?

2023-09-25 Thread Nasser M. Abbasi

On 9/25/2023 1:00 PM, Michal Hoftich wrote:

Only hope now is to wait to see if in the future mathjax would
implement breaking of long equation.


That would be ideal. Maybe you can try to ask what is the current progress.

Best,
Michal


Hello Michal;

I did ask about it 2 years ago

https://groups.google.com/g/mathjax-users/c/ZKHrwUZLWBI

And the answer was

"Note, however, that version 2 includes automatic line breaking,
and that that is already high on the list of things to do in
the coming year.  It does not operate quite the same as the
breqn package, and doesn't define the environments from that package.
Perhaps some more control over MathJax's line
breaking can be implemented when it is ported to v3."

I will make another attempt to try V 2 of mathjax. my .cfg
is full of mathjax V3 configuration, and they changed how
configuration is done from V2 to V3, so I need to spend more
time to see if I convert this back to V2.7 mathjax
and try it. Last night I spend 2 hrs and could not figure
what changes I need to make, it is just too complicated
all those options.

Best,
--Nasser


Re: [tex4ht] is it possible to have complete support for breqn package in tex4ht?

2023-09-25 Thread Nasser M. Abbasi

On 9/25/2023 4:39 AM, Michal Hoftich wrote:



Hopefully, they will manage to implement it, it would be impractical
to try to compile Breqn equations to images, and the rest of the math
to MathJax anyway.

Best, Michal


If breqn would work with svg, I was planning to stop using
mathjax and switch back to svg for math for everything ofcourse. This
is what I used to do few years ago.

I think the best solution is to convert PDF directly to HTML,
as https://wang-lu.com/pdf2htmlEX/  attempted to do.

It was very fast also. But too bad it is now another
abandoned open source project. It was very promising at
one point. But when I last tried it last time, graphics did not
convert well and had bad resolution.

I guess if you can't find why breqn does not work in tex4ht, then
no one else could :)

Only hope now is to wait to see if in the future mathjax would
implement breaking of long equation.

Best,
--Nasser



Re: [tex4ht] is it possible to have complete support for breqn package in tex4ht?

2023-09-25 Thread Nasser M. Abbasi



Yes, I also get math images in SVG with no problem with breqn with
tex4ht, but they are all long on same line. No automatic
breaking as happens in the PDF, and this defeats
the whole reason for using breqn which is automatic breaking
of long equations.

Mathjax had feature in 2.7 for automatic line breaking for displayed math:

https://docs.mathjax.org/en/v2.7-latest/output.html#automatic-linebreaking

"The CommonHTML, HTML-CSS, and SVG output processors implement (most of)
the MathML3 automatic line-breaking specification. (The NativeMML
output processor relies on the browser’s native MathML support
to handle line breaking when it is used.) Since line-breaking
takes extra processing and so can slow down the mathematical output,
it is off by default, but you can enable it by adding, e.g.,


MathJax.Hub.Config({
  CommonHTML: { linebreaks: { automatic: true } },
  "HTML-CSS": { linebreaks: { automatic: true } },
 SVG: { linebreaks: { automatic: true } }
});

"

But they removed this in V 3.0 of mathjax. I tried to go back
to V 2.7 to try it, but it broke many things in my .cfg file,
so I kept things at V 3 for now.

https://docs.mathjax.org/en/latest/output/linebreaks.html

"Automatic line breaking has not yet been implemented in MathJax
version 3, but is high on our list for inclusion in a future release."

It is strange they had it in V 2.7 but not in current mathjax
version. May be it had problems.

If Mathjax can implement automatic breaking for long equations
to fit in current web page width, then the problem is solved.

Now I set the page width to around 700px, so that
text lines are not too wide and easier to read (one is supposed
to have no more than 8-10 words per line for ease of reading),
but then the long math equations go over this limit many times
and by wide margin making the pages not good to look at.  So not
sure what the solution is for this now.

I can control the size of images and wide tables, but can't
control the long math equations really, as these are
auto-generated.

Thanks for looking at it Michal.

On 9/25/2023 3:08 AM, Michal Hoftich wrote:

Hi Nasser,


I was wondering how hard it will be to have tex4ht
support fully the breqn package directly? i.e. generate
same math as that in PDF for long equations (but in svg mode).



I've tried an older test file you sent me, and all Breqn equations
were converted to images by default. What doesn't seem to work is the
long line-breaking feature, which is a bit problematic. TeX4ht sets
long line widths by default, so I thought that this may be the
problem, but even if I set these widths to a much smaller size, the
line breaking doesn't seem to work:

\Preamble{xhtml}
\makeatletter
\AddToHook{env/dmath/before}{% test that line width is really small:
\typeout{*** linewidth: \the\linewidth, \the\eq@linewidth,
\the\displaywidth, \the\columnwidth}
}
\begin{document}
\textwidth=6em
\linewidth=\textwidth
\columnwidth=\textwidth
\eq@linewidth=\linewidth
\makeatother
\EndPreamble

I am not sure what is going on here, maybe Breqn uses also some other
dimensions or macros overridden by TeX4ht, so the line-breaking
doesn't work.

Best regards,
Michal




[tex4ht] is it possible to have complete support for breqn package in tex4ht?

2023-09-25 Thread Nasser M. Abbasi

Mathjax still does not support automatic breaking on long equations.
I do not think it will ever do that.

Currently tex4ht even when using svg (i.e. image for math, and
not mathjax), it does not support breqn package.

This means long equations look bad in HTML since they
exceed the width of the web page.

If tex4ht, using SVG for math, could generate images of
the equations the same as it looks in pdf with breqn, this
will make the pages look much better.

These equation are auto-generated from CAS systems
and not possible to manually breaking them each time
and many of them can be long. CAS system do not break
long equations themselves when they emit the Latex.

I was wondering how hard it will be to have tex4ht
support fully the breqn package directly? i.e. generate
same math as that in PDF for long equations (but in svg mode).

Thanks
--Nasser


[tex4ht] [bug #608] Adding hyperref package makes tex4ht change its split level order

2023-09-09 Thread Nasser M. Abbasi
URL:
  

 Summary: Adding hyperref package makes tex4ht change its
split level order
 Project: tex4ht
Submitted by: nma123
Submitted on: Sun Sep 10 01:53:10 2023
Category: None
Priority: 5 - Normal
Severity: 7 - Important
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

Reference and screen shots at 

https://tex.stackexchange.com/questions/695624/adding-hyperref-package-makes-tex4ht-change-its-split-level-order

I noticed big problem. When I was using split level on document, which should
split it at section level because I used level 2, it did not.

It turned out when I remove the hyperref, then it does the right thing and
split at section level.

See How to split an article at the subsubsection level using tex4ht? for
splitting levels.

Here is a MWE

-
\documentclass[12pt]{article}
\usepackage{hyperref}
 
\begin{document}
\section{section one}
text

\section{section two}
text
\end{document} 
-

Compiled using

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

gives this HTML

enter image description here

You see, it did not split the page. Now by just removing the
\usepackage{hyperref} and compiling again, it now gives this correct page,
where it puts each section on its own page

enter image description here

I checked this in TL 2023 and also in TL 2022.

No wonder I always had hard time with split levels with tex4ht. It works
different depending if \usepackage{hyperref} is used or not. To get it to
split at section level when hyperref is loaded, level 3 should be used and not
2. But this is all wrong. Splitting level should not be affected by loading
hyperref

Thanks
--Nasser




___

Reply to this item at:

  

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



Re: [tex4ht] How to add custom Css code into the configuration file? @media

2023-08-30 Thread Nasser M. Abbasi

On 8/30/2023 5:30 AM, Michal Hoftich wrote:


Yes, that's the main feature. \Css is meant mainly for smaller chunks
of code and for your custom tags. Design for the whole page is better
to be put in an external file. Another upside is that when you fix
something in the CSS, you don't need to recompile all documents.



Thanks. This is very useful. Being able to change css without having
to recompile everything, which for me takes days for large documents.
It will take me time to convert to this setup.

If anyone wants to use fixed width pages with tex4ht, here are my notes.

Need to be careful, and use max-width:960px; and not width: 960px;

I found this after spending 2 hrs trying to figure why my fixed page
width is less than 960px. To measure things in px on webpage, I used
Page Ruler tool (plugin for browsers)

It turned out that make4ht generates its own body
with this in the .css

body{ margin:1em auto; max-width:80ch; padding:0 .62em; }

The above is done automatically. So if you add your own body
specification in the .cfg or your own .css, the above will get
in the way if you use width: 960px; so you have to use max-width:960px; to
overwrite what tex4ht generates.

This is the final setting I have in case someone wants to try them, with link
to  a page I just build using this to see the result.

I think fixed size pages looks better, but need to remember to turn that off for
small screen sizes like mobile and pad computers and so on. I used 960px
for the cut-off. You can use anything else if you want, but it seems 960px
is what is recommended.

\Css{@media only screen and (min-width: 100px) and (max-width: 960px){
  body{margin-top: 1em;
  margin-bottom: 1em;
  width: auto;
  border: 1px solid \#D3D3D3;
  padding: 1em;
  max-width: 90\%;
  margin-left: auto;
  margin-right: auto;
  color: \#444;
  font-family: arial, sans-serif;
  line-height: 1.3;
  font-style: normal;
  font-size: 1.0em;
  text-align:justify; background: \#FF;}}}

\Css{@media only screen and (min-width: 960px){
  body{
  margin: 0 auto;
  margin-top: 10px;
  margin-bottom: 10px;
  border: 1px solid \#D3D3D3;
  padding: 1em;
%  width: 960px; %do not use! use max-width. tex4ht issue.
  max-width:960px;
  color: \#444;
  font-family: arial, sans-serif;
  line-height: 1.3;
  font-style: normal;
  font-size: 1.0em;
  text-align:justify;
  background: \#FF;}}}


Page that uses the above is

https://12000.org/my_notes/symmetry_in_ode/report.htm

compiled with make4ht with mathjax option.

Thanks to Michal for all his help.

--Nasser


But it is not clear from the docs you have, what the search path for
the filename.css is.

i.e. now I have one global .cfg file, inside my $texmf

 texmf/tex/latex/make4ht_cfg_folder/nma_mathjax.cfg

And when I compile using mak4ht ... -c nma_mathjax.cfg
from anywhere in the tree, make4ht finds it.

If I put my filename.css in the same folder as the .cfg, will
it also find it and read it during compile? Or does it have
to be in other location such as $HOME to see it?


TeX4ht doesn't read that file at all. It is declared as used, so when
you use the --output-dir option, TeX4ht will try to copy it to that
directory, but other than copying, it doesn't do anything.

As you want to use it on your webpage, I think you could place the CSS
file to a directory on your server, for example:

https://www.12000.org/css/design.css

You can then use

\Configure{AddCss}{/css/design.css}

Web browsers should find the file and use it, because they can use
relative addresses.


Best regards,
Michal




Re: [tex4ht] How to add custom Css code into the configuration file? @media

2023-08-30 Thread Nasser M. Abbasi

On 8/30/2023 2:53 AM, Michal Hoftich wrote:

Hi Nasser,


Ok, fixed. Found my mistake. I forget to escape % and #
when I copied the code from the .css to try it in .cfg !

This now works in the .cfg.



In your case, you can use jurt \Configure{AddCss}{filename.css}. It
will include link to the CSS file, which you need to place somewhere.
The good thing is that you can use also URL. See
https://www.kodymirus.cz/tex4ht-doc/Configurations.html#document-styling-using-css
for more details.

Best regards,
Michal


Thanks Michal. This is very useful. I did not know about

\Configure{AddCss}{filename.css}

This will make it easy to put all css code in there, so I do not
have to worry about escaping stuff.

But it is not clear from the docs you have, what the search path for
the filename.css is.

i.e. now I have one global .cfg file, inside my $texmf

   texmf/tex/latex/make4ht_cfg_folder/nma_mathjax.cfg

And when I compile using mak4ht ... -c nma_mathjax.cfg
from anywhere in the tree, make4ht finds it.

If I put my filename.css in the same folder as the .cfg, will
it also find it and read it during compile? Or does it have
to be in other location such as $HOME to see it?

Thanks
--Nasser



Re: [tex4ht] How to add custom Css code into the configuration file? @media

2023-08-30 Thread Nasser M. Abbasi

Ok, fixed. Found my mistake. I forget to escape % and #
when I copied the code from the .css to try it in .cfg !

This now works in the .cfg.

if anyone is interested. This allows the webpage generated by tex4ht
to have fixed width (which I prefer) but if viewed on mobile and small
screens, it will become flexible width to fit the current size.

 add this to your .cfg below \begin{document} section ---

\Css{@media only screen and (min-width: 100px) and (max-width: 960px){
  body{margin-top: 1em;
  margin-bottom: 1em;
  width: auto;
  max-width: 90\%;
  margin-left: auto;
  margin-right: auto; padding: 0em;
  color: \#444;
  font-family: arial, sans-serif;
  line-height: 1.3;
  font-style: normal;
  font-size: 1.0em;
  text-align:justify; background: \#FF;}}}

\Css{@media only screen and (min-width: 960px){
  body{margin-top: 1em;
  margin-bottom: 1em;
  width: 960px;
  margin-left: auto;
  margin-right: auto; padding: 0em;
  color: \#444;
  font-family: arial, sans-serif;
  line-height: 1.3;
  font-style: normal;
  font-size: 1.0em;
  text-align:justify; background: \#FF;}}}
---

Now when compiled, the index.css will have this

 index.css
@media only screen and (min-width: 100px) and (max-width: 960px){ 
body{margin-top: 1em; margin-bottom: 1em; width: auto; max-width: 90%; 
margin-left: auto; margin-right: auto; padding: 0em; color: #444; font-family: 
arial, sans-serif; line-height: 1.3; font-style: normal; font-size: 1.0em; 
text-align:justify; background: #FF;}}
@media only screen and (min-width: 960px){ body{margin-top: 1em; margin-bottom: 
1em; width: 960px; margin-left: auto; margin-right: auto; padding: 0em; color: 
#444; font-family: arial, sans-serif; line-height: 1.3; font-style: normal; 
font-size: 1.0em; text-align:justify; background: #FF;}}


Case closed.

THanks,
--Nasser

On 8/29/2023 11:46 PM, Nasser M. Abbasi wrote:

Opps, I copied the code with a missing ending extra } at the end.

Here is the correct code in cfg. It still gives same syntax error

--
\Css{@media only screen and (min-width: 100px) and (max-width: 960px) {
body{margin-top: 1em; margin-bottom: 1em; width: auto; max-width: 90%;
margin-left: auto; margin-right: auto; padding: 0em; color: #444;
font-family: arial, sans-serif; line-height: 1.5;
font-style: normal; font-size: 1.0em; text-align:justify; background: #FF;}
}}
-

Runaway argument?
{@media only screen and (min-width: 100px) and (max-width: 960px) { b\ETC.
! Paragraph ended before \Css was complete.

\par

I tried escaping it using  \@media but that did not work.

Thanks
--Nasser

On 8/29/2023 11:29 PM, Nasser M. Abbasi wrote:


I am trying to add this custom code into my .cfg file, using \Css{...}
that I always used, but it gives syntax error.


The code works fine if I add it manually to the index.css file
after compiling. But I need to put it to my .cfg file so it automatically
go inot each generated .css

The code is below. I got it from this web site

https://www.thatcompany.com/making-fixed-width-website-mobile-friendly

---

@media only screen and (min-width: 100px) and (max-width: 960px) {
body{margin-top: 1em; margin-bottom: 1em;
width: auto; max-width: 90%; margin-left: auto;
margin-right: auto; padding: 0em; color: #444;
font-family: arial, sans-serif; line-height: 1.5;
font-style: normal; font-size: 1.0em;
text-align:justify; background: #FF;}


in the .cfg file for tex4ht, I just added \Css{..} to the above giving

---
\Css{@media only screen and (min-width: 100px) and (max-width: 960px) {
body{margin-top: 1em; margin-bottom: 1em;
width: auto; max-width: 90%; margin-left: auto;
margin-right: auto; padding: 0em; color: #444;
font-family: arial, sans-serif; line-height: 1.5;
font-style: normal; font-size: 1.0em;
text-align:justify; background: #FF;}
}
-

But when I compile with make4ht, the error is

Runaway argument?
{@media only screen and (min-width: 100px) and (max-width: 960px) { b\ETC.
! Paragraph ended before \Css was complete.

\par


Is the problem the use of @ in media?

Thank you,
--Nasser










Re: [tex4ht] How to add custom Css code into the configuration file? @media

2023-08-29 Thread Nasser M. Abbasi

Opps, I copied the code with a missing ending extra } at the end.

Here is the correct code in cfg. It still gives same syntax error

--
\Css{@media only screen and (min-width: 100px) and (max-width: 960px) {
body{margin-top: 1em; margin-bottom: 1em; width: auto; max-width: 90%;
margin-left: auto; margin-right: auto; padding: 0em; color: #444;
font-family: arial, sans-serif; line-height: 1.5;
font-style: normal; font-size: 1.0em; text-align:justify; background: #FF;}
}}
-

Runaway argument?
{@media only screen and (min-width: 100px) and (max-width: 960px) { b\ETC.
! Paragraph ended before \Css was complete.

\par

I tried escaping it using  \@media but that did not work.

Thanks
--Nasser

On 8/29/2023 11:29 PM, Nasser M. Abbasi wrote:


I am trying to add this custom code into my .cfg file, using \Css{...}
that I always used, but it gives syntax error.


The code works fine if I add it manually to the index.css file
after compiling. But I need to put it to my .cfg file so it automatically
go inot each generated .css

The code is below. I got it from this web site

https://www.thatcompany.com/making-fixed-width-website-mobile-friendly

---

@media only screen and (min-width: 100px) and (max-width: 960px) {
body{margin-top: 1em; margin-bottom: 1em;
   width: auto; max-width: 90%; margin-left: auto;
   margin-right: auto; padding: 0em; color: #444;
   font-family: arial, sans-serif; line-height: 1.5;
   font-style: normal; font-size: 1.0em;
   text-align:justify; background: #FF;}


in the .cfg file for tex4ht, I just added \Css{..} to the above giving

---
\Css{@media only screen and (min-width: 100px) and (max-width: 960px) {
body{margin-top: 1em; margin-bottom: 1em;
   width: auto; max-width: 90%; margin-left: auto;
   margin-right: auto; padding: 0em; color: #444;
   font-family: arial, sans-serif; line-height: 1.5;
   font-style: normal; font-size: 1.0em;
   text-align:justify; background: #FF;}
}
-

But when I compile with make4ht, the error is

Runaway argument?
{@media only screen and (min-width: 100px) and (max-width: 960px) { b\ETC.
! Paragraph ended before \Css was complete.

\par


Is the problem the use of @ in media?

Thank you,
--Nasser








[tex4ht] How to add custom Css code into the configuration file? @media

2023-08-29 Thread Nasser M. Abbasi



I am trying to add this custom code into my .cfg file, using \Css{...}
that I always used, but it gives syntax error.


The code works fine if I add it manually to the index.css file
after compiling. But I need to put it to my .cfg file so it automatically
go inot each generated .css

The code is below. I got it from this web site

https://www.thatcompany.com/making-fixed-width-website-mobile-friendly

---

@media only screen and (min-width: 100px) and (max-width: 960px) {
body{margin-top: 1em; margin-bottom: 1em;
 width: auto; max-width: 90%; margin-left: auto;
 margin-right: auto; padding: 0em; color: #444;
 font-family: arial, sans-serif; line-height: 1.5;
 font-style: normal; font-size: 1.0em;
 text-align:justify; background: #FF;}


in the .cfg file for tex4ht, I just added \Css{..} to the above giving

---
\Css{@media only screen and (min-width: 100px) and (max-width: 960px) {
body{margin-top: 1em; margin-bottom: 1em;
 width: auto; max-width: 90%; margin-left: auto;
 margin-right: auto; padding: 0em; color: #444;
 font-family: arial, sans-serif; line-height: 1.5;
 font-style: normal; font-size: 1.0em;
 text-align:justify; background: #FF;}
}
-

But when I compile with make4ht, the error is

Runaway argument?
{@media only screen and (min-width: 100px) and (max-width: 960px) { b\ETC.
! Paragraph ended before \Css was complete.

\par


Is the problem the use of @ in media?

Thank you,
--Nasser






[tex4ht] [bug #606] tex4ht duplicates TOC in two columns in TL 2023 but OK in TL 2022. What changed?

2023-07-31 Thread Nasser M. Abbasi
URL:
  

 Summary: tex4ht duplicates TOC in two columns in TL 2023 but
OK in TL 2022. What changed?
 Project: tex4ht
Submitted by: nma123
Submitted on: Mon Jul 31 10:12:14 2023
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

Reference and screen shots at  

https://tex.stackexchange.com/questions/692383/tex4ht-duplicates-toc-in-two-columns-in-tl-2023-but-ok-in-tl-2022-what-changed

I found a problem in TL 2023 on same document and same command, where now
tex4ht duplicates the TOC in two columns instead of spreading the TOC over the
two columns as it always did before.

Same document, same command. So something changed. The question is how to make
it behave as it did in TL 2022? Do I need to change something in the command
or in the latex?

I have document where in HTML only, I wanted to make the TOC spread over 2
columns because it is very long so I am using multicol package. This has been
working ok for many years.

Here is MWE

---
\documentclass[12pt,titlepage]{article}
\usepackage{multicol}

\begin{document}
\title{my book}
\author{me}
\date{\today}
\maketitle

\ifdefined\HCode 
\Configure{tableofcontents*}{section}
\fi 

\ifdefined\HCode 
\begin{multicols}{2}
{
\tableofcontents
}
\end{multicols}
\else 
\tableofcontents
\fi 

\section{section 1}
text
\section{section 2}
text
\section{section 3}
text
\section{section 4}
text
\section{section 5}
text
\section{section 6}
text

\end{document}


Compiled using

make4ht -ulm default -a warning main.tex 
 'mathjax,htm,fn-in,0,notoc*,p-width,cut-fullname'

This is the output on a Linux running TL 2023

enter image description here

This is the output on a Linux still running TL 2022

enter image description here

Thanks
--Nasser





___

Reply to this item at:

  

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



[tex4ht] Unable to access tex4ht tracking bug site

2023-07-30 Thread Nasser M. Abbasi

This is fyi;

I wanted to enter a new bug for tex4ht, but I am not able to
access

https://puszcza.gnu.org.ua

it gives error

Failed to connect to database: php_network_getaddresses:
getaddrinfo failed: Temporary failure in name resolution
Please contact as soon as possible server
administrators g...@gnu.org.ua.
Until this problem get fixed, you will not be able to use this site.

regards,
--Nasser


[tex4ht] [bug #605] Large difference in spacing of TOC between book and article class

2023-07-25 Thread Nasser M. Abbasi
URL:
  

 Summary: Large difference in spacing of TOC between book and
article class
 Project: tex4ht
Submitted by: nma123
Submitted on: Tue Jul 25 20:52:47 2023
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

reference and screen shots at  

https://tex.stackexchange.com/questions/691986/large-difference-in-spacing-of-toc-between-book-and-article-class-with-tex4ht-h

Compare this TOC in book class with tex4ht

--
\documentclass[12pt]{article}
\setcounter{tocdepth}{5} % for main TOC must be in preamble
\setcounter{secnumdepth}{5}

\begin{document}
\title{my book}
\author{me}
\date{\today}
\maketitle

\tableofcontents

\section{section name}
section data
\subsection{subsection name}
subsection data
\subsubsection{subsubsection name}
subsubsection data
\paragraph{paragraph name}
paragraph data

\end{document}
-

Compiled with

make4ht -ulm default -a debug  main.tex 'mathjax,htm'

gives (showing only the TOC)

enter image description here

Notice the amount of shift to the right. Now compare with this MWE which is
the same but book class

--
\documentclass[12pt]{book}

\setcounter{tocdepth}{5} % for main TOC must be in preamble
\setcounter{secnumdepth}{5}

\begin{document}
\title{my book}
\author{me}
\date{\today}
\maketitle

\tableofcontents

\chapter{book name}
my book
\section{section name}
section data
\subsection{subsection name}
subsection data
\subsubsection{subsubsection name}
subsubsection data
\paragraph{paragraph name}
paragraph data   
\end{document}
-

Compiled using same command gives

enter image description here

I see two problems:

1. In first example above, the amount of shift to the right is too small, it
could be little larger, also the paragraph number which 1.1.1.1 is not shifted
to the right of the subsubsection

2. In book class, the amount of shift to the right is way too large compared
to the article class. It will be better if all classes have same amount of
shift in TOC. Notice that in book class the paragraph number is now shifted to
the right of the subsubsection, which is the correct way to do it, except the
shift is too large.

I just like to have nice looking TOC's, even in HTML and not just in PDF :)

Any suggestion how to fix the above two issues?

TL 2023

Thanks
--Nasser







___

Reply to this item at:

  

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



[tex4ht] [bug #604] tex4ht in TL 2023 broke something in handling breqn compared to TL 2022

2023-07-22 Thread Nasser M. Abbasi
URL:
  

 Summary: tex4ht in TL 2023 broke something in handling breqn
compared to TL 2022
 Project: tex4ht
Submitted by: nma123
Submitted on: Sat Jul 22 13:41:10 2023
Category: None
Priority: 5 - Normal
Severity: 7 - Important
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

Reference and screen shots at

https://tex.stackexchange.com/questions/691737/tex4ht-in-tl-2023-broke-something-in-handling-breqn-compared-to-tl-2022


This MWE compiled under TL 2022 gives correct output, while using same command
and same configuration file, under TL 2023 gives wrong output.

Here is MWE
--
\documentclass[12pt]{book}
\usepackage{amsmath}
\usepackage{breqn}
\begin{document}
\begin{dgroup*} 
\begin{dmath}[number=1]
\sin x = 1
\end{dmath} 
\begin{dmath}[number=2]
\sin x = 1
\end{dmath} 
\end{dgroup*} 

\begin{dgroup*}
\begin{dmath*}
   A = B
\end{dmath*}  
\begin{dmath*}
   C = D
\end{dmath*}
\end{dgroup*}
\end{document}


Compiled using

>which make4ht
/usr/local/texlive/2022/bin/x86_64-linux/make4ht

and

make4ht -ulm default -a warning -c nma_mathjax.cfg  main.tex 'mathjax,htm'

This is the output under TL 2022 on Linux

enter image description here

This is the output under TL 2023 on Linux

>which make4ht
/usr/local/texlive/2023/bin/x86_64-linux/make4ht

and

>make4ht -ulm default -a warning -c nma_mathjax.cfg  main.tex 'mathjax,htm'

enter image description here

Btw, this is old problem which was fixed in TL 2022. Here is the link to
original question about it 

https://tex.stackexchange.com/questions/620104/error-using-ifdefined-hcode-with-tex4ht-but-it-works-in-luatex


Here is my .cfg file used in the above command


\Preamble{xhtml,p-width}
\Configure{MathjaxSource}{}
\Configure{MathjaxSource}{https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js}
   
%V3.0
\Configure{MathJaxConfig}{{  
  tex: {
tags: "ams",
maxBuffer: 40*1024,
packages: {'[+]': ['textmacros']},
\detokenize{% 
  environments: {
"dgroup*": ["", ""],
"dmath*": ["", ""],
"dgroup": ["", ""],
"dmath": ["", ""]
  }}, 
\unexpanded{%
macros: {  
sp: "^",
sb: "_",  
  noalign: ["\#1", 1],
}},
autoload: {
  color: [],
  colorV2: ['color']
},
packages: {'[+]': ['noerrors','textmacros']}
  },
  options: {
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process'
  },
  loader: {
load: ['[tex]/noerrors','[tex]/textmacros']
  }
};
}
%see
https://tex.stackexchange.com/questions/620104/error-using-ifdefined-hcode-with-tex4ht-but-it-works-in-luatex/620138?noredirect=1#comment1548405_620138
%IMPORTANT. Need also .config folder in my HOME folder for this to work.
\VerbMath{dgroup*}
\VerbMath{dmath*}
\VerbMath{dgroup}
\VerbMath{dmath}

%see
https://tex.stackexchange.com/questions/669770/problem-2-after-updating-to-latest-tl-2022-all-math-in-chapter-or-section-titl
\fixmathjaxtoc\left
\fixmathjaxtoc\right

\begin{document}
\EndPreamble
-

What do I need to change to make it work again in TL 2023 same as under TL
2022?

Thanks
--Nasser






___

Reply to this item at:

  

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



Re: [tex4ht] Using texfot with make4ht, how to make it stop at error in compiling?

2023-06-27 Thread Nasser M. Abbasi

On 6/27/2023 3:42 PM, Karl Berry wrote:

Hi Nasser - all texfot does is run the command as specified. From your
tex.sx question and Michal's answers, it looks like the differences in
behavior are due to -a warning vs. -a debug?



What I really do not understand is this:

When using `-a debug` then make4ht stops at first error:

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

But when wrapping the call by texfot then it does not stop at error

  texfot --tee=/dev/null --ignore="Overfull"
 make4ht -ulm default -a debug a.tex "mathjax,htm"

My question is why?

Should not the whole command stop at first error also when
adding texfot?


It seems like there should be a way to get make4ht to keep the output
and still stop on error, but that's up to Michal. Specify -a warning
and also errorstopmode somehow? (And not need to use texfot.) Or
-a debug and errorstopmode?

In any event, it also seems like make4ht should notice the bad exit
status from the first run of htlatex and not run a second time
regardless of any warning levels. Or is htlatex not exiting with bad
status?

I don't think this this will solve your problem, but by the way, I
suggest redirecting input from 

Thanks
--Nasser


[tex4ht] Using texfot with make4ht, how to make it stop at error in compiling?

2023-06-27 Thread Nasser M. Abbasi

I am back to using the nice package texfot by Karl Berry to help reduce
amount of display on the screen.

https://ctan.org/pkg/texfot?lang=en

Here is background: I wanted first to use `-a warning` with
make4ht to reduce the output on screen, but the side effect
of this is that it no longer stops on error.  I asked
about this here:

https://tex.stackexchange.com/questions/689582/using-a-warning-in-make4ht-does-not-stop-at-first-error

So I have to use `-a debug` as I must stop my build on error.

But the output is too much and slows the build and makes it
hard to see where it is by looking at monitor.

So I changed to using texfot which does reduce the output alot and
I still can use `-a debug` with make4ht. But now I find
it also does not stop on error.

It keeps going, compiling one more time. Same when using `-a warning`.

Is there a way to use texfot but make it stop on first error?

Here is MWE, with an error in it

\documentclass[12pt]{book}
\usepackage{graphicx}
\begin{document}
My document
\includegraphics[width=\textwidth]{ZZZ}%file does not exist
\end{document
--

When I compile without texfot and using `-a debug` it stops
on error which is what I want

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

! LaTeX Error: File `ZZZ' not found.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H   for immediate help.
 ...
  
l.15 \includegraphics[width=\textwidth]{ZZZ}

  %file does not exist
?

-

When I use texfot it does not stop on error (command all on one line)

--
texfot --tee=/dev/null --ignore="Overfull"
make4ht -ulm default -a debug a.tex "mathjax,htm"

/usr/local/texlive/2022/bin/x86_64-linux/texfot: invoking: make4ht -ulm default 
-a debug a.tex mathjax,htm
This is LuaTeX, Version 1.15.1 (TeX Live 2023/dev)
l.864 --- TeX4ht warning --- nonprimitive \everypar ---
l.12 --- TeX4ht warning --- File `"B//image.xbb"' not found ---
l.12 --- TeX4ht warning --- Cannot determine size of graphic in "B//image.xbb"
! LaTeX Error: File `ZZZ' not found.

l.15 \includegraphics[width=\textwidth]{ZZZ}
! Emergency stop.
 ...
l.15 \includegraphics[width=\textwidth]{ZZZ}
!  ==> Fatal error occurred, bad output DVI file produced!
No pages of output.
[FATAL]   make4ht-lib: Fatal error. Command htlatex returned exit code 1





You see from above, it compiled again and again.

So I am back to square one. Same issue as if I use `-a warning`,
it keeps running, here is output with `-a warning`

-
make4ht -ulm default -a warning a.tex "mathjax,htm"

[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename LineMessage
[ERROR]   htlatex: ./a.tex  15   LaTeX Error: File `ZZZ' not found.

[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename LineMessage
[ERROR]   htlatex: ./a.tex  15   LaTeX Error: File `ZZZ' not found.

[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename LineMessage
[ERROR]   htlatex: ./a.tex  15   LaTeX Error: File `ZZZ' not found.


The question is: is there a way to make texfot stop on first error?

I need to do this, as my build takes long time and I need to stop if
error shows up to save time and not wait to the end to find out my
build was not completed correctly.

Too much output is not only slowing the build, it makes it very
hard to see where it is by looking at screen now.

Any ideas?

Thank you,
--Nasser




[tex4ht] How to \includegraphics using absolute path with tex4ht?

2023-06-17 Thread Nasser M. Abbasi



I have to use an absolute path for my graphics, because the
code is generated by a program, and the resulting index.tex can
be in different locations in the tree, while the image location
is fixed at once place at root of the tree.

So hard to make it relative to each generated index.tex since the tree
has many branches and different depths.

This causes no problem with pdf generation, since the image is put
inside the pdf file during compile time. So when viewing the
completed PDF, the image is inside the PDF already.

But with HTML, a reference is put in the web page. Hence when
loading the page from different places, it can't find
the image, since HTML will have something like this



And it can't find it of course. I compile on Linux, view on windows. And on
the server this path makes no sense.  Even if I use

src='/images/image.svg'

i.e. relative to public_html/, it still does not see it on windows.

How can one then use absolute path for an image when compiling to HTML?

Normally, I have the image in a folder inside the same folder I am
building the HTML, so it was never a problem. So the HTML would
have this



And now it can find the image, since the images/ folder is in same folder
where the web page is. But now I want to use images at different location
but use absolute path for the image when compiling.

Any suggestions or workaround this? I really do not want to make copies
of the image in 100 different locations to workaround this.

Thanks
--Nasser


Re: [tex4ht] [bug #592] inconsistent font sizes used for subsubsection/paragraph titles in tex4ht. How to fix?

2023-01-01 Thread Nasser M. Abbasi

On 1/1/2023 3:33 PM, Karl Berry wrote:

Follow-up Comment #2, bug #592 (project tex4ht):

To my mind, this is a bug in the browser(s). Browsers should not render any
 tag as less than the body size. That's nonsensical.

But given that reality, and that it's unlikely to change, my suggestion for
tex4ht is to avoid h5 and h6, since they are useless, and just use h4 for all
those lower-level sectioning elements. Maybe with a class="subsubsection" or
whatever so they can be distinguished if anyone cares to.

This seems cleaner to me than specifying explicit sizes for everything.



Hello;

I looked this up and it says

http://zuga.net/articles/html-heading-elements/

"The W3C HTML5 specification describes six HTML
heading elements: h1, h2, h3, h4, h5 and h6.  ref
The height of a heading element is specified in the
browser's default stylesheet. See col 4 below.  ref

The height of 1 em is usually 16 pixels.

The em is a unit of measure from the field of printed type,
and is equal to the width of the letter M"

And then it gives table of example header for each hN with default
size.

h1  font-size: 2em
h2  font-size: 1.5em
h3  font-size: 1.17em
h4  font-size: 1em
h5  font-size: .83em
h6  font-size: .67em

I've compile the MWE with only Michal fix in my.cfg and this is the result
to compare the font sizes with normal text font ib body

https://12000.org/tmp/01012023/foo.htm

Looking at it, it looks like font for paragprah is same size
as the text font size body of page but in bold font.

This look OK, right?

--Nasser


Re: [tex4ht] [bug #592] inconsistent font sizes used for subsubsection/paragraph titles in tex4ht. How to fix?

2023-01-01 Thread Nasser M. Abbasi

On 1/1/2023 2:49 PM, Michal Hoftich wrote:

as it is
preferable if users set high level design elements themselves


The way I look at it, I use tex4ht to convert latex to HTML
so I do not have to know any HTML or Css commands.

So the more this process is automated, with as little need for
one to add any special extra HTML/Css code themselves, the
better it is. I know sometimes this is not possible all the time.

(99.99% of Latex users would not know these Css commands anyway)

So if this fix could be automated/buildin in tex4ht, that
would be better I think.

Is the issue is what font sizes to use?  Will not your nice
solution which I tested on small document and now testing on
a very large document

\Css{.partHead { font-size: 2em; }}
\Css{.chapterHead { font-size: 1.7411em; }}
\Css{.sectionHead { font-size: 1.5157em; }}
\Css{.subsectionHead { font-size: 1.3195em; }}
\Css{.subsubsectionHead { font-size: 1.1487em; }}

work for all cases?

or do you mean this might not be a universal solution?
If not, then the user can override it if they want in the
.cfg file they use. Right?

So why not have it build-in?  This way every user gets
the benefit of it.

Thank you,
--Nasser




Re: [tex4ht] [bug #592] inconsistent font sizes used for subsubsection/paragraph titles in tex4ht. How to fix?

2023-01-01 Thread Nasser M. Abbasi



copy/paste error. Forgeot the document class when copying.

MWE should be

--
\documentclass{book}

\setcounter{tocdepth}{5}
\setcounter{secnumdepth}{5}

\begin{document}
\title{my book title}
\author{me}
\date{\today}
\maketitle

\part{first part}
\chapter{first chapter}
\section{first section}
\subsection{first subsection}
\subsubsection{first subsubsection}
\paragraph{first paragraph}

\end{document}
-

On 1/1/2023 12:28 PM, Nasser M. Abbasi wrote:

URL:
   <http://puszcza.gnu.org.ua/bugs/?592>

  Summary: inconsistent font sizes used for
subsubsection/paragraph titles in tex4ht. How to fix?
  Project: tex4ht
 Submitted by: nma123
 Submitted on: Sun Jan  1 18:28:48 2023
 Category: None
 Priority: 5 - Normal
 Severity: 5 - Normal
   Status: None
  Privacy: Public
  Assigned to: None
 Originator Email:
  Open/Closed: Open
  Discussion Lock: Any

 ___

Details:


Reference and screen shot at

https://tex.stackexchange.com/questions/670328/inconsistent-font-sizes-used-for-subsubsection-paragraph-titles-in-tex4ht-how-t

I noticed in tex4ht that the size of the font used for the paragraph title is
the same as that of the section title (i.e. too large) and the size of the
font for the subsubsection is smaller than that used for the paragraph, which
it should be larger or at least the same size.

This makes looking at titles confusing as font size gives indication of
order.

The font size should decrease all the way from chapter to paragraph. Now it
decreases but then starts to increase once it reaches paragraph.

in PDF, it is consistent, as the sizes decrease correctly from chapter to
paragraph. Screen shots below

MWE

--
\begin{document}
\title{my book title}
\author{me}
\date{\today}
\maketitle

\part{first part}
\chapter{first chapter}
\section{first section}
\subsection{first subsection}
\subsubsection{first subsubsection}
\paragraph{first paragraph}

\end{document}
---


Compiled using

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

Gives

   enter image description here

Compare to the pdf where the sizes decreases uniformly (but hard to see if
font used for paragraph is smaller or same as subsubsection, but at least it
is not larger like with the HTML)

   enter image description here

Question is: How to make the size of the font used for paragraph title with
tex4ht not be larger than subsubsection? Is there a way to control these
settings?

TL 2022





 ___

Reply to this item at:

   <http://puszcza.gnu.org.ua/bugs/?592>

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





[tex4ht] [bug #592] inconsistent font sizes used for subsubsection/paragraph titles in tex4ht. How to fix?

2023-01-01 Thread Nasser M. Abbasi
URL:
  

 Summary: inconsistent font sizes used for
subsubsection/paragraph titles in tex4ht. How to fix?
 Project: tex4ht
Submitted by: nma123
Submitted on: Sun Jan  1 18:28:48 2023
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:


Reference and screen shot at

https://tex.stackexchange.com/questions/670328/inconsistent-font-sizes-used-for-subsubsection-paragraph-titles-in-tex4ht-how-t

I noticed in tex4ht that the size of the font used for the paragraph title is
the same as that of the section title (i.e. too large) and the size of the
font for the subsubsection is smaller than that used for the paragraph, which
it should be larger or at least the same size.

This makes looking at titles confusing as font size gives indication of
order.

The font size should decrease all the way from chapter to paragraph. Now it
decreases but then starts to increase once it reaches paragraph.

in PDF, it is consistent, as the sizes decrease correctly from chapter to
paragraph. Screen shots below

MWE

--
\begin{document}
\title{my book title}
\author{me}
\date{\today}
\maketitle

\part{first part}
\chapter{first chapter}
\section{first section}
\subsection{first subsection}
\subsubsection{first subsubsection}
\paragraph{first paragraph}

\end{document}
---


Compiled using

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

Gives

  enter image description here

Compare to the pdf where the sizes decreases uniformly (but hard to see if
font used for paragraph is smaller or same as subsubsection, but at least it
is not larger like with the HTML)

  enter image description here

Question is: How to make the size of the font used for paragraph title with
tex4ht not be larger than subsubsection? Is there a way to control these
settings?

TL 2022





___

Reply to this item at:

  

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



[tex4ht] [bug #591] adding \fbox around \includegraphics makes it lose the centering when using tex4ht

2022-12-30 Thread Nasser M. Abbasi
URL:
  

 Summary: adding \fbox around \includegraphics makes it lose
the centering when using tex4ht
 Project: tex4ht
Submitted by: nma123
Submitted on: Fri Dec 30 23:14:21 2022
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

reference and screen shots at

https://tex.stackexchange.com/questions/670174/why-adding-fbox-around-includegraphics-makes-it-lose-the-centering-when-using

In tex4ht, when doing


\centering
\includegraphics[width=0.6\textwidth]{example-image-a}

The image comes out centered. But when adding fbox, the images no longer is
centered

\centering
\fbox{\includegraphics[width=0.6\textwidth]{example-image-a}}

I was not sure if this is by design or if it should remain centered. It does
remain centered in pdf. Here is MWE

---
\documentclass{article}
\usepackage{amsmath} 
\usepackage{graphicx}
\usepackage{hyperref}

\begin{document}

\begin{figure}
\centering
\includegraphics[width=0.6\textwidth]{example-image-a}
\caption{Phase plot}
\end{figure}

\end{document}
--

Compiled using

make4ht -ulm default -a debug  foo.tex 'mathjax,htm'
gives image centered ok.

(btw, I never figured out how to make TL testimages show up as the true image
on my system with tex4ht. They always show as PIC, but using actual image I
have, same problem show up).

Now when adding \fbox{} around the includegraphics here is the result

 enter image description here

But in PDF, it remains centered even when adding \fbox

 enter image description here

TL 2022 on Linux. Updated as of 12/29/2022






___

Reply to this item at:

  

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



[tex4ht] [bug #590] tex4ht fails when adding \centering after \begin{figure}

2022-12-29 Thread Nasser M. Abbasi
URL:
  

 Summary: tex4ht fails when adding \centering after
\begin{figure}
 Project: tex4ht
Submitted by: nma123
Submitted on: Fri Dec 30 01:56:27 2022
Category: None
Priority: 5 - Normal
Severity: 7 - Important
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:


Reference:

https://tex.stackexchange.com/questions/670089/tex4ht-fails-when-adding-centering-after-beginfigure

This is related to 

https://tex.stackexchange.com/questions/669581/tex4ht-fails-on-including-image-with-math-in-caption-after-loading-hyperref-pack

but now fails under new conditions.

This is summary of what is going on. There was a bug in the above link where
tex4ht failed when adding math in the caption of the image when hyperref was
loaded. Thanks to michal.h21 this is fixed now in latest TL as I no longer get
the error using the MWE in the above, which is

-
\documentclass{article}
\usepackage{amsmath} 
\usepackage{graphicx}
\usepackage{hyperref}

\begin{document}

\begin{figure}
\includegraphics[width=0.5\textwidth]{example-image-a}
\caption{Phase plot $y^{\prime \prime}\left(t \right)+9 y \left(t
\right)-\left(\left\{\begin{array}{cc}
8 \sin \left(t \right) & 0 
\par 
l.15 \end{array}\right.\right) = 0$}
  
? 

Which is the same error fixed in the earlier question linked above.

Any workaround for this problem as I use \centering in my code.

TL 2022 Updated just 1/2 hr ago.

>which make4ht
/usr/local/texlive/2022/bin/x86_64-linux/make4ht
>make4ht --version
make4ht version v0.3l
>which tex4ht
/usr/local/texlive/2022/bin/x86_64-linux/tex4ht





___

Reply to this item at:

  

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



Re: [tex4ht] [bug #589] tex4ht no longer shows table of content when using split level

2022-12-26 Thread Nasser M. Abbasi

The title of this bug should be

"All math in chapter or section titles is messed up now"

I copied the wrong title from the last bugI entered.

I did not know how to change it in https://puszcza.gnu.org.ua/bugs/?589
after that.

If someone knows how to edit the bug and change the summary to the above
that will be good.

Thanks
--Nasser


On 12/26/2022 8:37 PM, Nasser M. Abbasi wrote:

URL:
   <http://puszcza.gnu.org.ua/bugs/?589>

  Summary:  tex4ht no longer shows table of content when using
split level
  Project: tex4ht
 Submitted by: nma123
 Submitted on: Tue Dec 27 02:37:27 2022
 Category: None
 Priority: 5 - Normal
 Severity: 5 - Normal
   Status: None
  Privacy: Public
  Assigned to: None
 Originator Email:
  Open/Closed: Open
  Discussion Lock: Any

 ___

Details:

reference and screen shots at

https://tex.stackexchange.com/questions/669770/problem-2-after-updating-to-latest-tl-2022-tex4ht-no-longer-shows-table-of-con

I found that a problem in math generated after updated to latest TL. All math
in chapter or section titles is messed up now. This used to show up OK before
I updated to TL.

The math which is not in section or chapter title still shows OK. But why?

Here is a MWE


\documentclass[12pt]{book}%
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{hyperref}

\begin{document}

\frontmatter
\title{my book title}
\author{me}
\date{\today}
\maketitle

\ifdefined\HCode
\Configure{tableofcontents*}{chapter}
\TocAt{chapter,section}
\TocAt{section,subsection}
\TocAt{subsection,subsubsection}
\TocAt{subsubsection,paragraph}
\fi

\tableofcontents
\mainmatter

\chapter{First order ode $F\left(  x,y,y^{\prime}\right)  =0$}%

The equation is  $F\left(  x,y,y^{\prime}\right)  =0$

\section{First order linear in derivative $F\left(
x,y,y^{\prime}\right)=0$}%
These are first order ode's which are linear in $y^{\prime}$.
\subsection{Quadrature ode $y^{\prime}=f\left(  x\right)  $}
data
\subsubsection{Introduction}
data
\end{document}
-

Compiled using

  make4ht -ulm default -a debug  index.tex 'mathjax,htm'

This is the HTML (see screen shot)

Notice all those \o stuff. Before updated TL this all worked OK and the math
showed up OK in section and chapter titles. So something changed.

This is the raw HTML

-


my book title





window.MathJax = { tex: { tags: "ams", }, }; 
  




my book title
me
December 26,
2022

Contents

1 First order ode \(F\o:left: ( x,y,y^{\prime }\o:right: )
=0\)



Chapter 1First order ode
\(F\left ( x,y,y^{\prime }\right ) =0\)

  1.1 First
order linear in derivative \(F\o:left: ( x,y,y^{\prime }\o:right:
)=0\)

   The equation is \(F\left ( x,y,y^{\prime
}\right ) =0\)

1.1First order linear in
derivative \(F\left ( x,y,y^{\prime }\right )=0\)

   1.1.1 Quadrature ode \(y^{\prime }=f\o:left: ( x\o:right: )
\)

   These are first order ode’s which are
linear in \(y^{\prime }\).

1.1.1Quadrature ode
\(y^{\prime }=f\left ( x\right ) \)

Introduction

   data

Introduction


   data

  



---

Using


which tex4ht

/usr/local/texlive/2022/bin/x86_64-linux/tex4ht

make4ht --version

make4ht version v0.3l










 ___

Reply to this item at:

   <http://puszcza.gnu.org.ua/bugs/?589>

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





[tex4ht] [bug #589] tex4ht no longer shows table of content when using split level

2022-12-26 Thread Nasser M. Abbasi
URL:
  

 Summary:  tex4ht no longer shows table of content when using
split level
 Project: tex4ht
Submitted by: nma123
Submitted on: Tue Dec 27 02:37:27 2022
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

reference and screen shots at

https://tex.stackexchange.com/questions/669770/problem-2-after-updating-to-latest-tl-2022-tex4ht-no-longer-shows-table-of-con

I found that a problem in math generated after updated to latest TL. All math
in chapter or section titles is messed up now. This used to show up OK before
I updated to TL.

The math which is not in section or chapter title still shows OK. But why?

Here is a MWE


\documentclass[12pt]{book}%
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{hyperref}

\begin{document}

\frontmatter
\title{my book title}
\author{me}
\date{\today}
\maketitle

\ifdefined\HCode 
\Configure{tableofcontents*}{chapter}   
\TocAt{chapter,section}
\TocAt{section,subsection}
\TocAt{subsection,subsubsection}
\TocAt{subsubsection,paragraph}
\fi 

\tableofcontents
\mainmatter

\chapter{First order ode $F\left(  x,y,y^{\prime}\right)  =0$}%

The equation is  $F\left(  x,y,y^{\prime}\right)  =0$

\section{First order linear in derivative $F\left( 
x,y,y^{\prime}\right)=0$}%
These are first order ode's which are linear in $y^{\prime}$.
\subsection{Quadrature ode $y^{\prime}=f\left(  x\right)  $}
data
\subsubsection{Introduction}
data
\end{document}
-

Compiled using

 make4ht -ulm default -a debug  index.tex 'mathjax,htm'

This is the HTML (see screen shot)

Notice all those \o stuff. Before updated TL this all worked OK and the math
showed up OK in section and chapter titles. So something changed.

This is the raw HTML

-
 
 
my book title 
 
 
 
 
 
window.MathJax = { tex: { tags: "ams", }, };  
   


   

my book title
me
December 26,
2022

Contents
   
1 First order ode \(F\o:left: ( x,y,y^{\prime }\o:right: )
=0\)


   
Chapter 1First order ode
\(F\left ( x,y,y^{\prime }\right ) =0\)
   
 1.1 First
order linear in derivative \(F\o:left: ( x,y,y^{\prime }\o:right:
)=0\)

   The equation is \(F\left ( x,y,y^{\prime
}\right ) =0\)
   
1.1First order linear in
derivative \(F\left ( x,y,y^{\prime }\right )=0\)
   
  1.1.1 Quadrature ode \(y^{\prime }=f\o:left: ( x\o:right: )
\)

   These are first order ode’s which are
linear in \(y^{\prime }\).
   
1.1.1Quadrature ode
\(y^{\prime }=f\left ( x\right ) \)
   
   Introduction

   data
   
Introduction
   

   data
   
 
 

---

Using

>which tex4ht
/usr/local/texlive/2022/bin/x86_64-linux/tex4ht
>make4ht --version
make4ht version v0.3l










___

Reply to this item at:

  

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



[tex4ht] [bug #588] After updating to latest TL 2022. tex4ht no longer shows table of content when using split level

2022-12-26 Thread Nasser M. Abbasi
URL:
  

 Summary: After updating to latest TL 2022. tex4ht no longer
shows table of content when using split level
 Project: tex4ht
Submitted by: nma123
Submitted on: Tue Dec 27 02:26:11 2022
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

Reference and screen shots at

https://tex.stackexchange.com/questions/669769/problem-1-after-updating-to-latest-tl-2022-tex4ht-no-longer-shows-table-of-con


I found two big problems so far after I just updated to latest TL 2022 2 hrs
ago.

So I will post two separate questions on these. If I find more, will add
separate questions.

I found that table of content no longer shows up on the webpage when using
split level. The index.htm has basically an empty body.

If I do not use split level, then it does show. But this is not how it is
supposed to be.

Here is a MWE

---
\documentclass[12pt]{book}%
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{hyperref}

\begin{document}

\frontmatter
\title{my book title}
\author{me}
\date{\today}
\maketitle

\ifdefined\HCode 
\Configure{tableofcontents*}{chapter}   
\TocAt{chapter,section}
\TocAt{section,subsection}
\TocAt{subsection,subsubsection}
\TocAt{subsubsection,paragraph}
\fi 

\tableofcontents
\mainmatter

\chapter{First order ode $F\left(  x,y,y^{\prime}\right)  =0$}%
data
\section{First order linear in derivative $F\left( 
x,y,y^{\prime}\right)=0$}%
These are first order ode's which are linear in $y^{\prime}$.
\subsection{Quadrature ode $y^{\prime}=f\left(  x\right)  $}
data
\subsubsection{Introduction}
data
\end{document}
---

Compiled using

 make4ht -ulm default -a debug  index.tex 'mathjax,htm,4'

This is the HTML generated (no table of content)


This is the raw html

---

 
 
my book title 
 
 
 
 
 
window.MathJax = { tex: { tags: "ams", }, };  
   


   

my book title
me
December 26,
2022
  

 

-

You can see, empty body. This happens when asking for a split level. changing
4 to 3 or 2 in the command

 make4ht -ulm default -a debug  index.tex 'mathjax,htm,4'

makes no difference. Main page is empty. So something went badly wrong
somewhere.

>which tex4ht
/usr/local/texlive/2022/bin/x86_64-linux/tex4ht
>make4ht --version
make4ht version v0.3l







___

Reply to this item at:

  

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



[tex4ht] [bug #587] tex4ht fails on including image with math in caption after loading hyperref package

2022-12-24 Thread Nasser M. Abbasi
URL:
  

 Summary: tex4ht fails on including image with math in caption
after loading hyperref package
 Project: tex4ht
Submitted by: nma123
Submitted on: Sun Dec 25 03:16:52 2022
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:


reference 

https://tex.stackexchange.com/questions/669581/tex4ht-fails-on-including-image-with-math-in-caption-after-loading-hyperref-pack

his MWE compiles OK with lualatex but fails in tex4ht once hyperref is added.

---
\documentclass{article}
\usepackage{amsmath} 
\usepackage{graphicx}
\usepackage{hyperref}

\begin{document}

\begin{figure}
\includegraphics[width=0.5\textwidth]{example-image-a}
\caption{Phase plot $y^{\prime \prime}\left(t \right)+9 y \left(t
\right)-\left(\left\{\begin{array}{cc}
8 \sin \left(t \right) & 0 \EndPicture 

l.14 \end{array}\right.\right) = 0$}
  
? 

Removing hyperref it compiles clean. (ps. I used test image above so it can
compile as is).

Is there a workaround for this?

TL 2022 on Linux

Thank you,
--Nasser





___

Reply to this item at:

  

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



Re: [tex4ht] [bug #586] Incompatibility with package animate

2022-12-10 Thread Nasser M. Abbasi

On 12/10/2022 2:14 PM, Jim Hefferon wrote:

URL:
   

  Summary: Incompatibility with package animate
  Project: tex4ht
 Submitted by: jimhefferon
 Submitted on: Sat Dec 10 20:14:28 2022
 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 a minimal file at the end of this message.  If I run

   make4ht -a debug -m draft test.tex

then I get this message.

(/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht/html5.4ht))
(./test.aux)
! TeX capacity exceeded, sorry [input stack size=1].
\old:outputpage ->\old:outputpage
   {}
l.9 \end{document}
   
No pages of output.

Transcript written on test.log.
[FATAL]   make4ht-lib: Fatal error. Command htlatex returned exit code 1

If I comment out the \usepackage{animate} line then it works great, and I can
view the .html file perfectly.

Regards,
Jim Hefferon

=

\documentclass{book}
\usepackage{graphicx}
\usepackage{animate}

\usepackage{lipsum}
\begin{document}

\lipsum[1-3]
\end{document}



As far as I know, animate never, and most likely will never work with tex4ht.

It does not even work with pdf readers embedded in browsers. i.e. if you open 
the
pdf inside the browser, the animation will not run.

I think it works only with standalone adobe pdf reader and may be with 1-2 other
standalone pdf readers.

This is what I do to run animations in HTML


\documentclass[12pt]{book}

\usepackage{graphicx}
\ifdefined\HCode
\else
\usepackage{animate}
\fi

\usepackage{lipsum}

\begin{document}

\ifdefined\HCode
\ScriptEnv{html}
 {\NoFonts\hfill\break}
 {\EndNoFonts}

\HCode{

}
\else
\animategraphics[controls,loop,width=3in]{3}{f}{1}{10}
\fi

\lipsum[1-3]
\end{document}
-

--Nasser


Re: [tex4ht] WARNING] domfilter: ...ive/2022/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/p) [char=530977]

2022-12-08 Thread Nasser M. Abbasi

Found the problem.  MWE


\documentclass[12pt,titlepage]{article}
\begin{document}

\ifdefined\HCode
Here is the animation from the Maple notebook:

\ScriptEnv{html}
   {\NoFonts\hfill\break}
   {\EndNoFonts}
  
  \HCode{

  
  }
\fi

\end{document}
--


make4ht -ulm default -a warning  maple.tex 'mathjax,htm'

[WARNING] domfilter: DOM parsing of maple.htm failed:
[WARNING] domfilter: 
...ive/2022/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag 
(/p) [char=746]


So it was the above `\HCode{...} code. Even though it works and
the the gif file plays OK in the HTML as can be seen at

https://12000.org/my_notes/faq/MAPLE/maple.htm

(search for the string "Here is the animation" on the page to see it)

But DOM parsor does not like the HTML above. What is wrong with it?

--Nasser










Re: [tex4ht] WARNING] domfilter: ...ive/2022/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/p) [char=530977]

2022-12-08 Thread Nasser M. Abbasi

On 12/8/2022 5:21 AM, Michal Hoftich wrote:

Hi Nasser,

I've tried to run your file, but I cannot compile it because of the
missing file my_core.tex. From the HTML file, the issue is related to
your MAPLEinline environments, which is defined somewhere in your
my_core.tex file. So the ZIP file would be nice.



I did not expect you will be able to compile it ofcourse as
it uses other input files. That is why I asked if I need to
make self contained zip file.


Anyway, could you please make a smaller example? It is complicated to
debug such large files.



I could if I knew where the error is coming from. But I had no idea
as the error just said DOM error with no indication what caused it.

But now that you think it is due to the Maple styling of the code (listing)
Sure, I will try to reproduce it using small example and if I can
will post a zip file with everything in it to compile it.

Thanks,
--Nasser


Best regards,
Michal




On Thu, Dec 8, 2022 at 10:05 AM Nasser M. Abbasi  wrote:


https://12000.org/my_notes/faq/MAPLE/maple.tex

And the log file at

https://12000.org/my_notes/faq/MAPLE/maple.log

I can make a zip file that contains everything needed to build it if needed?




[tex4ht] WARNING] domfilter: ...ive/2022/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/p) [char=530977]

2022-12-08 Thread Nasser M. Abbasi

FYI,

I get this warning


INFO]make4ht-lib: executing: t4ht  "maple.dvi"

t4ht.c (2018-07-04-14:25 kpathsea)
t4ht maple.dvi
(/usr/local/texlive/2022/texmf-dist/tex4ht/base/unix/tex4ht.env)
Entering maple.lg
Entering maple.css
Entering maple.tmp

[INFO]mkutils: Parse LG
[INFO]make4ht-lib: parse_lg process file: maple.htm
[INFO]make4ht-lib: parse_lg process file: maple.htm
[WARNING] domfilter: DOM parsing of maple.htm failed:
[WARNING] domfilter: 
...ive/2022/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag 
(/p) [char=530977]

[INFO]make4ht-lib: parse_lg process file: maple.htm

..

When compiling a document. The command I used is (all on one line)

make4ht --shell-escape -ulm default -a debug -c nma_mathjax.cfg
  -e /mnt/g/public_html/styles/texmf/tex/latex/tex4ht_build_files/MAIN.mk4 
maple.tex
  'mathjax,htm,fn-in,0,notoc*,p-width,charset=utf-8,cut-fullname' '-cunihtf 
-utf8'

But the HTML file generated is the following

https://12000.org/my_notes/faq/MAPLE/maple.htm

Is there a tool to run DOM parsing directly on the above HTML file
to show which line make4ht complains about?

The Latex file can be found at

https://12000.org/my_notes/faq/MAPLE/maple.tex

And the log file at

https://12000.org/my_notes/faq/MAPLE/maple.log

I can make a zip file that contains everything needed to build it if needed?

TL 2022 on Linux.

Thanks,
--Nasser


[tex4ht] [bug #585] Math problems when using tikzpicture and forest with tex4ht

2022-11-27 Thread Nasser M. Abbasi
URL:
  

 Summary: Math problems when using tikzpicture and forest with
tex4ht
 Project: tex4ht
Submitted by: nma123
Submitted on: Mon Nov 28 02:45:40 2022
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:


There seems to be still problems using math with tex4ht and tikz when in
mathjax mode.

Here are two questions I posted for reference

https://tex.stackexchange.com/questions/666134/no-math-is-generated-when-using-tikz-forest-with-tex4ht-in-mathjax-mode


https://tex.stackexchange.com/questions/666705/no-math-is-generated-when-using-tikz-tikzpicture-with-tex4ht-in-mathjax-mode

The second one above is new and has screen shots of the problems. Basically
some math still does not display correctly using forest package in tikz and
when using tikzpicture all the math is missing.


Here is the problem. With the fix given in the above question now math shows
up when using forest but when using tikzpicture all the math is missing.

In addition, when using \left or \right even in forest it does not render
correctly in HTML.


---
Here is MWE

\documentclass[11pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage{amsmath}
\usepackage{tikz,tikzpagenodes}
\usepackage{etoolbox}
\usepackage{hyperref}
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{positioning,fit}
\usepackage[edges]{forest}
\begin{document}

\begin{forest}
for tree={
draw, rounded corners, fill=blue!20,
minimum height=1.5cm, minimum width=2cm,
align=center, base=b,
s sep=1cm, l sep=.5cm,
if level<=2{edge=-latex}{edge=red},
}
[\begin{minipage}{2cm} 
first order
{\begin{align*} 
   f(x,y,(y')^n)&=0\\
   y'&=\left(a + b x + y\right)^{\frac{1}{n}}
\end{align*} 
}
\end{minipage}
,calign=last
]
\end{forest}
--

Screen shots of output are at the above link

When compiled with make4ht (need to use .cfg below)

make4ht  -ulm default -a debug -c mycfg.cfg foo.tex "mathjax,htm" "-cunihtf
-utf8"

Here is the .cfg file thanks to michal.h21 from the above link

--
\Preamble{xhtml}
\makeatletter
\AddToHook{env/forest/begin}{%
  \renewenvironment{align*}
  {\start@align \@ne \st@rredtrue \m@ne}
  {\math@cr \black@ \totwidth@ \egroup \ifingather@ \restorealignstate@
\egroup \nonumber \ifnum 0=`{\fi \iffalse }\fi \else $$\fi
\ignorespacesafterend}
}
\makeatother
\begin{document}
\EndPreamble
--

Using TL 2022 on Linux

>which tex4ht
/usr/local/texlive/2022/bin/x86_64-linux/tex4ht
>make4ht -v
make4ht version v0.3l
>

I might to change my setup to compile each tikz pic to separate pdf and
include those as images using \includegraphics if it is hard to fix these with
mathjax.

--Nasser








___

Reply to this item at:

  

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



[tex4ht] [bug #581] tex4ht does not show some math in table

2022-11-19 Thread Nasser M. Abbasi
URL:
  

 Summary: tex4ht does not show some math in table
 Project: tex4ht
Submitted by: nma123
Submitted on: Sat Nov 19 18:42:47 2022
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

reference and screen shots at 

https://tex.stackexchange.com/questions/665779/tex4ht-does-not-show-some-math-in-table

This MWE makes one small table of 2 rows of type p. The first row has has two
math equations. tex4ht only shows the first one but not the second. While
compiling with lualatex to pdf shows both as expect.


\documentclass[12pt]{book}
\usepackage{amsmath,mathtools}
\usepackage{array}

\begin{document}
\begin{tabular}{|p{.6in}|>{\setlength\columnwidth{5.8in}}p{5.8in}|}\hline
ODE&\vspace{-2em}\begin{gather*}
y^{\prime}-1-2 x=0
\end{gather*}
With initial conditions
$
\begin{aligned}
[y \left(0\right) = 3]
\end{aligned}
$
\\ \hline
program solution&\vspace{-1em}
\begin{align*}
y \left(x \right) = x^{2}+x +3
\end{align*}
Verified OK. 
\\ \hline
\end{tabular}

\end{document}
-

the pdf shows the math on the right in first row. But HTML does not.

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


Here is the raw HTML generated. I see the missing math is there, but it is not
displayed but it is sitting there doing nothing.


 
 
 
 
 
 
 
 
window.MathJax = { tex: { tags: "ams", }, };  
   
 
  ODE  
   \begin {gather*} 
y^{\prime }-1-2 x=0  \end {gather*} With initial conditions \( \begin
{aligned} [y \left (0\right ) = 3] \end {aligned} \)
  
program 
solution\begin {align*}  y \left
(x \right ) = x^{2}+x +3  \end {align*}
Verified OK.
   


 
 



Using TL 2022 on linux

>which tex4ht
/usr/local/texlive/2022/bin/x86_64-linux/tex4ht
>make4ht --version
make4ht version v0.3l
>

How to correct this so that the math shows up in HTML?







___

Reply to this item at:

  

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



[tex4ht] [bug #579] tex4ht does not handle listing correctly when using smaller font size

2022-10-28 Thread Nasser M. Abbasi
URL:
  

 Summary: tex4ht does not handle listing correctly when using
smaller font size
 Project: tex4ht
Submitted by: nma123
Submitted on: Fri Oct 28 07:50:56 2022
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

Reference and screen shots at

https://tex.stackexchange.com/questions/663305/tex4ht-does-not-handle-listing-correctly-when-using-smaller-font-size

tex4ht destroys code alignment when using basicstyle=\small (with or without
font family being given) compare to when not using basicstyle. This only
happens in the HTML. The pdf is correct. Here is a MWE

--

\documentclass[12pt]{article}
\usepackage{listings}

\begin{document}

\begin{lstlisting}[language={},keepspaces=true,basicstyle=\small]
local case_one_gamma_entry := module()
option object;
export pole_location := 0;
export pole_order:= 0;
export sqrt_r:= 0;
export alpha_plus:= 0;
export alpha_minus   := 0; 
export b := 0;
end module;
\end{lstlisting}

\begin{lstlisting}[language={},keepspaces=true]
local case_one_gamma_entry := module()
option object;
export pole_location := 0;
export pole_order:= 0;
export sqrt_r:= 0;
export alpha_plus:= 0;
export alpha_minus   := 0; 
export b := 0;
end module;
\end{lstlisting}

\end{document}
--

compiled with

 make4ht -ulm default -a warning foo2.tex "mathjax,htm"


This is the HTML



No problem in PDF.

I like to user smaller font size in the HTML. Is there a way to make tex4ht
not change the source code when using smaller font size? I also tried
basicstyle=\ttfamily\small but no effect.

TL 2022.

>which tex4ht
/usr/local/texlive/2022/bin/x86_64-linux/tex4ht
>make4ht --version
make4ht version v0.3l







___

Reply to this item at:

  

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



Re: [tex4ht] Advice on where to start?

2022-10-24 Thread Nasser M. Abbasi

On 10/23/2022 5:22 PM, Karl Berry wrote:


1) Try make4ht --loglevel debug to get all output, as I understand it.



I did not know about syntax --loglevel debug, an alternative is

  -a debug

Same effect but less typing.

--Nasser


[tex4ht] [bug #578] tex4ht gives error compiling table with caption using amsart class

2022-10-20 Thread Nasser M. Abbasi
URL:
  

 Summary: tex4ht gives error compiling table with caption
using amsart class
 Project: tex4ht
Submitted by: nma123
Submitted on: Thu Oct 20 12:19:40 2022
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

reference and screen shots at 

https://tex.stackexchange.com/questions/662414/tex4ht-gives-error-compiling-table-with-caption-using-amsart-class

This MWE on TL 2022 on Linux

-
\documentclass[letterpaper,12pt,reqno]{amsart}

\usepackage[T1]{fontenc}
\newtheorem{theorem}[subsection]{Theorem}
\usepackage{floatrow}
\floatsetup[table]{capposition=top}

\begin{document}

\begin{table}[h]
\centering
\begin{tabular}[c]{|l|l|l|}\hline
case & allowed pole order for $r$ & allowed order of $r$ at $\infty$ 
\\\hline
1 & $\left\{  0,1,2,4,6,8,\cdots\right\}  $ & $\left\{ 
\cdots,-8,-6,-4,-2,0,2,3,4,5,6,\cdots\right\}  $ \\\hline
2 & $\left\{  2,3,5,7,9,\cdots\right\}  $ & no condition \\\hline
3 & $\left\{  1,2\right\}  $ & $\left\{  2,3,4,5,6,7,\cdots\right\}  $
\\\hline
\end{tabular}
\caption{Necessary conditions for each Kovacic case}\label{tab:first}
\end{table}

\end{document}
--

ompiles OK with pdflatex (I have to use pdflatex and not lualatex since arxiv
requirement). But when compiling with tex4ht it gives error this error

(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/mathcolor.ltx)) [1]
[2] (/usr/local/texlive/2022/texmf-dist/tex/latex/lm/t1lmtt.fd)
! Extra }, or forgotten \endgroup.
\@endfloatbox ...pagefalse \outer@nobreak \egroup 
  \color@endbox 
l.27 \end{table}
  
? 

The command used is

make4ht  -ulm default -a debug  foo.tex
"mathjax,htm,fn-in,notoc*,p-width,charset=utf-8,cut-fullname"


>which make4ht 
 /usr/local/texlive/2022/bin/x86_64-linux/make4ht
>make4ht --version 
 make4ht version v0.3l

--Nasser







___

Reply to this item at:

  

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



Re: [tex4ht] [bug #576] \HCode alternative that copies verbatim?

2022-08-15 Thread Nasser M. Abbasi

On 8/15/2022 3:48 PM, Karl Berry wrote:

URL:
   

  Summary: \HCode alternative that copies verbatim?
  Project: tex4ht
 Submitted by: karl
 Submitted on: Mon Aug 15 20:48:15 2022
 Category: None
 Priority: 5 - Normal
 Severity: 5 - Normal
   Status: None
  Privacy: Public
  Assigned to: None
 Originator Email:
  Open/Closed: Open
  Discussion Lock: Any

 ___

Details:

Michal, or anyone, is there an alternative to \HCode that outputs its argument
completely verbatim, ideally including line breaks?
It seems \HCode outputs a surrounding  and .

It seems \HCode is inscrutably defined in the scripts, such as htlatex. At
first glance, the definition makes no sense to me at all :).

Thanks.



just FYI,

I just tried

--
\begin{document}

This is a test

\ScriptEnv{html}
 {\NoFonts\hfill\break}
 {\EndNoFonts}

\begin{html}
This is HTML

It should not have any p around it.
\end{html}
-

Compiled using make4ht -ulm default -a debug  foo.tex "htm"

But it still generated HTML with ... around the HTML



This is a test

This is HTML

It should not have any p around it.


 


--

--Nasser



Re: [tex4ht] [bug #561] tex4ht with xr-hyper does not work when splitting other document.

2022-05-23 Thread Nasser M. Abbasi

On 5/23/2022 7:20 AM, Michal Hoftich wrote:

Hi Nasser,


I am sorry, but I was wrong.  I only checked one external document. But when
I added a second one, I found it does not work. Links to the first one are lost.


I cannot reproduce this problem. Multiple files work for me. Maybe
look if you don't have some unnecessary .4ht files in the directory
with your files. Updated TeX Live should work fine.

I've just fixed one minor issue. When I use Xr-hyper and the \hyperref
command, LaTeX issues warning about missing \fi. I am not sure where
it starts, but extra \fi in \XRrEfLiNK seems to remove this warning.

Best regards,
Michal


Hello Michal;

Good job. I just tried it again and now xr-hyper is working ! I did
fresh update of TL. It must be something changed in sources since then.

I just put a test zip file for you with 4 sub folders now to verify this.
All links are now correct.



The steps to show this are the following: After extracting the zip file
and cd to the folder created, then do

---
cd CHAPTERS/chapter_1
make4ht  -ulm default  -a debug ch1.tex 'mathjax,htm,4,cut-fullname'

cd ../chapter_2
make4ht  -ulm default  -a debug ch2.tex 'mathjax,htm,4,cut-fullname'

cd ../chapter_3
make4ht  -ulm default  -a debug ch3.tex 'mathjax,htm,4,cut-fullname'

cd ../chapter_4
make4ht  -ulm default  -a debug ch4.tex 'mathjax,htm,4,cut-fullname'

cd ../..
make4ht  -ulm default  -a debug main.tex 'mathjax,htm,cut-fullname'
--

Now opened the main.htm file and all links send me to correct location
in the separate chapters documents.

But I see these messages in the main.log file (which is in the zip file)

(./CHAPTERS/chapter_3/ch3.xref) (./CHAPTERS/chapter_4/ch4.xref) [1] (./main.aux
))
(\end occurred when \ifx on line 18 was incomplete)
(\end occurred when \if on line 16 was incomplete)
(\end occurred when \if on line 15 was incomplete)
(\end occurred when \if on line 13 was incomplete)
(\end occurred when \if on line 11 was incomplete)
 435 words of node memory still in use:

But they seem to have no effect I see now on the final result. May be this is
the problem you already fixed in the official source which you mentioned above,
so next time I update TL may be these will be gone.

So now I will remove all my hand coded raw HTML links from my code and
use xr-hyper package again to get the links to work and will try
it on my main large build. It will take about 12 hrs to finish compiling.

Thanks
--Nasser






Re: [tex4ht] missing sections and missing last chapter from large build. tex4ht hard limits on number of chapters and sections allowed?

2022-05-17 Thread Nasser M. Abbasi

On 5/17/2022 7:01 AM, Michal Hoftich wrote:

Hi Nasser,



And just started new build with max iteration set at 6 in the make4ht build 
file.

This will take about 1-2 days to complete.

Will update you once it is done. Hopefully this will fix all these problems
I was having and now all chapters and sections will show up.


Did it work in the end?

Best,
Michal


Hello Michal;

I am afraid it did not.  But there was no errors.  I did
get complete table of contents this time, but clicking on the last
sections in the TOC gave errors saying link not found. Like before
the increasing of \gHAdvance\fstf:id

But since then, I am no longer now building the whole book as one
large document. As I mentioned, now I am building the book by
splitting each chapter into separate document.

This reduces the size of each build. Then adding links manually
to each chapter using raw HTML code.

I was never sure why these link not found error show up. It could be
I needed more iterations to finish the build? I had it set up at 7
which I thought was enough.

Either way, I think increasing the \gHAdvance\fstf:id is good to
do and was safe  even though I did not fix my problem on the
large document.

I think there is still a problem why tex4ht can't build very large
document like this and end up not completing all the links and giving
missing links. But I gave up trying to find why so ended up physically
splitting the document.

Regards,
--Nasser




Re: [tex4ht] [bug #561] tex4ht with xr-hyper does not work when splitting other document.

2022-05-14 Thread Nasser M. Abbasi

Just an update.

I was able to work around this xr-hyper issue limitation in texh4ht.

I removed this package and no longer use it, and was able to make
my own direct links to external documents using raw HTML code instead.

This worked, thanks to Michal changing the format of the generated HTML
files when splitting, so they now have a uniform file names.

<https://tex.stackexchange.com/questions/644059/how-to-control-the-name-of-the-html-files-that-tex4ht-uses-for-splitting-subsubs>

So my program now when in tex4ht mode, generates any needed link to external
chapters directly and it is now working.

I would have preferred to use xr-hyper, but it does not really work with tex4ht
as it only works with one external document, not multiple documents.

Now I can compile only changed chapters and this will make building the book
much faster.

Case closed.

Thanks
--Nasser


On 5/14/2022 3:13 AM, Nasser M. Abbasi wrote:

On 5/13/2022 7:58 PM, Nasser M. Abbasi wrote:


Not only that, it had the good side effect of making your eralier
changes in xrhyper-hooks.4ht now also work when splitting the external document!


I am sorry, but I was wrong.  I only checked one external document. But when
I added a second one, I found it does not work. Links to the first one are lost.

But I spend more time looking at this and I found the cause of the bug
in tex4ht which makes xr-hyper not work the same way with pdf.

This for me is a deal breaker. Without this working correctly, I can't
compile each chapter separately, since I need the references to automatically
work across documents. I could not add all references needed by hand.

I have this set up: main.tex in one folder, and ch1.tex and ch2.tex each
in separate folders.  main.tex has a link to ch1.tex and to ch2.tex.

Here is the problem I found. When I do this in main.tex

--
\documentclass{book}
\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument{CHAPTERS/chapter_1/ch1}
\externaldocument{CHAPTERS/chapter_2/ch2}
\begin{document}

See problem \hyperref[1]{1} in chapter 1

See problem \hyperref[2]{2} in chapter 2

\end{document}
-

then ONLY the last \externaldocument is used.

The first one is ignored. So tex4ht implementation of \externaldocument
seems faulty. It only accept one external document, and it  is the last one.

When I change the order, the links now go the last one listed.

In pdf, this is not the case. Both externaldocument are used.

Hopefully this finding will make it easier to locate where the problem is
and fix it tex4ht? If not, I will just have to continue to build the whole
document each time even if I make change in only one chapter.

I include a zip file which contains all the files and the tree.

The commands I used are

cd CHAPTERS/chapter_1
make4ht  -ulm default  -a debug ch1.tex 'mathjax,htm,4,cut-fullname'
cd ../chapter_2
make4ht  -ulm default  -a debug ch2.tex 'mathjax,htm,4,cut-fullname'
cd ../..
make4ht  -ulm default  -a debug main.tex 'mathjax,htm,cut-fullname'


I am using the new cut-fullname option thanks to Michal just added,
which might not yet be in tex4ht but can be replaced by using this
.cfg from

<https://tex.stackexchange.com/questions/644059/how-to-control-the-name-of-the-html-files-that-tex4ht-uses-for-splitting-subsubs>

--
\Preamble{xhtml}
\catcode`\:=11
\def\fx:pt#1xxx!*?: {%
 \expandafter\ifx \csname big:#1:\endcsname\relax
   \expandafter\gHAssign\csname big:#1:\endcsname  0  \fi
 \expandafter\gHAdvance\csname big:#1:\endcsname  1
 \edef\big:fn{#1\csname big:#1:\endcsname}}
\catcode`\:=12
\begin{document}
\EndPreamble
--

the zip file is at

<https://12000.org/tmp/xrhyper_bug_tex4ht/trying_separate_chapters_bug.zip>


Thanks
--Nasser




Re: [tex4ht] [bug #561] tex4ht with xr-hyper does not work when splitting other document.

2022-05-14 Thread Nasser M. Abbasi

On 5/13/2022 7:58 PM, Nasser M. Abbasi wrote:


Not only that, it had the good side effect of making your eralier
changes in xrhyper-hooks.4ht now also work when splitting the external document!


I am sorry, but I was wrong.  I only checked one external document. But when
I added a second one, I found it does not work. Links to the first one are lost.

But I spend more time looking at this and I found the cause of the bug
in tex4ht which makes xr-hyper not work the same way with pdf.

This for me is a deal breaker. Without this working correctly, I can't
compile each chapter separately, since I need the references to automatically
work across documents. I could not add all references needed by hand.

I have this set up: main.tex in one folder, and ch1.tex and ch2.tex each
in separate folders.  main.tex has a link to ch1.tex and to ch2.tex.

Here is the problem I found. When I do this in main.tex

--
\documentclass{book}
\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument{CHAPTERS/chapter_1/ch1}
\externaldocument{CHAPTERS/chapter_2/ch2}
\begin{document}

See problem \hyperref[1]{1} in chapter 1

See problem \hyperref[2]{2} in chapter 2

\end{document}
-

then ONLY the last \externaldocument is used.

The first one is ignored. So tex4ht implementation of \externaldocument
seems faulty. It only accept one external document, and it  is the last one.

When I change the order, the links now go the last one listed.

In pdf, this is not the case. Both externaldocument are used.

Hopefully this finding will make it easier to locate where the problem is
and fix it tex4ht? If not, I will just have to continue to build the whole
document each time even if I make change in only one chapter.

I include a zip file which contains all the files and the tree.

The commands I used are

cd CHAPTERS/chapter_1
make4ht  -ulm default  -a debug ch1.tex 'mathjax,htm,4,cut-fullname'
cd ../chapter_2
make4ht  -ulm default  -a debug ch2.tex 'mathjax,htm,4,cut-fullname'
cd ../..
make4ht  -ulm default  -a debug main.tex 'mathjax,htm,cut-fullname'


I am using the new cut-fullname option thanks to Michal just added,
which might not yet be in tex4ht but can be replaced by using this
.cfg from

<https://tex.stackexchange.com/questions/644059/how-to-control-the-name-of-the-html-files-that-tex4ht-uses-for-splitting-subsubs>

--
\Preamble{xhtml}
\catcode`\:=11
\def\fx:pt#1xxx!*?: {%
   \expandafter\ifx \csname big:#1:\endcsname\relax
 \expandafter\gHAssign\csname big:#1:\endcsname  0  \fi
   \expandafter\gHAdvance\csname big:#1:\endcsname  1
   \edef\big:fn{#1\csname big:#1:\endcsname}}
\catcode`\:=12
\begin{document}
\EndPreamble
--

the zip file is at

<https://12000.org/tmp/xrhyper_bug_tex4ht/trying_separate_chapters_bug.zip>


Thanks
--Nasser


Re: [tex4ht] [bug #561] tex4ht with xr-hyper does not work when splitting other document.

2022-05-13 Thread Nasser M. Abbasi

Hello Michal;

Great news.

The changes you made to tex4ht splitting name format in:


https://tex.stackexchange.com/questions/644059/how-to-control-the-name-of-the-html-files-that-tex4ht-uses-for-splitting-subsubs>


is working very well.

Not only that, it had the good side effect of making your eralier
changes in xrhyper-hooks.4ht now also work when splitting the external document!

It was now working before these changes.

I think the problem was that the overloading of the file names
with subsection and subsubsection, all using the same format is why it
was not working.

But now suddenly I found it is working with the new file format.

Now, I can build each chapter in separate folder and the links automatically
work across files without me having to add any extra manual code to add the 
links.

I just type  \hyperref[1]{1} in main document and it will find the
correct link even if it is in an external HTML file separate with splitting
also added.

I just need to add

\externaldocument{chapters/folder_name/index}

Thanks again for making these changes. This will make life so much easier now
and now it will be possible to only compile the chapters that changed
instead of the whole document each time.

Will xrhyper-hooks.4ht and the changes you just made by adding cut-fullname
option to make4h all be in official tex4ht sources?  or do I need
to keep my own copy of xrhyper-hooks.4ht?

Best regards
--Nasser


On 5/3/2022 1:46 AM, Nasser M. Abbasi wrote:

On 5/2/2022 7:46 AM, Michal Hoftich wrote:

Follow-up Comment #1, bug #561 (project tex4ht):

This one was a bit more difficult, as information about cut files is not
available at the moment when we save the directory. I fixed that by loading of
the .xref with redefined version of the \:CrossWord macro. It detects links to
cut files using regular expressions, and saves directory also for these.

You can try the updated xrhyper-hooks.4ht file.

(file #510)
  ___


Thank you Michal for the effort.

It works well, when there is one chapter which split.

But unfortunately when I have more than one separate chapter,
the links go to wrong places.





I am using your xrhyper-hooks.4ht which I put in my texmf.

I have one main.tex, and two ch1.tex and ch2.tex, both are book class.
I compiled ch1.tex and ch2.tex with split 4.  Then I did reference
to 2 labels in each chapter.

When I click in main.htm for a link that should point to ch1.htm, it
instead go to ch2.htm.

I made a zip file if you like to see for yourself with all the files
and the HTML generated. Please see attached.

The commands I used are

cd CHAPTERS/chapter_1
make4ht  -ulm default  -a debug ch1.tex 'mathjax,htm,4'
cd ../chapter_2
make4ht  -ulm default  -a debug ch2.tex 'mathjax,htm,4'
cd ../..
make4ht  -ulm default  -a debug main.tex 'mathjax,htm'

And looked at main.htm

If you think this will not work, may be due to tex4ht is not designed
for this, no problem, I understand. I will go back to using one large latex 
file.

I was hoping by splitting the html like this, I can only compile the chapters
that change, saving time.

If you like me to try anything, will be happy to.

Best regards,
--Nasser




Re: [tex4ht] missing sections and missing last chapter from large build. tex4ht hard limits on number of chapters and sections allowed?

2022-05-13 Thread Nasser M. Abbasi

On 5/13/2022 10:14 AM, Michal Hoftich wrote:



Yes, it seems that there is a hard limit. From tex4ht-sty.tex:

%%
We want to reduce the number of compilations due to changes. We can't do
much with sectioning numbers, but we can do quite a lot with labels of
links. Note that the addresses are made up of file numbers + label numbers.

We make the children `fix-points' with respect to file numbers, by
allocating them addresses that are equal to `child-id * 1'.  We
make here an assumption that a compilation will not generate more than
 files.


\<<<
\gHAdvance\fstf:id |by 1



%%

Unfortunately, you didn't include your TeX file in the zip file. But
you can try to update this variable in a local copy of tex4ht.sty.

You can copy it to your current directory using (assuming you use bash on WSL):

$ cp `kpsewhich tex4ht.sty` .

And change the value on line 3815:

\gHAdvance\fstf:id  10

This uses 10 instead of 1, so I hope it is enough. I am not
sure whether this won't result in different issues, like running out
of memory. So it needs some testing before I can update TeX4ht
sources.

Best regards,
Michal


Sorry about missing latex files. I just updated the zip file and now there are
all there if you need them:

https://12000.org/tmp/05132022/

(I have script I run which cleans the build folder before zipping
and uploading to my webpage and it does this automatically).

I just did the changes you recommended (as root)


pwd

/usr/local/texlive/2022/texmf-dist/tex/generic/tex4ht

diff tex4ht.sty tex4ht_ORIG.sty

3812c3812
< \gHAdvance\fstf:id  10
---

\gHAdvance\fstf:id  1



And just started new build with max iteration set at 6 in the make4ht build 
file.

This will take about 1-2 days to complete.

Will update you once it is done. Hopefully this will fix all these problems
I was having and now all chapters and sections will show up.

Thanks again

--Nasser





[tex4ht] missing sections and missing last chapter from large build. tex4ht hard limits on number of chapters and sections allowed?

2022-05-13 Thread Nasser M. Abbasi

hello Michal;

ps. I am emailing this also to tex4ht mailing list. Thought it might be useful.

You mentioned at tex stackexchange you just found a hard limit
in tex4ht source code on how many files it can generate.

This is good finding, this explains why I have not been able to get
complete build from this large file.

The following build used a maximum iteration of 7 in the build file.

I thought this will be enough. But it is still missing
links at the end. For weeks I've been trying to find why
that is. I thought I need more iterations.

It stops at one chapter 50. There are 51 chapters now.
So missing the last chapter.

And chapter 50 shows first section only. There are 8 more.

This is a link to zip file of the latest build.

The zip file that has the PDF file and the HTML files so you can see.
it is in this folder.

https://12000.org/tmp/05132022/

It is about 180 MB.

Looking at the content, I see the largest  in
insu*.htm (subsection and subsections file2 is numbered
insu9419.htm and the largest inse in inse*.htm is
ine99.htm (sections).

And for chapters, it is inch50.htm.

My book has 51 chapters now. And chapter 51 is missing
from the HTML webpage.

The PDF file included in the zip file has all chapters
and all sections so you can see what is missing by
comparing to the HTML table of content shown.

I hope that you will be able to increase this limit.

May be 30 years ago there was a need to put limits on
these things, but now, I see no need for such limits. I
have 50 terra byets of disk space.

Please let me know if you need additional information
and will email it to you.

Thanks
--Nasser


[tex4ht] [bug #561] tex4ht with xr-hyper does not work when splitting other document.

2022-04-30 Thread Nasser M. Abbasi
URL:
  

 Summary: tex4ht with xr-hyper does not work when splitting
other document.
 Project: tex4ht
Submitted by: nma123
Submitted on: Sun May  1 04:38:18 2022
Category: None
Priority: 5 - Normal
Severity: 7 - Important
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:


I found a big problem with xr-hyper. THis is related to closed bug report

"bug #560: problem using tex4ht with xr-hyper when other documents are in
separate folders"

For reference,
https://tex.stackexchange.com/questions/641726/problem-using-tex4ht-with-xr-hyper-when-other-documents-are-in-separate-folders

I've been testing this in tex4ht. I found a big problem. Everything works fine
as long as the chapter is compiled all as one large HTML file with no
splitting. Then the link from the parent show up correctly.

Once I split the chapter, and recompile everything in correct order, then the
parent losses the link and they no long show up. Since I split all the
chapters (because they are large) then this will not work as is for me.

I hope there is an easy solution for this. Below I give MWE showing this and
also a zip file with everything in it to make it easier to see.

I have this layout

-
  main.tex
  |
CHAPTERS/
  |
   chapters_1/
  |
ch1.tex
-

Here is main.tex

-
\documentclass{book}
\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument{CHAPTERS/chapter_1/ch1}
\begin{document}
See problem \hyperref[1]{1} 
\end{document}
-

And this is ch1.tex

---
\documentclass{article}
\usepackage{xr-hyper}
\usepackage{hyperref}
\begin{document}
\section{some section name}
\subsection{problem 1 from some book}
\label{1}
THis is problem 1
\end{document}



Now I do the following

---
   cd CHAPTERS/chapter_1/
   make4ht  -ulm default  -a debug ch1.tex 'mathjax,htm,4'
   cd ../..
   make4ht  -ulm default  -a debug main.tex 'mathjax,htm'


Then look at main.htm to see if the link worked, it did not. It just shows the
number 1 but it is not clickable. Here is the raw HTML of main.htm

--
 
 
 
 
 
 
 
 
window.MathJax = { tex: { tags: "ams", }, };  
   

See problem 1
   
 
 

--

Now I do the following

   cd CHAPTERS/chapter_1/
   make4ht  -ulm default  -a debug ch1.tex 'mathjax,htm'
   cd ../..
   make4ht  -ulm default  -a debug main.tex 'mathjax,htm'
  
Notice, I removed the split above on the chapter.

Now I look at main.htm and link is active and working. Here is the new raw
HTML of main.htm. You see, now it worked


 
 
 
 
 
 
 
 
window.MathJax = { tex: { tags: "ams", }, };  
   

See problem 1
   
 
 



Here is a 




zip file the contains the above layout and all the files.

Thank you
--Nasser






___

Reply to this item at:

  

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



Re: [tex4ht] How to control/optimize the number of times make4ht runs dvilualatex?

2022-04-26 Thread Nasser M. Abbasi

On 4/24/2022 4:01 PM, Michal Hoftich wrote:

Sorry, there was still an error in my previous email, the condition should be

if compilation_count >= max_compilations then return status end

instead of

if compilation_count => max_compilations then return status end

Best regards,
Michal


Thanks Michal.

I've used the updated build file with the corrections. Set
the max_compilation to 5 instead of 3.

Run the build and it used all 5 and no more. So it worked.

Each call to dvilualatex took about 3 hrs to complete.

The whole build, including making the PDF file took:
---
[INFO]make4ht: outdir:
[STATUS]  make4ht: Conversion finished
Tuesday 04/26/22  01:25:21 AM

real1422m3.030s
user1216m55.415s
sys 10m44.752s



-

Which is about 23.7 hrs. On Linux Ubuntu 20.04 running under
WSL 2.0 under windows 10 Linux subsystem. 128 GB RAM.

It is a large webpage with lots of tables. The PDF is 43,630 pages.

The good news is that now all  chapters in the table of content
show up and there are no lost sections in the last chapter TOC
as before and all links work and I see no ??? where links
point to in tables.

It must be that the earlier default "3" runs was the cause.

It was not enough runs, and needed 2 more to "fix" things? I do
not know. But this is the only thing that is really different
from last time I tried this. It looks like the larger the web
page, the more runs tex4ht needs.

Here is a link to the above page



Thanks again for your help.

--Nasser


Re: [tex4ht] How to control/optimize the number of times make4ht runs dvilualatex?

2022-04-24 Thread Nasser M. Abbasi

On 4/24/2022 10:11 AM, Michal Hoftich wrote:


But when now I use the same command again, but do not
clear the folder and keep all intermediate files generated from earlier
command, it now calls dvilualatex one time only and not 2 times.

Just wanted to make sure this is all what is expected as I want
to use this in my main makefiles.


Yes, it is as expected.

Best regards,
Michal


Thanks for the clarification.

Unfortunately, I had to remove this build file after trying
it on my actual large latex file.

This is what happened. After waiting for almost 30 hrs, and counted
tex4ht calling dvilualatex 10 times !  I decided it went into
an infinite loop for some reason.  It takes 2-2.5 hrs for one
call.

Normally it needs only 3-4 calls.

I assume each call to dvilualatex  correspond to one call that make4ht
makes, which we are trying to optimize.

I see you had a check in the build file to protect against this.
But for some reason, this was not activated.  I only changed the
max from 3 to 5 in the code you posted.

But I saw 10 times, and it was going into the 11th when I killed the
build.  I have no  idea why. So I am back to using default, which
is 3 times.

Thank you,
--Nasser





[tex4ht] [bug #560] problem using tex4ht with xr-hyper when other documents are in separate folders

2022-04-22 Thread Nasser M. Abbasi
URL:
  

 Summary: problem using tex4ht with xr-hyper when other
documents are in separate folders
 Project: tex4ht
Submitted by: nma123
Submitted on: Sat Apr 23 05:23:31 2022
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

reference and screen shots at

https://tex.stackexchange.com/questions/641726/problem-using-tex4ht-with-xr-hyper-when-other-documents-are-in-separate-folders

I am splitting my large document into smaller separate documents, where now
each chapter will be compiled separately, as separate PDF file (not using
\include or input, but as a separate document with its own title and
\begin{document})

But I still need to have reference from a main document to the other documents
to build tables and references.

So I am using xr-hyper. Which worked well. I have this MWE tree to show my
current set

   main.tex
  |
  +-- chapter_1/ch1.tex
  +-- chapter_2/ch2.tex

I put each chapter in separate folder to reduce clutter. This is what my
main.tex, ch1.tex and ch2.tex look like

%main.tex
\documentclass{book}
\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument{chapter_1/ch1} %notice folder name included
\externaldocument{chapter_2/ch2}
\begin{document}
See problem \hyperref[1]{1} below and problem \hyperref[2]{2}.
\end{document}

and ch1.tex which is inside folder chapter_1/

\documentclass{book}
\usepackage{xr-hyper}
\usepackage{hyperref}

\begin{document}
\chapter{chapter 1 in document ch1.tex}
\section{some section name}
\subsection{problem 1 from some book}
\label{1}
This is problem 1
\end{document}

and ch2.tex

\documentclass{book}
\usepackage{xr-hyper}
\usepackage{hyperref}
\begin{document}

\chapter{chapter 2 in document ch2.tex}
\section{some section name}
\subsection{problem 2 from some book}
\label{2}
This is problem 2
\end{document}

Next, compiled ch1.tex,ch2.tex and finally main.tex in this order using
lualatex. Now I opened main.pdf and the links there correct and work.

Next, I did the same for tex4ht. Compiled ch1.tex,ch2.tex then main.tex in
this order, all using the commands

   make4ht ch1.tex 'mathjax,htm'
   make4ht ch2.tex 'mathjax,htm'
   make4ht main.tex 'mathjax,htm'

Then opened main.htm and it shows correct output

Now here is the problem, when I click on the link, it drops the folder name
from the link. The link for 1 says

ch1.htm#x1-30001.1.1 

instead of

 chapter_1/ch1.htm#x1-30001.1.1

So the link did not work.

By manually editing the link and adding the folder name chapter_1/ to it, then
it works and opens chapter 1 page correctly.

I can fix all of this by having all separate documents (main.tex, ch1.tex and
ch2.tex) in same top level folder.

But to reduce clutter, and since I have many chapters that I want to make now
completely separate PDF files for each chapter (but still have cross
references from main document to them), it will be much better to have each in
separate folder to make it easier to manage and reduce clutter in same folder,
since I need to compile each one separately now.

This looks like a bug in tex4ht, in that it drops the folder name from the
reference. Or Am I doing something wrong?

TL 2021





___

Reply to this item at:

  

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



Re: [tex4ht] How to increase number of strings ? make4ht-lib: Fatal error. Command htlatex returned exit code 1

2022-04-22 Thread Nasser M. Abbasi

On 4/22/2022 10:11 AM, Michal Hoftich wrote:

Hi Nasser,



It now compiled the MWE given below. It does take a long
time. This is another issue for another email. But tex4ht took
110 minutes to compile this file, (which is empty, but has
lots of empty chapters and sections), while lualatex about 2 minutes.

Tex4ht is really slow.





The main problem is that your files are so extremely huge. TeX4ht
needs some extra memory, because it declares link destinations for all
sections and for each cut page.



Hello Michal. Thanks for taking the time to look at the problem.

I understand the document is long. (actually the MWE I gave
is empty, but has lots of chapters/sections/subsections to
show the problem).

But I do have more than enough Physical RAM. This is new PC with one of
the fastest  intel CPU and mximum 128 GB RAM.

I monitor the ram all the time as tex4ht is compiling, and
it does not use more than 8GB to 10GB. This below shows the current
RAM compiling with "4" split level, including 2 other tex4ht builds
running at same time in separate terminals:


free -mh

   totalusedfree  shared  buff/cache   available
Mem:  100Gi   8.7Gi83Gi   0.0Ki   8.4Gi90Gi
Swap:  26Gi  0B26Gi

So I am failing to see how is this a physical memory issue at all.

Please help me understand how this is due to memory not available for
tex4ht to compile the document.  If tex4ht runs out of memory,
would it not give an error and stop?



Now for the issue of losing links.

I used this command

make4ht  -ulm default foo.tex "mathjax,htm,fn-in,4"


Try

make4ht  -ulm draft foo.tex "mathjax,htm,fn-in,3"

It will produce separate files for sections, but not for subsections.
You should save a lot of memory and compilation time using this.



Thanks for the suggestion. Yes, this compiles much faster and does
not produce missing links as with "4" instead of "3".

Just to be clear what we are taking about:

===

make4ht  foo.tex "mathjax,htm,fn-in,4"

Takes over 2 hrs to compile, produces DOM errors

[INFO]make4ht-lib: parse_lg process file: fosu36492.htm
[WARNING] domfilter: DOM parsing of fosu36492.htm failed:
[WARNING] domfilter: 
...ive/2021/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Error Parsing 
XML [char=5325]

And produces wrong links that leads to no pages as discuessed earlier.
The links go dead after chapter 19, section 3 subsection 93 as
I said before.


make4ht  foo.tex "mathjax,htm,fn-in,3"

Takes only 12 minutes and produces no bad links.


But this difference on its own shows clearly there is a serious problem
in tex4ht in this area.

Why would it take 10 or 20 times longer time to compile when
using "4" vs. "3"?

A little more time is to be expected, but this much longer? May be
the algorithm  or data structure used by tex4ht to handle and manage
the splitting is not optimized? Does this mean using "5" will now
take 100 times longer to compile? I am afraid to try :)

I remember you once mentioned the code for splitting in tex4ht
is very old and hard to understand which is something I understand
and appreciate.

This workaround of changing "4" to "3" on this document
can't really be a solution for me. The issue is not how long
it takes to compile. I can wait. If I can get correct pages
generated that loads fast.

The issue is the missing links and missing sections in table
of content and seemingly corrupt pages that show up with large
blank spaces in them which the MWE shows.

I have sections that have many subsections (up to 50 or 100) in
them. Each subsection is also large. Having them all show on same
webpage, means the pages becomes very slow to open. Even
with mathjax for math, which is not practical.

No one will want to browse a website that takes 5 minutes each time
to open a large pages. Also, it harder to browse very
long pages.

That is why I wanted to have each subsection on each separate
and smaller webpage, so they open fast and easier to view.


Best regards,
Michal


If you have any other ideas or something I should try, please
feel to let me know. Right now, I am no longer able to build
my long document because of this.

Thanks,
--Nasser


Re: [tex4ht] How to control/optimize the number of times make4ht runs dvilualatex?

2022-04-22 Thread Nasser M. Abbasi

On 4/19/2022 4:30 AM, Michal Hoftich wrote:

Hi Nasser



Thanks, but the issue is, how does one know if they
need to run it 1, 2 or 3 times? What code do I need to add
to the above to decide?
With lualatex, now this is what I do and it works (other option is to
use latexmk, but for some other reasons, I prefer to stick to makefiles
for now).



One possibility is to use the latexmk_build extension, like in:

   make4ht -f html5+latexmk_build sample.tex

Another option is to check temporary files for changes. Using some
hash function. Like in this build file:


local htlatex = require "make4ht-htlatex"

local function get_checksum(main_file, extensions)
   -- make checksum for temporary files
   local checksum = ""
   local extensions = extensions or {"aux", "4tc", "xref"}
   for _, ext in ipairs(extensions) do
 local f = io.open(main_file .. "." .. ext, "r")
 if f then
   local content = f:read("*all")
   f:close()
   -- make checksum of the file and previous checksum
   -- this way, we will detect change in any file
   checksum = md5.sumhexa(checksum .. content)
 end
   end
   return checksum
end

Make:add("myhtlatex", function(par)
   -- get checksum of temp files before compilation
   local checksum = get_checksum(par.input)
   local status = htlatex.htlatex(par)
   -- stop processing on error
   if status ~= 0 then return status end
   -- get checksum after compilation
   local newchecksum = get_checksum(par.input)
   -- this is needed to prevent possible infinite loops
   local compilation_count = 1
   local max_compilations  = 3 -- <- change as you want
   while checksum ~= newchecksum do
 --
 if compilation_count > max_compilations then return status end
 status = htlatex.htlatex(par)
 -- stop processing on error
 if status ~= 0 then return status end
 checksum = newchecksum
 -- get checksum after compilation
 newchecksum = get_checksum(par.input)
   end
   return status
end)

Make:myhtlatex {}
-

Best regards,
Michal


Hello Michal;

Just a clarification. I now trying using your build file above to optimize
the number of times tex4ht is called.

Do I need to also add

\Preamble{xhtml}
\typeout{(\jobname.4tc)}
\begin{document}
\EndPreamble

to my .cfg? or is this above for use with the other method you showed
which is using latexml?

So if I just want to use the above build file, is it enough to just
load it using -e  build_file.mk4   where build_file.mk4 is what you
show above or do I need to do something more to my .cfg?

btw, when I try the above on a simple file, it calls
tex4ht twice starting from clean folder. I assume this is normal?
i.e. from clean folder:

--
cat report.tex
\documentclass[11pt]{book}
\begin{document}

test
\end{document}
---

and now


make4ht  --shell-escape -ulm default -a debug
 -c nma_mathjax.cfg
 --build-file $TEXMFHOME/tex/latex/tex4ht_build_files/MAIN.mk4
  report.tex
  "mathjax,htm,fn-in,1,notoc*,p-width,charset=utf-8" "-cunihtf -utf8" "" 
"--interaction=batchmode"
---

Shows it calls dvilualatex twice

[INFO]htlatex: LaTeX call: dvilualatex --interaction=errorstopmode -jobname='report'  
--interaction=batchmode -shell-escape 
'\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\AddToHook{class/before}{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname
 
tex4ht\endcsname{#1,html}\def\HCode1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode
 nma_mathjax.cfg,mathjax,htm,fn-in,1,notoc*,p-width,charset=utf-8,charset=utf-8,html5.a.b.c.\input 
"\detokenize{report.tex}"'
This is LuaTeX, Version 1.15.0 (TeX Live 2022)
 system commands enabled.

[INFO]htlatex: LaTeX call: dvilualatex --interaction=errorstopmode 
-jobname='report'

--interaction=batchmode -shell-escape 
'\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\AddToHook{class/before}{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname
 
tex4ht\endcsname{#1,html}\def\HCode1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode
 nma_mathjax.cfg,mathjax,htm,fn-in,1,notoc*,p-width,charset=utf-8,charset=utf-8,html5.a.b.c.\input 
"\detokenize{report.tex}"'
This is LuaTeX, Version 1.15.0 (TeX Live 2022)
 system commands enabled.

.
[STATUS]  make4ht: Conversion finished

Is the above expected? why 2 times on this simple file?

But when now I use the same command again, but do not
clear the folder and keep all intermediate files generated from earlier
command, it now 

Re: [tex4ht] How to increase number of strings ? make4ht-lib: Fatal error. Command htlatex returned exit code 1

2022-04-21 Thread Nasser M. Abbasi

Finally managed to make it build.

Just needed to increase max_strings and hash size. Here
are the values needed

-

cat /usr/local/texlive/2022/texmf.cnf

buf_size=900
pool_size=900
main_memory=8000
save_size=100
max_strings = 500
strings_free = 100
strings_free = 10
hash_extra=100
--

It now compiled the MWE given below. It does take a long
time. This is another issue for another email. But tex4ht took
110 minutes to compile this file, (which is empty, but has
lots of empty chapters and sections), while lualatex about 2 minutes.

Tex4ht is really slow.

Now for the issue of losing links.

I used this command

make4ht  -ulm default foo.tex "mathjax,htm,fn-in,4"

On the MWE below.

This MWE does now show the problem I am now seeing in my actual file.
After some long chapters with many sections and subsections, the links
are missing and the HTML body seems corrupted with lots of empty space
in the middle.

Please find the zip file in this folder

<https://12000.org/tmp/tex4ht_problem_april_20_2022/>

called current_test.zip

All build files are in there. Openining the file foo.htm in
the browser, I found that after chapter 19, section 3,
subsection 93 is where the problem starts. Clicking on any
link after that gives

Your file couldn’t be accessed
It may have been moved, edited, or deleted.
ERR_FILE_NOT_FOUND


This is a big problem. Any suggestions or something I should try or
any infoemation, please let me know.

TL 2022.

--Nasser

On 4/21/2022 8:15 PM, Nasser M. Abbasi wrote:

I am getting lost sections in the table of content for
the very last chapter in the HTML.

It shows only the first 2 sections in the last chapter. But
there are 9 sections there.  It only happens when the document is large.

It seems to be related to some limit buildin.

So I made a MWE to try to find out why. Now on the MWE I get
this error

-
[27910]
l.36 --- TeX4ht warning --- \Link{ }? ---
! TeX capacity exceeded, sorry [number of strings=477757].
\:aplus ...dafter \noexpand \:temp {\the \tmp:cnt
 }}\egroup \:temp
l.36 }

1508 words of node memory still in use:
  17 hlist, 2 vlist, 2 rule, 1 disc, 4 local_par, 1 dir, 22 glue, 5 kern, 4 
pe
nalty, 30 glyph, 33 attribute, 116 glue_spec, 33 attribute_list, 1 temp, 4 if_s
tack, 4 write, 26 special nodes
  avail lists: 1:1,2:502,3:885,4:5,5:25,6:67,7:1336,9:158,10:4,11:3
!  ==> Fatal error occurred, bad output DVI file produced!
Output written on foo.dvi (27910 pages, 173384940 bytes).


I searched and do not see where to increase number of strings.

My current .cnf is


cat /usr/local/texlive/2022/texmf.cnf

buf_size=9000
pool_size=9000
main_memory=8000
save_size=100


How does one increase "number of strings"?  I have 128 GB of ram.

On a related possible issue: does tex4ht uses lualatex in any way?
I know it uses dvilualatex. does dvilualatex uses lualatex?

Here is the MWE and the command I used.

===
\documentclass[12pt]{book}
\usepackage{pgffor}

\begin{document}
\ifdefined\HCode
\Configure{tableofcontents*}{chapter,section}
\else
\setcounter{tocdepth}{1}
\tableofcontents
\fi

\ifdefined\HCode
\TocAt{chapter,section}
\TocAt{section,subsection}
\fi

\foreach \n in {1,...,50}%
{
 \chapter{\n}
 \foreach \m in {1,...,10}%
 {
 \section{\m}
 \foreach \k in {1,...,200}%
 {
\subsection{\k}
 }
 }
}
\end{document}



make4ht  -ulm default foo.tex "mathjax,htm,fn-in,4"

[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: foo.tex
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename LineMessage
[ERROR]   htlatex: ?36   TeX capacity exceeded, sorry [number of 
strings=477757].
[ERROR]   htlatex: ?36==> Fatal error occurred, bad output DVI file 
produced!
[FATAL]   make4ht-lib: Fatal error. Command htlatex returned exit code 1





Thanks
--Nasser




[tex4ht] How to increase number of strings ? make4ht-lib: Fatal error. Command htlatex returned exit code 1

2022-04-21 Thread Nasser M. Abbasi

I am getting lost sections in the table of content for
the very last chapter in the HTML.

It shows only the first 2 sections in the last chapter. But
there are 9 sections there.  It only happens when the document is large.

It seems to be related to some limit buildin.

So I made a MWE to try to find out why. Now on the MWE I get
this error

-
[27910]
l.36 --- TeX4ht warning --- \Link{ }? ---
! TeX capacity exceeded, sorry [number of strings=477757].
\:aplus ...dafter \noexpand \:temp {\the \tmp:cnt
   }}\egroup \:temp
l.36 }

  1508 words of node memory still in use:
17 hlist, 2 vlist, 2 rule, 1 disc, 4 local_par, 1 dir, 22 glue, 5 kern, 4 pe
nalty, 30 glyph, 33 attribute, 116 glue_spec, 33 attribute_list, 1 temp, 4 if_s
tack, 4 write, 26 special nodes
avail lists: 1:1,2:502,3:885,4:5,5:25,6:67,7:1336,9:158,10:4,11:3
!  ==> Fatal error occurred, bad output DVI file produced!
Output written on foo.dvi (27910 pages, 173384940 bytes).


I searched and do not see where to increase number of strings.

My current .cnf is


cat /usr/local/texlive/2022/texmf.cnf

buf_size=9000
pool_size=9000
main_memory=8000
save_size=100


How does one increase "number of strings"?  I have 128 GB of ram.

On a related possible issue: does tex4ht uses lualatex in any way?
I know it uses dvilualatex. does dvilualatex uses lualatex?

Here is the MWE and the command I used.

===
\documentclass[12pt]{book}
\usepackage{pgffor}

\begin{document}
\ifdefined\HCode
\Configure{tableofcontents*}{chapter,section}
\else
\setcounter{tocdepth}{1}
\tableofcontents
\fi

\ifdefined\HCode
\TocAt{chapter,section}
\TocAt{section,subsection}
\fi

\foreach \n in {1,...,50}%
{
   \chapter{\n}
   \foreach \m in {1,...,10}%
   {
   \section{\m}
   \foreach \k in {1,...,200}%
   {
  \subsection{\k}
   }
   }
}
\end{document}



make4ht  -ulm default foo.tex "mathjax,htm,fn-in,4"

[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: foo.tex
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename LineMessage
[ERROR]   htlatex: ?36   TeX capacity exceeded, sorry [number of 
strings=477757].
[ERROR]   htlatex: ?36==> Fatal error occurred, bad output DVI file 
produced!
[FATAL]   make4ht-lib: Fatal error. Command htlatex returned exit code 1





Thanks
--Nasser


Re: [tex4ht] How to control/optimize the number of times make4ht runs dvilualatex?

2022-04-21 Thread Nasser M. Abbasi

I have follow up question:

is the number of times one has to compile the latex file using
lualatex related and will be same as number of times one has
to compile it to HTML using tex4ht?

I mean, if I find that on one file, I need to run lualatex 3 times
to get all references and labels sorted out, does this mean
the same number of times would be needed for tex4ht?

Or not necessarily so? and these are not releated and can be different?

Reason I am asking, is that it is easy to count/find the
number of times needed to call lulatex. So I could use that number of
times, to also call tex4ht on same file.

--Nasser

On 4/19/2022 11:07 PM, Wojciech Myszka wrote:

Dear Michal


In the meantime, you can use something like this config file:


and this solves the problem.

Best regards
Wojtek

wt., 19 kwi 2022 o 22:43 Michal Hoftich  napisał(a):


Hi Wojtek,



I have got the perfect results.

But after changing \section{test} into \section{Test test} and using

latexmk extension, after one latex run the main content in the HTML file is
updated, but the table of contents—is not. This is probably(?) caused by
fact that .toc file is not produced by tex4ht


And this is strange because the .4tc file is updated, but the .4ct not?

On the other hand, making major changes to the source file

(adding/removing another section) — rebuilds the document. The minor change
— (in section title) leaves the table of contents untouched.


It seems that latexmk does not recognize file .4tc as generated during

compilation. The hint in latexmk documentation for solving situation, that
latexmk won’t notice a dependency on a file, bar.baz say is to add (in the
source) \typeout{(bar.baz)}.

Ah, if latexmk needs the filename of .4tc file in the console, I can
add it to TeX4ht sources. In fact, I just did it now. In the meantime,
you can use something like this config file:

\Preamble{xhtml}
\typeout{(\jobname.4tc)}
\begin{document}
\EndPreamble

Best regards,
Michal








Re: [tex4ht] How to control/optimize the number of times make4ht runs dvilualatex?

2022-04-18 Thread Nasser M. Abbasi

On 4/18/2022 5:21 PM, Michal Hoftich wrote:


You can of
course change that using a build file, where you can declare your own
modes and declare commands to be executed.

The default is this:

if mode=="draft" then
   Make:htlatex{}
else
   Make:htlatex{}
   Make:htlatex{}
   Make:htlatex{}
end



Thanks, but the issue is, how does one know if they
need to run it 1, 2 or 3 times? What code do I need to add
to the above to decide?

With lualatex, now this is what I do and it works (other option is to
use latexmk, but for some other reasons, I prefer to stick to makefiles
for now).

--
lualatex  -halt-on-error -interaction=batchmode --shell-escape -file-line-error 
index.tex

if  grep -E 'Rerun to get it removed|Temporary extra page added at the 
end|There were undefined references' index.log ; then
echo "Need to RUN one more time"
lualatex  -halt-on-error -interaction=batchmode --shell-escape 
-file-line-error index.tex
if  grep -E 'Rerun to get it removed|Temporary extra page added at the 
end|There were undefined references' index.log  ; then
echo "Need to RUN one more time"
lualatex  -halt-on-error -interaction=batchmode --shell-escape 
-file-line-error index.tex
fi
fi
---

The above checks after each run if it needs to run again. It does it only
3 times. No need for more.

I do not know what to check for with tex4ht or how to do the above
in the build lua file you show.

How to decide?


Best regards,
Michal


--Nasser


[tex4ht] How to control/optimize the number of times make4ht runs dvilualatex?

2022-04-18 Thread Nasser M. Abbasi

Since some of my files take long time to compile for PDF and HTML,
I've been trying to optimize the number of times needed to compile
them.

With lualatex, I now check in the log file and decided if there
is a need to run lualatex one more time or not.

For tex4ht, it seems to always run 3 times. Even for the most
simple files. Here is an example

-

cat report.tex

\documentclass[11pt]{book}
\begin{document}
test
\end{document}
---

Running the command (all on one line)

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


Shows that

htlatex: LaTeX call: dvilualatex --interaction=errorstopmode -jobname='report'

was called 3 times. Each time. Of course on a small file like this,
it does not matter, but I have files where I timed it taking over 2 hrs
for each one call to dvilualatex. This means 6 hrs in total. This
phase seems to take most of the time.

If I can reduce it to calling it 2 times, this will be big reduction in
time.

But I have no idea how make4ht decides if it needs to run 1 or 2 or 3 times
the program dvilualatex.

With lualatex, it is easy to check. I just check if the log file
contain the string `Rerun` and other variation of it.

My question is: how does make4ht decide it needs to run 3 times
each time? Is it possible to make it more optimal? How would the
user control this from outside?

Thanks
--Nasser




[tex4ht] question on make4ht config.lua

2022-04-15 Thread Nasser M. Abbasi



Small question on make4ht config.lua

I have it in ~/.config/make4ht/config.lua  and I see an INFO saying
it found it. Then later on I see another INFO message saying cannot open
config file config.lua

Is the second message due to trying to open a diffeent config.lua? Why does it
say cannot open it otherwise?


make4ht --shell-escape -ulm default -a debug
-c nma_mathjax.cfg -e config.lua index.tex
'mathjax,htm,fn-in,4,notoc*,p-width,charset=utf-8'
'-cunihtf -utf8' '' --interaction=batchmode

[INFO]mkparams: Output dir:
[INFO]mkparams: Compiler: dvilualatex
[INFO]mkparams: Latex options: -jobname='index'  --interaction=batchmode 
-shell-escape
[INFO]mkparams: tex4ht.sty: 
nma_mathjax.cfg,mathjax,htm,fn-in,4,notoc*,p-width,charset=utf-8,charset=utf-8
[INFO]mkparams: tex4ht:  -cunihtf -utf8
[INFO]mkparams: build_file: config.lua
[INFO]mkparams: Output format: html5
[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: index.tex
[INFO]make4ht: Using configuration file: /home/me/.config/make4ht/config.lua
[INFO]mkutils: Using build file /home/me/.config/make4ht/config.lua
[INFO]mkutils: Load extension   common_domfilters
[INFO]mkutils: Cannot open config file  config.lua <-???
[INFO]make4ht-lib: setting param correct_exit
[INFO]make4ht-lib: setting param correct_exit
[INFO]make4ht-lib: setting param correct_exit
[INFO]make4ht-lib: setting param ext
[INFO]make4ht-lib: Adding:  ext dvi
-

Here is the location of my file


pwd

/home/me/.config/make4ht

ls -lr config.lua

-rwxr-xr-x 1 me me 2596 Apr  7 10:37 config.lua




This is on Ubuntu 20.04 under windows 10 WSL2 Linux subsystem.

Thank you
--Nasser


[tex4ht] [bug #558] tex4ht generated HTML chops parts of overbrace depending on what font is used

2022-04-12 Thread Nasser M. Abbasi
URL:
  

 Summary: tex4ht generated HTML chops parts of overbrace
depending on what font is used
 Project: tex4ht
Submitted by: nma123
Submitted on: Tue Apr 12 21:21:23 2022
Category: None
Priority: 5 - Normal
Severity: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

Reference and screen shots at

https://tex.stackexchange.com/questions/640581/why-tex4ht-chops-parts-of-overbrace-depending-on-what-font-is-used


I found very strange problem using tex4ht in mathjax mode. I am not sure this
is mathjax issue or tex4ht doing something strange to cause it.

When I set my web page font to \Css{body{ font-family: arial, sans-serif;}}
the braces are chopped off. Here is MWE

\documentclass[12pt]{article}%
\usepackage{amsmath}
\begin{document}
\ifdefined\HCode  
\Css{body{ font-family: arial, sans-serif;}}
\fi 

\begin{align*}
v^{2} &  =v_{x}^{2}+v_{y}^{2}
\end{align*}

Therefore the K.E. from (7) becomes%
\begin{align*}
T &  =\overset{\text{cart K.E.}}{\overbrace{\frac{1}{2}M\dot{x}^{2}}%
}+\overset{\text{translation K.E. of physical pendulum}}{\overbrace{\frac
{1}{2}m\left(  \left(  \dot{x}+\frac{L}{2}\dot{\theta}\cos\theta\right)
^{2}+\left(  \frac{L}{2}\dot{\theta}\sin\theta\right)  ^{2}\right)  }%
}+\overset{\text{rotation K.E.}}{\overbrace{\frac{1}{2}\left(  \frac{1}%
{12}mL^{2}\right)  \dot{\theta}^{2}}}
\end{align*}

\end{document}
Compiling using

make4ht  -ulm default -a debug report.tex "mathjax,htm"
Gives (see screen shot)

Removing \Css{body{ font-family: arial, sans-serif;}} and compiling again
gives correct display (screen shot)

This is not the end of this bizarre behaviour. Keeping the \Css command there,
but now removing the equation above the one with the braces, the braces show
again correctly!

\documentclass[12pt]{article}%
\usepackage{amsmath}
\begin{document}
\ifdefined\HCode  
\Css{body{ font-family: arial, sans-serif;}}
\fi 

Therefore the K.E. from (7) becomes%
\begin{align*}
T &  =\overset{\text{cart K.E.}}{\overbrace{\frac{1}{2}M\dot{x}^{2}}%
}+\overset{\text{translation K.E. of physical pendulum}}{\overbrace{\frac
{1}{2}m\left(  \left(  \dot{x}+\frac{L}{2}\dot{\theta}\cos\theta\right)
^{2}+\left(  \frac{L}{2}\dot{\theta}\sin\theta\right)  ^{2}\right)  }%
}+\overset{\text{rotation K.E.}}{\overbrace{\frac{1}{2}\left(  \frac{1}%
{12}mL^{2}\right)  \dot{\theta}^{2}}}
\end{align*}

\end{document}
Gives

(screen shot)

So I am not sure what is going on. Is this a tex4ht issue or mathjax? Why is
setting the page font makes braces to get chopped off? And why is removing an
equation above makes them show up OK?

TL 2021. Here is the raw HTML of the first example above

 
 
 
 
 
 
 
 
window.MathJax = { tex: { tags: "ams", }, };  
   

\begin {align*}  v^{2} 
=v_{x}^{2}+v_{y}^{2}  \end {align*}
Therefore the K.E. from (7)
becomes\begin {align*}  T  =\overset {\text {cart K.E.}}{\overbrace
{\frac {1}{2}M\dot {x}^{2}}}+\overset {\text {translation K.E. of physical
pendulum}}{\overbrace {\frac {1}{2}m\left ( \left ( \dot {x}+\frac {L}{2}\dot
{\theta }\cos \theta \right ) ^{2}+\left ( \frac {L}{2}\dot {\theta }\sin
\theta \right ) ^{2}\right ) }}+\overset {\text {rotation K.E.}}{\overbrace
{\frac {1}{2}\left ( \frac {1}{12}mL^{2}\right ) \dot {\theta }^{2}}}  \end
{align*}
   
 
 



Should math display depend on font used for the web page?

TL 2021






___

Reply to this item at:

  

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



[tex4ht] should one worry about these warning messages from domfilter? Unbalanced Tag

2022-03-24 Thread Nasser M. Abbasi



Lately I started to notice these warning messages compiling using
mathjax  mode a large file.

Output written on KERNEL.dvi (433 pages, 8872308 bytes).
[WARNING] domfilter: 
...ive/2021/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag 
(/pre) [char=23454]

[WARNING] domfilter: 
...ive/2021/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag 
(/p) [char=31509]

Package etex Warning: Extended allocation already in use.
l.855 --- TeX4ht warning --- nonprimitive \everypar ---

It compiles OK and I see no visible issues, but it could be
I missed something.

I do not have a MWE since the file is very large and I do not know where they 
are
coming from. Just thought to check if these can be safely ignored?

The command used is (all on one line)

make4ht --shell-escape -ulm default -a debug
 -c nma_mathjax.cfg -e config.luafilename.tex
 "mathjax,htm,fn-in,SPLIT,notoc*,p-width,charset=utf-8" " -cunihtf 
-utf8"


TL 2021 updated about 2 weeks ago.

Thanks
--Nasser



Re: [tex4ht] [bug #557] tex4ht no longer process some math. What is the cause?

2022-03-24 Thread Nasser M. Abbasi

On 3/24/2022 5:21 PM, Michal Hoftich wrote:

Follow-up Comment #1, bug #557 (project tex4ht):

Hi Nasser,

thanks for the report. I changed the way how environments are handled to use
just internal LaTeX commands. It seems that this caused this issue. I've added
extra \detokenize to the sources. It works for your example.

Best,
Michal



Thanks Michal for the quick fix.

I build the large file and inspected few pages that used to show
these errors and they are all gone.  So the fix looks good.


I'll keep the fix you showed until TL 2022 is released and remove it
then.

regards
--Nasser



[tex4ht] [bug #557] tex4ht no longer process some math. What is the cause?

2022-03-24 Thread Nasser M. Abbasi
URL:
  

 Summary: tex4ht no longer process some math. What is the
cause?
 Project: tex4ht
Submitted by: nma123
Submitted on: Thu Mar 24 21:20:55 2022
Category: None
Priority: 5 - Normal
Severity: 7 - Important
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

reference and screen shots at

https://tex.stackexchange.com/questions/638304/tex4ht-no-longer-process-some-math-what-is-the-cause

This looks like a new serious problem.

I have a document that used to compile OK with tex4ht. I have not build it for
someone. Today when I build it to HTML it is not able to convert some math to
HTML.

This only happens when using mathjax mode. The math is all valid amsmath
package math so One would expect mathjax to handle it directly.

Here is MWE
=
\documentclass[12pt]{book}
\usepackage{amsmath}
\begin{document}
\begin{align}%
\begin{Bmatrix}
c_{1}\\
c_{2}\\
c_{3}\\
c_{4}%
\end{Bmatrix}
&  =%
\begin{pmatrix}
1 & -a & -b & ab\\
1 & a & -b & -ab\\
1 & a & b & ab\\
1 & -a & b & ab
\end{pmatrix}
^{-1}\tag{2}%
\end{align}
\end{document}

And now 

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

gives HTML error (screen shot)

tex4ht compiles it OK when removing mathjax options, which indicates mathjax
is either not able to handle this correctly or tex4ht generated wrong HTML?
But then how did it work OK before?

Here is the raw HTML

==
 
 
 
 
 
 
 
 
window.MathJax = { tex: { tags: "ams", }, };  
   

\begin {align} \csname
@begin:Bmatrix\endcsname \choose:begin {\let \choose:begin \@firstoftwo \ifx
\EndPicture \:Undef \PushStack \envn:list \n:list \SaveEverypar \fi \let
\chk:pic \EndPicture \ifx \EndPicture \:UnDef \list:save \let \after:end
\empty \csname before:beginBmatrix\endcsname \fi \UseHook
{env/Bmatrix/before}\@ifundefined {Bmatrix}{\def \reserved@a {\@latex@error
{Environment Bmatrix undefined}\@eha }}{\def \reserved@a {\def \@currenvir
{Bmatrix}\edef \@currenvline {\on@line }\ifx \EndPicture \:UnDef \ifx
\this:listConfigure \empty \null:listConfigure \csname
onBmatrix:list\endcsname \fi \fi \@execute@begin@hook {Bmatrix}\csname
Bmatrix\endcsname }}\global \@ignorefalse \begingroup \@endpefalse \reserved@a
}{\o:begin: {Bmatrix}} c_{1}\\ c_{2}\\ c_{3}\\ c_{4}\end {Bmatrix} 
=\begin {pmatrix} 1  -a  -b  ab\\ 1  a  -b 
-ab\\ 1  a  b  ab\\ 1  -a  b  ab \end {pmatrix}
^{-1}\tag {2} \end {align}
   
 
 

===

What has changed to cause this math no longer to work in mathjax mode of
tex4ht?

Using TL 2021, fully updated about 2 week ago. On Linux ubuntu.

Thanks
--Nasser





___

Reply to this item at:

  

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



[tex4ht] why arxiv.org choose LaTeXML and not tex4ht for making HTML pages?

2022-02-26 Thread Nasser M. Abbasi



arXiv.org is now starting to display papers in its archive in HTML.

This is new feature just announced not long ago

https://ar5iv.labs.arxiv.org/

"Converted from TeX with LaTeXML."

The have an example there also of a paper converted to HTML.
I do not see anything in there that tex4ht can't do.

Any thoughts if someone knows more about this, why they choose
LaTeXML over tex4ht for making the HTML? The math in those pages
seems to be rendered also by mathjax, which tex4ht supports.

Are their technical reasons for this choice? What can LaTeXML do
which tex4ht can not?

I tried LaTeXML once, about 2 years ago, and thought tex4ht was
better at the time. But I am sure it has improved since then.

Just wondering, that is all. Not trying to start a tex->html conversion
software war :)

--Nasser


Re: [tex4ht] question about missing table vertical lines in HTML after 118 subsections have been processed.

2022-02-05 Thread Nasser M. Abbasi

Hello Micahl;

An update.

Thanks, your fix did fix the vertical lines on tabular that went missing
after 118 subsections.

Now they show in all sections.

But I am afraid a new problem shows up. Now verical lines on
longtable no long show up. I am not sure why.

Here is a MWE (I attached all these in zip file in case of line wraping)

==
\documentclass[12pt]{article}
\usepackage{longtable}
\begin{document}

\begin{tabular}[c]{|l|l|l|l|l|l|l|l|l|}\hline
1&1. (1)&3.9 (50)&16.6 (114)&3.8 (169)&4. (45)&7.5 (169)&4.2 (164)&42.4 (169)\\
2&7.3 (21)&5. (20)&3.6 (17)&1.9 (4)&14.3 (13)&16.8 (5)&4.6 (2)&3.3 (26)\\
4&6.4 (5)&14.3 (13)&40.7 (46)&16.6 (43)&5.5 (43)&4.8 (40)&5.3 (1)&6.9 
(4)\\\hline
\end{tabular}

\begin{longtable}[c]{|l|l|l|l|l|l|l|l|l|}\hline
1&1. (1)&3.9 (50)&16.6 (114)&3.8 (169)&4. (45)&7.5 (169)&4.2 (164)&42.4 (169)\\
2&7.3 (21)&5. (20)&3.6 (17)&1.9 (4)&14.3 (13)&16.8 (5)&4.6 (2)&3.3 (26)\\
4&6.4 (5)&14.3 (13)&40.7 (46)&16.6 (43)&5.5 (43)&4.8 (40)&5.3 (1)&6.9 
(4)\\\hline
\end{longtable}
\end{document}
===

When compiling the above using

make4ht -c ./nma_mathjax.cfg vborder.tex "mathjax,htm"

Then vertical lines in longtable are missing in HTML. But when compiling using

make4ht vborder.tex "mathjax,htm"

Then vertical lines in longtable do show up.  In both cases
the vertical line in tabular show up OK.

the .cfg above is what you send.

It seems the fix had some side interaction with longtable?

Please see attached zip file with the source code and .cfg and HTML generated

Using TL 2021 on Linux.

Thanks for your help
--Nasser<>


Re: [tex4ht] question about missing table vertical lines in HTML after 118 subsections have been processed.

2022-02-04 Thread Nasser M. Abbasi

Btw, after send this email, I noticed that your .cfg file had

 %  \Css{\#TBL-\TableNo\space colgroup{border-left: 1px solid
black;border-right:1px solid black;}}

This looks like wrraping error in email and it should be all on one line

 %  \Css{\#TBL-\TableNo\space colgroup{border-left: 1px solid 
black;border-right:1px solid black;}}

When I fixed this, and made it all on one line, the error went
away. so will try now with this version.

regards
--Nasser


On 2/4/2022 1:43 PM, Nasser M. Abbasi wrote:

On 2/3/2022 8:25 AM, Michal Hoftich wrote:


I also found a way how to support individual vertical rules. Right
now, a table that has one vertical rule, will have set all vertical
rules, regardless of the original LaTeX code. The new code should fix
that. Try the following .cfg file:

%
\Preamble{xhtml}

\catcode`\:=11
\Configure{VBorder}
 {\let\VBorder\empty \let\AllColMargins\empty
  \global\let\GROUPS\empty \HAssign\NewGroup = 0
  \gHAdvance\Next:TableNo by 1 \global\let\TableNo=\Next:TableNo }
 {\xdef\VBorder{\VBorder\ifnum \NewGroup> 0 \fi}
  \HAssign\NewGroup = 0 % \gdef\GROUPS{rules="groups"}
%  \Css{\#TBL-\TableNo\space colgroup{border-left: 1px solid
black;border-right:1px solid black;}}
%\Css{\#TBL-\TableNo{border-collapse:collapse;}}
\ifnum\ar:cnt > 0
  \Css{\#TBL-\TableNo-\ar:cnt {border-right:1px solid black;}}
\else
  \Css{\#TBL-\TableNo-1{border-left: 1px solid black;}}
\fi
}
 {\Advance:\NewGroup by 1
  \ifnum \NewGroup=1 \xdef\VBorder{\VBorder}\fi
  \xdef\VBorder{\VBorder}\xdef\AllColMargins{\AllColMargins1}}
 {\xdef\AllColMargins{\AllColMargins 0}}
\catcode`\:=12
\begin{document}
\EndPreamble

%%%

I will update TeX4ht sources, so it should work soon in TL.

Best regards,
Michal



Hello Michal;

I got a chance finally to try the above. But I am getting an error
on even the most simple example.

make4ht -c ./nma_mathjax.cfg vborder.tex "mathjax,htm"



make4ht -c ./nma_mathjax.cfg vborder.tex "mathjax,htm"

[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: vborder.tex
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename LineMessage
[ERROR]   htlatex: ./nma_mathjax.cfg16   Argument of \c:VBorder: has an 
extra }.
[ERROR]   htlatex: ./nma_mathjax.cfg16   Paragraph ended before 
\c:VBorder: was complete.
[ERROR]   htlatex: ./nma_mathjax.cfg16   Too many }'s.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing number, treated as 
zero.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing = inserted for \ifnum.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing number, treated as 
zero.
[ERROR]   htlatex: ./nma_mathjax.cfg18   LaTeX Error: Missing 
\begin{document} in `./nma_mathjax.cfg'.
[ERROR]   htlatex: ./nma_mathjax.cfg23   Too many }'s.
[ERROR]   htlatex: ./nma_mathjax.cfg24   Undefined control sequence.
[ERROR]   htlatex: ./nma_mathjax.cfg24   Missing number, treated as 
zero.
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename LineMessage
[ERROR]   htlatex: ./nma_mathjax.cfg16   Argument of \c:VBorder: has an 
extra }.
[ERROR]   htlatex: ./nma_mathjax.cfg16   Paragraph ended before 
\c:VBorder: was complete.
[ERROR]   htlatex: ./nma_mathjax.cfg16   Too many }'s.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing number, treated as 
zero.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing = inserted for \ifnum.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing number, treated as 
zero.
[ERROR]   htlatex: ./nma_mathjax.cfg18   LaTeX Error: Missing 
\begin{document} in `./nma_mathjax.cfg'.
[ERROR]   htlatex: ./nma_mathjax.cfg23   Too many }'s.
[ERROR]   htlatex: ./nma_mathjax.cfg24   Undefined control sequence.
[ERROR]   htlatex: ./nma_mathjax.cfg24   Missing number, treated as 
zero.
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename LineMessage
[ERROR]   htlatex: ./nma_mathjax.cfg16   Argument of \c:VBorder: has an 
extra }.
[ERROR]   htlatex: ./nma_mathjax.cfg16   Paragraph ended before 
\c:VBorder: was complete.
[ERROR]   htlatex: ./nma_mathjax.cfg16   Too many }'s.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing number, treated as 
zero.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing = inserted for \ifnum.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing number, treated as 
zero.
[ERROR]   htlatex: ./nma_mathjax.cfg18   LaTeX Error: Missing 
\begin{document} in `./nma_mathjax.cfg'.
[ERROR]   htlatex: ./nma_mathjax.cfg23   Too many }'s.
[ERROR]   htlatex: ./nma_mathjax.cfg24   Undefined control sequence.
[ERROR]   htlatex: ./nma_mathjax.cfg24   Missing number,

Re: [tex4ht] question about missing table vertical lines in HTML after 118 subsections have been processed.

2022-02-04 Thread Nasser M. Abbasi

On 2/3/2022 8:25 AM, Michal Hoftich wrote:


I also found a way how to support individual vertical rules. Right
now, a table that has one vertical rule, will have set all vertical
rules, regardless of the original LaTeX code. The new code should fix
that. Try the following .cfg file:

%
\Preamble{xhtml}

\catcode`\:=11
\Configure{VBorder}
{\let\VBorder\empty \let\AllColMargins\empty
 \global\let\GROUPS\empty \HAssign\NewGroup = 0
 \gHAdvance\Next:TableNo by 1 \global\let\TableNo=\Next:TableNo }
{\xdef\VBorder{\VBorder\ifnum \NewGroup> 0 \fi}
 \HAssign\NewGroup = 0 % \gdef\GROUPS{rules="groups"}
   %  \Css{\#TBL-\TableNo\space colgroup{border-left: 1px solid
black;border-right:1px solid black;}}
   %\Css{\#TBL-\TableNo{border-collapse:collapse;}}
   \ifnum\ar:cnt > 0
 \Css{\#TBL-\TableNo-\ar:cnt {border-right:1px solid black;}}
   \else
 \Css{\#TBL-\TableNo-1{border-left: 1px solid black;}}
   \fi
}
{\Advance:\NewGroup by 1
 \ifnum \NewGroup=1 \xdef\VBorder{\VBorder}\fi
 \xdef\VBorder{\VBorder}\xdef\AllColMargins{\AllColMargins1}}
{\xdef\AllColMargins{\AllColMargins 0}}
\catcode`\:=12
\begin{document}
\EndPreamble

%%%

I will update TeX4ht sources, so it should work soon in TL.

Best regards,
Michal



Hello Michal;

I got a chance finally to try the above. But I am getting an error
on even the most simple example.

make4ht -c ./nma_mathjax.cfg vborder.tex "mathjax,htm"



make4ht -c ./nma_mathjax.cfg vborder.tex "mathjax,htm"

[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: vborder.tex
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename LineMessage
[ERROR]   htlatex: ./nma_mathjax.cfg16   Argument of \c:VBorder: has an 
extra }.
[ERROR]   htlatex: ./nma_mathjax.cfg16   Paragraph ended before 
\c:VBorder: was complete.
[ERROR]   htlatex: ./nma_mathjax.cfg16   Too many }'s.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing number, treated as 
zero.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing = inserted for \ifnum.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing number, treated as 
zero.
[ERROR]   htlatex: ./nma_mathjax.cfg18   LaTeX Error: Missing 
\begin{document} in `./nma_mathjax.cfg'.
[ERROR]   htlatex: ./nma_mathjax.cfg23   Too many }'s.
[ERROR]   htlatex: ./nma_mathjax.cfg24   Undefined control sequence.
[ERROR]   htlatex: ./nma_mathjax.cfg24   Missing number, treated as 
zero.
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename LineMessage
[ERROR]   htlatex: ./nma_mathjax.cfg16   Argument of \c:VBorder: has an 
extra }.
[ERROR]   htlatex: ./nma_mathjax.cfg16   Paragraph ended before 
\c:VBorder: was complete.
[ERROR]   htlatex: ./nma_mathjax.cfg16   Too many }'s.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing number, treated as 
zero.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing = inserted for \ifnum.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing number, treated as 
zero.
[ERROR]   htlatex: ./nma_mathjax.cfg18   LaTeX Error: Missing 
\begin{document} in `./nma_mathjax.cfg'.
[ERROR]   htlatex: ./nma_mathjax.cfg23   Too many }'s.
[ERROR]   htlatex: ./nma_mathjax.cfg24   Undefined control sequence.
[ERROR]   htlatex: ./nma_mathjax.cfg24   Missing number, treated as 
zero.
[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename LineMessage
[ERROR]   htlatex: ./nma_mathjax.cfg16   Argument of \c:VBorder: has an 
extra }.
[ERROR]   htlatex: ./nma_mathjax.cfg16   Paragraph ended before 
\c:VBorder: was complete.
[ERROR]   htlatex: ./nma_mathjax.cfg16   Too many }'s.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing number, treated as 
zero.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing = inserted for \ifnum.
[ERROR]   htlatex: ./nma_mathjax.cfg18   Missing number, treated as 
zero.
[ERROR]   htlatex: ./nma_mathjax.cfg18   LaTeX Error: Missing 
\begin{document} in `./nma_mathjax.cfg'.
[ERROR]   htlatex: ./nma_mathjax.cfg23   Too many }'s.
[ERROR]   htlatex: ./nma_mathjax.cfg24   Undefined control sequence.
[ERROR]   htlatex: ./nma_mathjax.cfg24   Missing number, treated as 
zero.
[STATUS]  make4ht: Conversion finished



===

Where vboard.tex is

==
\documentclass[12pt]{article}
\begin{document}

test

\end{document}
=

And nma_mathjax.cfg  is


cat ./nma_mathjax.cfg



\Preamble{xhtml,p-width}

%TMP FIX due to table header missing 2/4/2022. Rememember to remove when
%texht sources are updated. by Micahl.
%
\catcode`\:=11
\Configure{VBorder}
   {\let\VBorder\empty \let\AllColMargins\empty
\global\let\GROUPS\empty \HAssign\NewGroup = 0

  1   2   3   4   5   >