Aug 2, 2024 20:02
@DavidCarlisle I've just added it to TeX4ht souces as a "texsource" option. For some reason, I cannot get configuations for $$ and equation to work, even though they worked in the .cfg file.
Jul 27, 2024 20:40
@DavidCarlisle I hope it can be useful. I will add it soon.
Jul 27, 2024 17:21
it doesn't seem to be really robust, but it should work for simpler cases, especially inline math. If you think it works, I can add this feature to TeX4ht sources, under an option.
Jul 27, 2024 17:20
@DavidCarlisle regarding matching between LaTex source and MathML, I've just realized that some time ago I've tried to attach LaTeX sources as annotation in MathML: tex.stackexchange.com/a/693839/2891
 
Jul 17, 2024 10:32
@DavidCarlisle ah, that sounds interesting. I've tried to do something similar many years ago, but it didn't lead to anything that could be actually used: github.com/michal-h21/lua4ht/tree/math
Jan 28, 2024 12:55
local domfilter = require "make4ht-domfilter"

local process = domfilter {"mathmlfixes", -- fix mathml first
  function(dom, par)
    for count, math in ipairs(dom:query_selector "math") do
      local filename = par.input .. "-" .. count .. ".mml"
      local f = io.open(filename, "w")
      f:write(math:serialize())
      f:close()
    end
    return dom
  end
}

