[tex4ht] [bug #623] Images inverted with dark mode by default html5 css

2024-05-10 Thread Michal Hoftich
Update of bug #623 (project tex4ht):

 Open/Closed:Open => Closed 


___

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-30 Thread Michal Hoftich
Hi Nasser,

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

Deletion of the huge equations seems like a good solution because it also
totally breaks your page layout.

Best,
Michal


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

2024-04-29 Thread Michal Hoftich
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 #624] File ended while scanning use of \AltMathOne. error

2024-04-25 Thread Michal Hoftich
Follow-up Comment #2, bug #624 (project tex4ht):

Hi Nasser, 

I would prefer use of a special environment, like this:

%%%
% https://puszcza.gnu.org.ua/bugs/?624
\documentclass[12pt]{article}

\usepackage{amsmath}
\usepackage{longtable}
\usepackage{array}
\newcolumntype{C}{>{$}c<{$}}

\NewDocumentEnvironment{longmathtable}{m+b}{
  \begin{longtable}{#1}
#2
  \end{longtable}
}{}
\ifdefined\HCode
\RenewDocumentEnvironment{longmathtable}{m+b}{
  \alteqtoks{\[\begin{array}{#1}
  #2
   \end{array}\]
  }
}{}
\fi


\begin{document}

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

\end{document} 
%%%

I've defined a new column type, C, so you don't need to type all these ugly
preambles, and also so it works better with MathJax. The redefined environment
will print array in math mode. 

___

Reply to this item at:

  

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



[tex4ht] [bug #623] Images inverted with dark mode by default html5 css

2024-04-09 Thread Michal Hoftich
Follow-up Comment #3, bug #623 (project tex4ht):

Dear Oliver, 

thanks for the confirmation. It was really an omission on my side that I added
color inversion, but didn't set the basic colors. I probably forgot to import
it from the test file I used at the time. I will add it now.

___

Reply to this item at:

  

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



[tex4ht] [bug #623] Images inverted with dark mode by default html5 css

2024-04-09 Thread Michal Hoftich
Follow-up Comment #1, bug #623 (project tex4ht):

Dear Olivier,

Yes, I've added this rule because I've found that images created from math or
TikZ images with transparent backgrounds were completely black. They always
have a filename that starts with the \jobname, so src^="\jobname" should match
only these images, as opposed to pictures included by \includegraphics, which
generally aren't named the same as the main document. So, it is really strange
that the images you included are inverted. This rule shouldn't apply to them.

But as you wrote that you have a white background, I realized we don't set a
dark background in the dark mode. We should fix that. Does the following
config file work for you?

\Preamble{xhtml}
\Css{
body {
  background-color: Canvas;
  color: CanvasText;
  color-scheme: light dark;
}
}
\begin{document}
\EndPreamble




___

Reply to this item at:

  

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



Re: [tex4ht] Working examples of bibtex / multibib with tex4ebook?

2024-03-05 Thread Michal Hoftich
Hi Jürgen,

it is possible that TeX4ht files in Miktex are too old. Alphabetic
style works for me correctly, with one small issue, the links from
citations to the bibliography don't work. A BibLaTeX update could
cause it, because I think links used to work.

I also found that the multibib issue that I experienced was caused by
naming one of the bibliographies as a "book". Multibib then loads a
file named book.aux in the way, which causes TeX4ht to load
configurations for the Book class. As I was using the Article class,
this fact caused a clash. When I renamed the bibliography to a
different name, the file compiled without errors.

Best regards,
Michal

On Tue, Mar 5, 2024 at 7:27 AM Jürgen Hubert via tex4ht  wrote:
>
> Okay, I've switched to BibLaTeX, and through some testing have managed to 
> create EPUB files with bibliographies. So far, so good, although further 
> testing will be necessary.
>
> I did notice something interesting, though. I've been using the "alphabetic" 
> style, since that was what I used with multibib:
>
> \usepackage[style=alphabetic, backend=biber]{biblatex}
>
> I have a number of .bib entries - websites, mostly - which do not have an 
> author, but a key instead.
>
> @misc{ AIV,
> key = {Architekten und Ingenieurverein Berlin Brandenburg},
> title = "{Schinkel-Wettbewerb 2005}",
> howpublished = 
> {\url{https://www.aiv-berlin-brandenburg.de/wp-content/uploads/2010/05/Dokumentation_SW_2005.pdf}},
> note = {Accessed: 2022-10-31}
> }
>
> The bibliography entry in the pdf looks like this:
>
> [Arc] Schinkel-Wettbewerb 2005. https://www.aiv-berlin-brandenburg.de/
>   wp-content/uploads/2010/05/Dokumentation_SW_2005.pdf. Accessed:
>   2022-10-31.
>
> However, the tex4ebook entry looks like this:
>
> []Schinkel-Wettbewerb 2005. 
> https://www.aiv-berlin-brandenburg.de/wp-content/uploads/2010/05/Dokumentation_SW_2005.pdf.
>  Accessed: 2022-10-31.
>
>



Re: [tex4ht] Working examples of bibtex / multibib with tex4ebook?

2024-03-04 Thread Michal Hoftich
Hi Jürgen,

> I did it again - I've waited too long to update my LaTeX packages, and now my 
> old files will no longer compile correctly. So now I have to carefully wade 
> through my code and test anything.

I can see that  there is no configuration file for multibib. Bibtex
itself should work. I can try to debug multibib, but a testing file
would be nice.

You can also try BibLaTeX and it is much more powerful than both
bibtex and multibib.

Best regards,
Michal



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

2024-02-26 Thread Michal Hoftich
Update of bug #620 (project tex4ht):

 Open/Closed:Open => Closed 


___

Reply to this item at:

  

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



[tex4ht] [bug #622] error with \footnote mark in \section*

2024-02-26 Thread Michal Hoftich
Follow-up Comment #1, bug #622 (project tex4ht):

Hi Ulrike, thanks for the report. The problem here is that TeX4ht writes all
section titles to the .4tc file. It uses \protected@edef internally, which
fails with \footnotemark. 

\footnotemark is redefined by TeX4ht, using \HLet. The resulting command is
not robust, but we can make it robust using \MakeRobust. Is that a safe
solution?

___

Reply to this item at:

  

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



Re: [tex4ht] Non-tabular plain TeX alignments & indentation in HTML

2024-02-06 Thread Michal Hoftich
Hi Richard,

>
> I have a plain TeX application in which I'd like to try converting some
> non-tabular alignments into  elements with text that's (roughly)
> the alt text tex4ht would produce for those alignments in display math
> mode. But I can't figure out how to produce that alt text directly. Any
> advice/pointers/suggestions?


You can use \Picture+{}...\EndPicture command to convert the enclosed
code to pictures. It automatically creates the alternative text too,
based on the contents. See the documentation:
https://www.kodymirus.cz/tex4ht-doc/Configurations.html#low-level-features

To support also the PDF creation, I would create some extra commands
that would do nothing in the PDF mode, but invoke \Picture+ in TeX4ht.
The file mymacros.tex can look like this:

%%
\def\startalign{}
\def\stopalign{}
% code to be executed with TeX4ht
\ifdefined\HCode
 \csname tex4ht\endcsname % load TeX4ht
 % redefine commands to produce pictures
 \def\startalign{\Picture+{}}
 \def\stopalign{\EndPicture}
\fi
%%

You can use it in your document in this way:

%%
\input mymacros
\startalign
\vbox{\+if n$<$r \cleartabs& then n:=n+1\cr
\+  print\_totals; n:=0;\cr
\+&\cr
\+while p$>$0 do&\cr
\+\quad\cleartabs q:= link(p); free\_node(p); p:=q\cr
\+\cr}
\stopalign
\bye
%%

Best regards,
Michal


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

2024-01-31 Thread Michal Hoftich
Hi Nasser,

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

it is possible that the id attribute was removed by DOM filters. They
should support unquoted attributes, but in general, it is better to
always use quotes for attributes, to prevent issues such as this.

Best regards,
Michal


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

2024-01-16 Thread Michal Hoftich
Follow-up Comment #1, bug #620 (project tex4ht):

The original issue is caused by your URL not fitting on a line, so it gets a
linebreak, resulting in white space. The solution is to use larger
\textwidth.

We also found an actual bug, that using the `]` character in \href produced a
wrong link. I hopefully fixed that in the sources.

___

Reply to this item at:

  

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



[tex4ht] [bug #619] Invalid html generated for enumitem enumerations.

2024-01-15 Thread Michal Hoftich
Update of bug #619 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #3:

OK, thanks for the clarification. So I am closing this now.

___

Reply to this item at:

  

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



[tex4ht] [bug #619] Invalid html generated for enumitem enumerations.

2024-01-12 Thread Michal Hoftich
Follow-up Comment #1, bug #619 (project tex4ht):

Is there a  reason for use of the item environment instead of the \item
command? It seems that this causes issues, as the following works fine:

\begin{enumerate}[label=(\arabic*)]
  \item An item.
  \item A second item.
  \item A third item.
\end{enumerate}


___

Reply to this item at:

  

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



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

2024-01-11 Thread Michal Hoftich
Follow-up Comment #16, bug #617 (project tex4ht):

Ah, so the mystery is solved :)

Thanks.

___

Reply to this item at:

  

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



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

2024-01-10 Thread Michal Hoftich
Follow-up Comment #14, bug #617 (project tex4ht):

Something needs to be wrong on my side. I've noticed, that even the hybrid
option doesn't work with the markdown environment. Both with make4ht and
LuaLaTeX. But, if I use the \markdownSetup command to make these options
global, they work. 

So the following example works, but not if I remove the \markdownSetup
command:

%%%
\documentclass{book}
\usepackage{lmodern}
\usepackage{booktabs}
% Load the Markdown package and set its options.
\usepackage[
]{markdown}
\markdownSetup{
  hybrid,html
}
\begin{document}

\begin{markdown}[hybrid]
  hello \TeX, what's goind on?
\end{markdown}

\begin{markdown}[html,hybrid]
Here is some HTML code mixed *with Markdown*. In \TeX, the HTML code
will be silently ignored, whereas in \TeX 4ht, the HTML code will be passed
through to the output:


  
Emil
Tobias
Linus
  
  
16
14
10
  

\end{markdown}
\end{document}
%%%



___

Reply to this item at:

  

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



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

2024-01-10 Thread Michal Hoftich
Follow-up Comment #12, bug #617 (project tex4ht):

I used the default installation of the Markdown package in my TeX Live, it
says "Package: markdown 2023-04-27 v2.23.0-0-g0b22f91 markdown renderer", so
it seems pretty old, but probably correct, as it is the same as the latest
release on CTAN. I guess this version doesn't support inline HTML?

I've missed that the example is meant for PDFLaTeX, so I used LuaLaTeX, which
led to the missing accented characters. They are here when I switch engines.

___

Reply to this item at:

  

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



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

2024-01-10 Thread Michal Hoftich
Follow-up Comment #10, bug #617 (project tex4ht):

Yes, exactly. I see HTML tags in both PDF and HTML outputs. 

(file #530, file #531)
___

Additional Item Attachment:

File name: markdown-html.png  Size:37 KB
File name: markdown-pdf.png   Size:74 KB


___

Reply to this item at:

  

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



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

2024-01-10 Thread Michal Hoftich
Follow-up Comment #8, bug #617 (project tex4ht):

BTW is it OK that the last code snippet in the TeX file, which contains HTML
tags, is inserted verbatim in the output? I thought that HTML tags should be
passed to the HTML output without escaping.

___

Reply to this item at:

  

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



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

2024-01-10 Thread Michal Hoftich
Follow-up Comment #7, bug #617 (project tex4ht):

Yeah, it seems fine. I will update the TeX4ht sources then.

___

Reply to this item at:

  

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



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

2024-01-09 Thread Michal Hoftich
Follow-up Comment #5, bug #617 (project tex4ht):

Thanks for the report. I think this was caused by a fix for another issue:
https://github.com/michal-h21/make4ht/issues/141 

I've made a version of `\FVC@Verb` macro which works both with your example
and with the code from the Minted issue. The reason why we need to disable
\a:fancyvrb is that it causes discarding of all output that follows. This
happens because we need to get rid of some spurious characters and spaces that
would otherwise cause blank lines in HTML. So all of this is a bit hacky. 

See the newly uploaded fancyvrb.4ht file. If it works fine, I will update
TeX4ht sources.

(file #527)
___

Additional Item Attachment:

File name: fancyvrb.4ht   Size:5 KB


___

Reply to this item at:

  

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



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

2023-12-19 Thread Michal Hoftich
Update of bug #616 (project tex4ht):

 Open/Closed:Open => Closed 


___

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 Michal Hoftich
Hi Karl,


>
> 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 it is

tex4ht -utf8 -cunihtf 

Best
Michal


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

2023-12-13 Thread Michal Hoftich
On Wed, Dec 13, 2023 at 11: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.

Sorry, Nasser sent the link only to me directly. But it seems that he
deleted it from his server, and I have it on my other computer.

Nasser, can you please upload it again?

Best,
Michal



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

2023-12-13 Thread Michal Hoftich
On Wed, Dec 13, 2023 at 10:46 PM Karl Berry  wrote:
>
> Nasser/Michal - does one of the tex4ht binaries actually crash in
> processing your giant document? Or does it just fail silently somewhere
> in the middle?
>

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.

Best,
Michal



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

2023-12-13 Thread Michal Hoftich
>
> 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.
>

I think this is a good idea. With larger files, everything is more
complicated, you risk running out of memory etc. I noticed that even
the DOM filters were really slow, and they are normally quite fast.

Anyway, I've at least added support for the \marginnote command, which
was missing in TeX4ht.

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

I've tried it on my work computer and I am already running out of the
disk space, so I am not sure I will be able to keep it :/

Best,
Michal


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

2023-12-12 Thread Michal Hoftich
Follow-up Comment #3, bug #617 (project tex4ht):

Hi Vítek, 

thanks for the confirmation. I've added this code to TeX4ht sources, so it
should be available in TeX Live soon.

___

Reply to this item at:

  

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



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

2023-12-12 Thread Michal Hoftich
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.

___

Reply to this item at:

  

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



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

2023-12-11 Thread Michal Hoftich
Follow-up Comment #1, bug #617 (project tex4ht):

Hi Vítek, 

thanks for the report. I am pretty sure that \VerbatimInput worked in the
past, as I used it occasionally. I cannot find the place where spurious
newlines come from, so we need to use a work around - insert special TeX4ht
instructions to ignore characters and space. You can try this configuration
file:

\Preamble{xhtml}
\catcode`\:=11
\Configure{fancyvrb}
   {\IgnorePar \EndP \gHAdvance\fancyvrbNo by 1
\gHAssign\fancyvrb:cnt0
\HCode{}\ht:special{t4ht@[}}
   {x\EndP\ht:special{t4ht@]}\HCode{}}
   {\ht:special{t4ht@]}\gHAdvance\fancyvrb:cnt by 1
\ifnum \fancyvrb:cnt>1
\HCode{\Hnewline}\fi} {}
   {}{\ht:special{t4ht@[}}
\catcode`\:=12
\begin{document}
\EndPreamble


It seems to work for both Verbatim environment and \VerbatimInput. If it works
for you too, I will update TeX4ht sources.

___

Reply to this item at:

  

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



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

2023-12-05 Thread Michal Hoftich
Hi Nasser,

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

The running script that I gave you checks for the AUX file, XREF file
and TOC, and it continues  the compilation until they don't change -
so when you don't change sections, cross-references and other stuff
that is written to these files, it should do only one compilation. If
these files change between compilations, it will run as many
compilations as specified in max_compilations variable. Check how
large it is, maybe we were experimenting with it and it is too large.
Value of 3 should be enough.

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

The problem is mostly with hyperlinks and large  tables. But all of
this depends on the auxilary files the script checks, so you won't get
any better results with the log parsing.

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

Yes, it is too much. You can try to print the number of compilations
used in the checksum script by adding this line before return status
in Make:add("myhtlatex", ...) function:

print("Number of compilations: " .. compilation_count)

I am not sure which version of this file you use now, I know there are
multiple versions and I am afraid that I cannot find the most recent
one, so I cannot post the whole function here. Anyway, if the number
is too large, it can be caused by some bug in the script.

Best regards,
Michal


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

2023-12-04 Thread Michal Hoftich
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. Also the rerunfilecheck package is
also based on checksums of temporary files, so it should work
similarly.

Best,
Michal


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

2023-11-22 Thread Michal Hoftich
Follow-up Comment #1, bug #616 (project tex4ht):

I've posted my answer to TeX.sx. Unfortunately, I have only a workaround for
this issue, as the column specification for the C column isn't passed down to
TeX4ht by the Array package.

___

Reply to this item at:

  

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



[tex4ht] [bug #229] tex4ht removes spaces in array column when used inside tabular

2023-11-07 Thread Michal Hoftich
Update of bug #229 (project tex4ht):

 Open/Closed:Open => Closed 


___

Reply to this item at:

  

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



[tex4ht] [bug #229] tex4ht removes spaces in array column when used inside tabular

2023-11-06 Thread Michal Hoftich
Follow-up Comment #1, bug #229 (project tex4ht):

I think that I've found the source of this issue. We set some table dimensions
to zero in the array. I am unsure why it was done, but when I remove this
setting, this example keeps the correct spacing. It didn't change anything in
other tests I've run, so I hope it is safe to remove it.

___

Reply to this item at:

  

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



[tex4ht] [bug #172] oolatex: Spurious spaces after cross references and citations

2023-11-03 Thread Michal Hoftich
Update of bug #172 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #3:

I've tried this MWE and while the original issue was fixed, some more appeared
over the years. But everything should be OK now.

___

Reply to this item at:

  

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



[tex4ht] [bug #239] tabu + htlatex gives error message

2023-11-02 Thread Michal Hoftich
Update of bug #239 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #1:

We have the basic support for Tabu for some time, but it doesn't work in all
cases. I've found this old answer, which produces an error with the current
TeX4ht. I've incorporated ideas from the answer to TeX4ht sources, it should
fix some issues. 

Of course, it is better to not use Tabu at all, as it is obsolete.

___

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-11-02 Thread Michal Hoftich
Update of bug #614 (project tex4ht):

 Open/Closed:Open => Closed 


___

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-11-01 Thread Michal Hoftich
Follow-up Comment #1, bug #614 (project tex4ht):

Hi Nasser,

thanks for the report. I've fixed this issue in the sources and posted an
explanation to TeX.sx.



___

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-25 Thread Michal Hoftich
Hi Nasser,

> 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}
> ---

Don't use \def\pgfsysdriver{pgfsys-tex4ht-updated.def}, the correct
driver is selected automatically, and it should be
`pgfsys-dvisvgm4ht.def`, not `pgfsys-tex4ht-updated.def`.

Best regards,
Michal


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

2023-10-24 Thread Michal Hoftich
Hi Nasser,


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


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


[tex4ht] [bug #312] tcolorbox package does not work with tex4ht. All newlines are lost in listings

2023-10-20 Thread Michal Hoftich
Follow-up Comment #1, bug #312 (project tex4ht):

I've tried this now, and it worked, except the fact that the box wasn't closed
correctly. The Listings library uses a different macro to be called at the end
of the environment that it defines, so we need to patch it to close the box.
There was also some wrong formatting, so I fixed that too.

___

Reply to this item at:

  

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



[tex4ht] [bug #246] \usepackage{cprotect} generate extra strange letters not in text in HTML

2023-10-19 Thread Michal Hoftich
Update of bug #246 (project tex4ht):

 Open/Closed:Open => Closed 


___

Reply to this item at:

  

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



[tex4ht] [bug #246] \usepackage{cprotect} generate extra strange letters not in text in HTML

2023-10-18 Thread Michal Hoftich
Follow-up Comment #2, bug #246 (project tex4ht):

I know this is super old, but I've found a fix for the Cprotect package and
pushed them to the source. We just need to define the \CPT@hat@hat@E@hat@hat@L
command with correct catcodes.

___

Reply to this item at:

  

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



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

2023-10-18 Thread Michal Hoftich
Update of bug #605 (project tex4ht):

 Open/Closed:Open => Closed 


___

Reply to this item at:

  

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



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

2023-10-18 Thread Michal Hoftich
Update of bug #612 (project tex4ht):

 Open/Closed:Open => Closed 


___

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 Michal Hoftich
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}{}


> 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


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

2023-10-14 Thread Michal Hoftich
Hi Nasser,

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

The clean mode deletes all output files, including temporary and
converted HTML files. This is stated in the documentation. I don't
remember why it was set up this way, but it was likely based on a user
request. However, files that you place in the output directory using
the -d option are not deleted by the clean mode. The development
version of make4ht also includes a new option, --build-dir, which
moves all auxiliary files to a temporary directory that can be
deleted. This may be a better solution than the clean mode.

Best regards,
Michal


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

2023-10-13 Thread Michal Hoftich
Follow-up Comment #1, bug #612 (project tex4ht):

Thanks for the report. I've added my anwser on TeX.sx and updated TeX4ht
sources with the support.

___

Reply to this item at:

  

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



Re: [tex4ht] [bug #477] Support for new LaTeX hook management

2023-10-09 Thread Michal Hoftich
Hello Ulrike,

> Which fatal clash?  Do you have an example?

Sorry, it is not a fatal crash, only a bunch of error messages and
invalid generated HTML file. I think I've posted this sample before,
but here it is to be sure:


\DocumentMetadata{testphase={phase-III,math}}
\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\begin{document}
\section{Does section work?}

hello inline $a = b$.

\[
  a = \frac{b^2}{\sqrt{c}}
\]

\end{document}
%

You can compile it using:

$ make4ht -m draft -a debug sample.tex "mathml"

Without display math, it compiles without problems, so tagging doesn't
cause errors on itself, but only when you use commands that clash.

Best regards,
Michal


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

2023-10-09 Thread Michal Hoftich
Follow-up Comment #1, bug #605 (project tex4ht):

I've made a big change in the TOC processing. I've removed hard spaces that
were inserted, and indentation should be done solely using CSS. I've changed
the indentation for each TOC level, now they change by 1em instead of 2em as
previously. I've also removed lot of complicated CSS rules that were used for
the Book class, and added CSS rules for Article and Report. 

I hope it will work better than previously.

___

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-09 Thread Michal Hoftich
Hi Nasser,

you are not using the copy_images extension. You cannot select make4ht
extension using TeX4ht options as in "mathjax,htm,nostyle,copy_image".
You need to add it to the -f option of make4ht. So the correct call
is:

$ make4ht -ulm default -f html5+copy_images foo.tex "mathjax,htm,nostyle"

To confirm that an extension is used, you can look for this message at
the beginning of the make4ht run, with the -a debug option:

[INFO]mkutils: Load extension   copy_images



Best regards,
Michal


[tex4ht] [bug #238] htlatex outputs extra word not in document when using \columnbreak with multicols

2023-10-06 Thread Michal Hoftich
Update of bug #238 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #3:

I think this issue was fixed in the meantime, I don't get any extra words with
current TeX4ht.

___

Reply to this item at:

  

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



[tex4ht] [bug #237] problem with titlesec package with tex4ht when using starred version of \section

2023-10-06 Thread Michal Hoftich
Update of bug #237 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #1:

This issue seems to be resolved, the MWE compiles without errors.

___

Reply to this item at:

  

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



[tex4ht] [bug #225] Htlatex ignores \tag in equation

2023-10-06 Thread Michal Hoftich
Update of bug #225 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #1:

The test file seems to work now, so the issue was fixed in the meantime.

___

Reply to this item at:

  

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



[tex4ht] [bug #259] mathtools and starred version of a DeclarePaireDelimiter macro

2023-10-06 Thread Michal Hoftich
Update of bug #259 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #2:

The original code seems to work now.

___

Reply to this item at:

  

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



[tex4ht] [bug #424] inline math alignment problem in svg mode when using tex4ht

2023-10-06 Thread Michal Hoftich
Update of bug #424 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #1:

I found a solution for the vertical alignment of inline math some time ago.
The details are described in this answer on TeX.sx:
https://tex.stackexchange.com/a/662257/2891

So today, when you use the "pic-m" option, you should get a correct
alignment.



___

Reply to this item at:

  

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



[tex4ht] [bug #340] Math issues in the ODF export

2023-10-05 Thread Michal Hoftich
Update of bug #340 (project tex4ht):

 Open/Closed:Open => Closed 


___

Reply to this item at:

  

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



[tex4ht] [bug #340] Math issues in the ODF export

2023-10-05 Thread Michal Hoftich
Follow-up Comment #10, bug #340 (project tex4ht):

It seems that most of these issues were resolved in the meantime. The only
remaining issue was incorrect support for some relation operators:

2. Instead of "<" characters at start of array columns, upside-down "?" are
displayed. 

I think it is LibreOffice's bug, but as a workaround, I've found that empty
 inserted before these operators work. The fix is included in the
development version of make4ht.

___

Reply to this item at:

  

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



Re: [tex4ht] sh: 1: rungs: not found

2023-10-04 Thread Michal Hoftich
Hi Krister,

> Excuse me for not specifying.  I'm using the ubuntu 23.04 packages for 
> texlive-base. It appears as though `/usr/bin/rungs` appears in the 22.10 
> release but not in the 23.04!
>
> https://packages.ubuntu.com/search?suite=kinetic=any=exactfilename=contents=rungs
>
> Should I submit a bug report at ubuntu?

That's strange! But I would wait for input from Karl, he may know more
about this issue.

Best,
Michal


Re: [tex4ht] sh: 1: rungs: not found

2023-10-04 Thread Michal Hoftich
Hello Krister,

> I'm using htlatex, and a new error has appeared when I run it:
>
> --- Warning --- System return: 32512
> System call: rungs -q -dNOPAUSE -dBATCH -dusecropbox -sDEVICE=pngalpha -r300  
> -sOutputFile="fig//expand-.png" "fig//expand.pdf"
> sh: 1: rungs: not found
>
> I found a thread that mentions that "rungs" is a Lua script, but the thread 
> does not mention a workaround:
> https://www.mail-archive.com/tex4ht@tug.org/msg02732.html

Which distro do you use? TeX Live or Miktex? Rungs should be part of
your TeX distro, so maybe you need to just install some additional
packages.

Best regards,
Michal


[tex4ht] [bug #477] Support for new LaTeX hook management

2023-10-04 Thread Michal Hoftich
Follow-up Comment #13, bug #477 (project tex4ht):

I've disabled the \DocumentMetadata command in tex4ht.sty. Thich change needs
the development version of make4ht because in the stable version, tex4ht.sty
is not loaded before \documentclass, where \DocumentMetadata should be used.
The options passed to this command are saved in the \:DocumentMetadata
command, so it should be possible to process them later.

This change is necessary to prevent a fatal clash between LaTeX's tagging
support and TeX4ht. 

___

Reply to this item at:

  

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



[tex4ht] [bug #173] oolatex: Invalid translation of equation with hat over greek letter and non-atomic subscript

2023-10-04 Thread Michal Hoftich
Update of bug #173 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #1:

This issue was resolved sometime in the last ten years, as the resulting
MathML code is correct. What is incorrect is the rendering in LibreOffice,
which doesn't show the hat over α. The same code works without problems in
Firefox, so I guess it is a LO bug.

___

Reply to this item at:

  

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



[tex4ht] [bug #601] babel spanish and htlatex mathml have bad ineraction

2023-10-04 Thread Michal Hoftich
Update of bug #601 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #2:

This should be fixed in the sources.

___

Reply to this item at:

  

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



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

2023-10-04 Thread Michal Hoftich
Update of bug #610 (project tex4ht):

 Open/Closed:Open => Closed 


___

Reply to this item at:

  

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



[tex4ht] [bug #552] Unwanted space at \hspace{0pt}

2023-10-04 Thread Michal Hoftich
Update of bug #552 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #7:

This can also be closed, I hope.

___

Reply to this item at:

  

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



[tex4ht] [bug #547] problem with citations

2023-10-04 Thread Michal Hoftich
Update of bug #547 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #5:

I think we can close this issue?

___

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-02 Thread Michal Hoftich
Hi Nasser,

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

This is not so easy, because make4ht by default doesn't read the input
file and the detection of the document class wouldn't be that
straight-forward. It couldn't do that by default, maybe using an
extension. But it would be quite a lot of work, so I am not sure that
this issue is worth it :)

Best,
Michal


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

2023-10-02 Thread Michal Hoftich
Follow-up Comment #1, bug #610 (project tex4ht):

Hi Nasser, thanks for the report.

I've posted the immediate solution on TeX.sx, and updated TeX4ht sources. It
seems that the issue here was that Verbatimbox defines box using \sbox and the
name of the box is saves in a command defined using \csname. This broke
TeX4ht's redefinition of \sbox. It now works thanks to the fix.

Best,
Michal

___

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 Michal Hoftich
Hi Nasser,

> 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 am not sure why this works in this way, I guess it would be more
logical for classes without \chapter to skipt the option "2". But I am
not sure about changing this, as it would be a quite a big breaking
change. I didn't notice this because if I break pages at all, then I
usually break pages only at the top level, so either at \section or
\chapter.


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

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


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

2023-09-25 Thread Michal Hoftich
> 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.

But the compilation took tens of hours, didn't it? I think you should
avoid it for your huge documents.

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

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.

> 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


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

2023-09-25 Thread Michal Hoftich
> "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.
>

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


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

2023-09-25 Thread Michal Hoftich
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


Re: [tex4ht] labels in descriprion

2023-09-22 Thread Michal Hoftich
Hello Peter,

> I use description environment in my latex source. When I generate odt using 
> make4ht, I am not able correctly update table of contents. There are all 
> items from descriptions included.
>
> Is it possible to somehow suppress this behaviour?

Can you post a sample document that shows this issue? I cannot
reproduce it with the vanilla Article class. It is possible that it is
caused by some package.

Best regards,
Michal


[tex4ht] [bug #603] 13 figures OK, 14 figures gives ! LaTeX Error: Counter too large. only with tex4ht and subfigure

2023-09-21 Thread Michal Hoftich
Update of bug #603 (project tex4ht):

 Open/Closed:Open => Closed 


___

Reply to this item at:

  

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



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

2023-09-21 Thread Michal Hoftich
Update of bug #608 (project tex4ht):

 Open/Closed:Open => Closed 


___

Reply to this item at:

  

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



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

2023-09-21 Thread Michal Hoftich
Update of bug #606 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #1:

I've fixed that recently. Details are on TeX.sx.

___

Reply to this item at:

  

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



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

2023-09-11 Thread Michal Hoftich
> I should probably change that and perhaps even use hooks instead of 
> redefining.

That's another option :) I could remove the fix from TeX4ht sources
then, to be sure that I don't break something else.

Michal


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

2023-09-11 Thread Michal Hoftich
Follow-up Comment #1, bug #608 (project tex4ht):

Thanks for the report. It seems to be caused by the Nameref package, which
redefines the \@chapter command regardless of the fact if the document class
provides it. We need to undefine it for the correct functioning of the
page-splitting functionality.

___

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-31 Thread Michal Hoftich
Hi all,

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

You can also disable the default max-width with the "nostyle" option.

Best, Michal


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

2023-08-30 Thread Michal Hoftich
>
> 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.
>

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.

> 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 Michal Hoftich
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


[tex4ht] [bug #607] tex4ht with package hyperref and option destlabel creates no ancor

2023-08-21 Thread Michal Hoftich
Follow-up Comment #5, bug #607 (project tex4ht):

The solution in the linked answer on TeX.sx is a base for the code that
make4ht executes by default. I just fixed some errors and issues that I found
in the meantime.

On the TeX side, when we add any code to \label, it will always point under
the section title. This is because of how HTML works. As soon as the section
is closed, it inserts the  tag, and everything that follows, such as the
destination anchor for the label, is displayed on another line. It could be
possible to move the anchor to a section using Lua filters, but it would be
slower.

In PDF, it may be possible to insert the destination on the same line, because
it doesn't insert an implicit line break with the end tag.

___

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-08-21 Thread Michal Hoftich
Update of bug #604 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #1:

As we found on TeX.sx, the problem here was that Nasser updated his PC and
some configuration files weren't moved to the correct location. He uses some
Lua post-processing to support Breqn environments. The code is here:

https://tex.stackexchange.com/a/620138/2891

___

Reply to this item at:

  

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



[tex4ht] [bug #607] tex4ht with package hyperref and option destlabel creates no ancor

2023-08-17 Thread Michal Hoftich
Follow-up Comment #3, bug #607 (project tex4ht):

Save that code as config.cfg. To use it with htlatex, execute:

$ htlatex filename.tex "config,uni-html4,2,svg,pic-tabular" " -cunihtf -utf8"

With make4ht, use:

$ make4ht -c config.cfg filename.tex "uni-html4,2,svg,pic-tabular"

make4ht uses UTF-8 by default, so you don't need to pass extra parameters for
tex4htOptions.

___

Reply to this item at:

  

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



[tex4ht] [bug #607] tex4ht with package hyperref and option destlabel creates no ancor

2023-08-17 Thread Michal Hoftich
Follow-up Comment #1, bug #607 (project tex4ht):

You can try something like this:

%%%
\Preamble{xhtml}
\let\origlabel\label
\def\label#1{%
\HCode{}%
\origlabel{#1}%
\HCode{}%
}
\begin{document}
\EndPreamble
%%%

It will add  elements at the point of \label. 

In addition, if you use make4ht instead of htlatex, it sets every section to
use id based on the section name. So your sample produces something like
this:

1Exporting in various
formats

You can then link to "#exporting-in-various-formats" which should be stable
unless you change the section title.



___

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-28 Thread Michal Hoftich
Hi Nasser,


> > 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?
> >

One thing that is possible is to stop the compilation on the first
error, using -halt-on-error option. This should make the compilation
faster, if your file contains errors. Try this build file:

Make:htlatex { latex_par="-halt-on-error"}

Best,
Michal


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

2023-06-20 Thread Michal Hoftich
> 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


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

2023-06-19 Thread Michal Hoftich
Hi Nasser,


> 
>
> 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?
>

TeX4ht doesn't change image paths by default, so you get absolute
paths by default. You can use a solution from this answer to copy
them: https://tex.stackexchange.com/a/656511/2891

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.

Best regards,
Michal


[tex4ht] [bug #599] Newline in caption break compilation

2023-05-02 Thread Michal Hoftich
Follow-up Comment #1, bug #599 (project tex4ht):

Thanks for the report. I've updated TeX4ht sources, so this error should go
away. In the meantime, you can use this configuration file:

\Preamble{xhtml}
\catcode`\:=11
\pend:def\protect:wrtoc{\let\\\space}
\catcode`\:=12
\begin{document}
\EndPreamble


___

Reply to this item at:

  

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



Re: [tex4ht] [bug #477] Support for new LaTeX hook management

2023-04-18 Thread Michal Hoftich
>
> This won't fix the error with \DocumentMetadata as the
> testphase code loads there amsmath not with the standard hooks but in
> our own hook:
>
> \tl_gput_right:Nn \@kernel@before@begindocument
>   { \RequirePackage { amsmath } }
>
> (which doesn't look right, but moving it to
> \@kernel@after@begindocument@before doesn't work either).
>
> We could probably load amsmath earlier, but naturally the problem
> could reappear with other packages or code.
>

when I tried to call this command together with the other two hooks in
tex4ht.sty, it produced a fatal error. Amsmath was loaded, but there
were other errors related to the tagging code.

I will need to investigate it more, but the only thing that I found to
work so far is to require tex4ht.sty right at the beginning of the
processing, and to redefine \DocumentMetadata to do nothing.

>
> Well I know that rewriting such patches is hard, but this \document
> redefinition looks very fragile. Sadly I can't make a concrete suggestion
> how to change it as I have no idea what all the code is doing and what
> should come before and after other things.

Yes, it will be fragile, unfortunately. This is the code that loads
.4ht files and then calls the original \document:


\ifx \config:file\empty
   \def\:temp{\ifx \config:opt\:UnDef
   \edef\config:opt{\ifx \config:file\empty html\fi}\fi
\expandafter\Preamble\expandafter{\config:opt
   }\csname begin\endcsname{document}\EndPreamble
}%
\else
   \def\:temp{\input \config:file\relax
}%
\fi \:temp

It checks if the .cfg file was required, if it wasn't, it will call
\Preamble, \begin{document}, and \EndPreamble. The config file needs
to call these commands too, but it can also contain \Configure
commands used before \begin{document}, so it depends on the fact that
.4ht files should be loaded at that moment. I've also tried to call
original \begin{document} before this code block, but it produced more
errors. So again, something to investigate more.

Best regards,
Michal


Re: [tex4ht] [bug #477] Support for new LaTeX hook management

2023-04-18 Thread Michal Hoftich
Hello Ulrike,

> while there certainly can/will be problems, this error here seems to be
> unrelated to \DocumentMetadata. I get an error with make4ht also for this:
>

thanks for this example. You are right. It seems that packages added
in \AddToHook{begindocument/before} or \AtBeginDocument are ignored
too. It is strange because I thought .4ht files captured them, but
they are not.

I was able to fix these hooks issues by manually calling:

\ifdefined\UseHook
\UseHook {begindocument/before}
\UseHook {begindocument}
\RemoveFromHook{begindocument/before}
\RemoveFromHook{begindocument}
\fi

in redefinition of the \document command in tex4ht.sty. I wonder if it
wouldn't break something else, as in the original version of
\document, the begindocument hook is called much later, after setting
various variables. It can break some things in theory. However, the
variables are mainly related to line width and similar stuff, which
don't matter much in the conversion process.

It doesn't fix the issue with \DocumentMetadata, but that can be fixed
by loading tex4ht.sty earlier by make4ht.

Best regards,
Michal


[tex4ht] [bug #477] Support for new LaTeX hook management

2023-04-18 Thread Michal Hoftich
Follow-up Comment #12, bug #477 (project tex4ht):

There is some discussion about the new LaTeX tagging project and TeX4ht:
https://github.com/latex3/latex2e/discussions/1019 

We will need to make some changes to TeX4ht sources to support the metadata
block used before \documentclass, because TeX4ht is inactive at that moment,
so it doesn't track loaded files. It caused problems with my tests, namely
because it loaded the Amsmath package. There can be potentially much more
problems.

___

Reply to this item at:

  

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



[tex4ht] [bug #553] Error message with hyperref & \url

2023-04-18 Thread Michal Hoftich
Update of bug #553 (project tex4ht):

 Open/Closed:Open => Closed 


___

Reply to this item at:

  

___
  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-04-18 Thread Michal Hoftich
Update of bug #592 (project tex4ht):

 Open/Closed:Open => Closed 


___

Reply to this item at:

  

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



[tex4ht] [bug #192] Some xr-hyper related changes

2023-03-08 Thread Michal Hoftich
Update of bug #192 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #2:

The conflicts between Hyperref and Xr were fixed some time ago.

___

Reply to this item at:

  

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



[tex4ht] [bug #597] tex4ht + biblatex + non-ascii chars = mixed encoding in html file

2023-03-06 Thread Michal Hoftich
Update of bug #597 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #4:

I forgot to close it :)

___

Reply to this item at:

  

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



[tex4ht] [bug #597] tex4ht + biblatex + non-ascii chars = mixed encoding in html file

2023-03-06 Thread Michal Hoftich
Follow-up Comment #3, bug #597 (project tex4ht):

The trick with a space is a bit confusing, but I'm afraid it had some purpose
originally. It actually allows you to select different translation tables for
fonts. I don't know if anyone uses this functionality, but it's probably
better not to change it. It's shown in the original documentation. See:

https://tug.org/tex4ht/doc/mn-commands.html#QQ1-9-33

htlatex filename "" "dbcs/!"

versus:

htlatex filename "" " -ciso2htf" "" "-translate-file=il2-pl"

___

Reply to this item at:

  

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



[tex4ht] [bug #597] tex4ht + biblatex + non-ascii chars = mixed encoding in html file

2023-03-04 Thread Michal Hoftich
Follow-up Comment #1, bug #597 (project tex4ht):

It is OK to cross-post, don't worry. I've already provided my answer on
TeX.sx, so I will post only a shorter version here:

The correct call for htlatex if you want Unicode output is this:

$ htlatex mwe.tex "xhtml,charset=utf-8" " -cunihtf -utf8"

Important is the space between " and -cunihtf, and the charset=utf-8 option. 

But it is better to use make4ht, because it outputs correct Unicode by
default.

___

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

2023-03-03 Thread Michal Hoftich
Update of bug #588 (project tex4ht):

 Open/Closed:Open => Closed 

___

Follow-up Comment #1:

This issue should be fixed now. The problem was that the sectioning command
that is used in \tableofcontents to print the "Contents" string caused page
cut. 

___

Reply to this item at:

  

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



  1   2   3   4   5   6   7   8   9   10   >