Make:match("html", process)
Jan 28, 2024 12:55
```
Jan 28, 2024 12:54
@DavidCarlisle here is a build file that saves all math to a file named as \jobname-count.mml:
Jan 28, 2024 12:40
@DavidCarlisle I see. currently equations make a HTML table and mathml, but textusperscript shouldn't produce math at all, as the default LaTeX code is not used.
Jan 28, 2024 12:24
@DavidCarlisle DOM filters can extract each formula to a separate file, which should be faster than converting each formula separately
Jan 28, 2024 12:12
@DavidCarlisle it shouldn't be hard. make4ht can read from the standard input, so you can create a script that would preprocess the snippet and make a full TeX document. Other option would be to make a such tool in the build file. outputing just MathML also should be easy, using DOM filters. The staticsite extension does something simillar - it outputs just body of the document with YAML header with metadata
Nov 25, 2023 19:02
@DavidCarlisle I get a correct number of rows with the devel version of make4ht, so it should be hopefully fixed after a new release. Can you try to compile with the ` -f html5-common_domfilters` option, to test if it is caused by the DOM post processing on your system?
Oct 10, 2023 15:51
@DavidCarlisle I hope someone knows what's happening :D
Oct 10, 2023 15:31
@DavidCarlisle yes, that's the error :)
Oct 10, 2023 15:25
@DavidCarlisle I don't know, packing is done by Karl :) But I don't see any reason why it should change, we didn't change anything than usual .4ht files recently.
Oct 10, 2023 15:24
@DavidCarlisle speaking of texlive.net, does it have an issue with Fontspec? We get a fatal error for a LuaLaTeX document that we run several times a day. It stopped working in the last few hours, with a message about Mismatched LaTeX support files detected. I can get the same error when I require Fontspec in texlive.net/run
Oct 5, 2023 08:48
@yo' are you in contact with CSTUG? I think we can help :)
Jan 12, 2023 15:27
@DavidCarlisle I've provided alternative version of embedfile commands in TeX4ht, so it is OK if the error message is just suppressed and the loading of the package stops
Sep 30, 2021 11:58
@UlrikeFischer thanks
Sep 30, 2021 10:41
@UlrikeFischer could you please try if you can reproduce this issue? github.com/michal-h21/make4ht/issues/40#issuecomment-930481850 I've tried it myself with Miktex and I cannot reproduce it.
Aug 8, 2021 15:03
@UlrikeFischer I hope there aren't other stuff like this. I had to fix some issues with hyperref recently and it is quite complicated.
Aug 8, 2021 15:02
@samcarter thanks. I had to left-out lot of stuff that I originally intended to cover, because I found that it is already over an hour and I was in the middle of my plan :(
Aug 8, 2021 15:00
@UlrikeFischer thanks :)
Apr 10, 2021 11:44
@DavidCarlisle and who can better spot errors in the MathML output :) so maybe we will fix something :)
Apr 10, 2021 11:42
@UlrikeFischer I think "mathml,mathjax" is best in most cases, as it supports expansion of LaTeX commands. You may run into bugs with MathML support in TeX4ht, but I think the basics works good enough nowadays.
Apr 10, 2021 11:37
it seems to work :)
Apr 10, 2021 11:36
\edef\testdirectlua{test-directlua}
\ifx\jobname\testdirectlua
\Preamble{mathml,mathjax}
\else
\Preamble{xhtml}
\fi
\ifdefined\xeuniuseblock
\xeuniuseblock{Greek}
\xeuniuseblock{CJK}
\fi
\begin{document}
\EndPreamble
Apr 10, 2021 11:36
@DavidCarlisle this is a bit hacky, but you can pass the "mathml" option just to test-directlua.tex using:
Apr 9, 2021 20:53
@DavidCarlisle great! does anything else fail?
Apr 9, 2021 17:26
@DavidCarlisle yes, exactly :)
 
Jun 21, 2022 15:46
No, it shouldn't as the \ifdefined\HCode condition will prevent execution of the code for TeX4ebook
Jun 21, 2022 14:42
The build file fixes just numbering in table of contents, if it isn't important, you don't need to use it.
Jun 21, 2022 14:41
You are welcome!
Jun 21, 2022 14:38
That's good to hear! I hope the MikTeX issue with XeTeX will be fixed in the future.
Jun 21, 2022 13:48
Use this code instead, and don't use XeTeX, but LuaTeX, so the -l option instead of -x. It uses a different method for handling of characters, so it could work.
Jun 21, 2022 13:47
\ifdefined\HCode
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage[numerals=Bengali, changecounternumbering=false]{bengali}
\else
\usepackage[banglamainfont=Kalpurush, banglattfont=Kalpurush]{latexbangla}
\setdefaultlanguage[numerals=Bengali, changecounternumbering=true]{bengali}
\fi
Jun 21, 2022 13:47
but I have another idea:
Jun 21, 2022 13:46
tex4ebook should be the same, but configuration files for TeX4ht, which can affect handling of characters, for instance, will be different between MikTeX and TeX Live.
Jun 21, 2022 13:29
it can be because of some differences between MikTeX and TeX Live
Jun 21, 2022 13:29
maybe try to add \linewidth=100em somewhere to the document?
Jun 21, 2022 13:27
I don't know. It happens even without the build file? It is possible that for some reason, you have too small linewidth or textwidth, so every word is broken into a new line. And every Bangla character acts like a word, so they are all on separate lines.
Jun 21, 2022 13:12
It seems that all words are on separate lines in your file. It definitely shouldn't look like this. On my machine, this is the result: gist.github.com/michal-h21/6e984b013422d0356fc062d1f4d0b825
Jun 21, 2022 12:43
@raf that's strange. does it happen also when you don't use the build file? could you send me the HTML file?
Jun 21, 2022 12:12
@raf it is possible that it is a rendering issue in Calibre? You can try to open HTML files in file-epub3/OEPBS/ directory in web browser and check if they look wrong too.
Jun 21, 2022 12:10
@raf ah, that is strange, but at least it compiles
Jun 21, 2022 11:18
@raf I use Calibre too. How are the texts broken? Are they broken even in the screenshot in my answer, or just on your system?
Jun 21, 2022 11:18
@raf MikTeX can have older version of TeX4ht files, so it is possible that they contain some issues that were already fixed. How did you fix your issues?
Jun 21, 2022 11:17
@raf it should take just few seconds. You can try the '-a debug' option to see the full log, it probably goes to an infinite loop somewhere. Which TeX distribution do you use?
 
May 16, 2022 16:19
this should be quite easy using DOM filters, see tex.stackexchange.com/a/597744/2891 for example. I will be offline today, so I can take a look into this tomorrow, hopefuly.
May 16, 2022 16:19
so you still want HTML tags generated by TeX4ht, but without any CSS information? Or even to remove most HTML?