[tex4ht] request for a new feature for tex4ht. Adding basic translation support for dmath and dgroup from breqn package.

Nasser M. Abbasi nma at 12000.org
Thu Oct 28 03:48:34 CEST 2021

On 10/25/2021 3:44 PM, Michal Hoftich wrote:

> Yes, this isn't really nice. I posted Lua based solution to TeX.sx:
> https://tex.stackexchange.com/a/620138/2891


I've just finished testing the above filter on a 17,000 pages
document which took 6 hrs to compile to HTML.

The automatic conversion from dmath and dgroup to align enviroment
looks to be working very well and equation numbers are showing up correctly.

I want to thank Michal again for all his help and support. Now there
is no need for me to duplicate code for tex4ht vs. pdf in same Latex
document. I can just use breqn for both environment.

If others want to use this setup, I added a small diagram
to my tex4ht cheat sheet showing the configuration


The lua filter from the above link is called config.lua in the
diagram, and it has to go to that specific folder as shown.

Also, the .cfg needs to be modified to use this lua filter by
modifying it to have

   tex: {
     tags: "ams",
     maxBuffer: 40*1024,
     packages: {'[+]': ['textmacros']},
       environments: {
         "dgroup*": ["", ""],
         "dmath*": ["", ""],
         "dgroup": ["", ""],
         "dmath": ["", ""]

Then using the command

make4ht -m draft -c my_mathjax.cfg  -e config.lua foo.tex "htm,mathjax"

I think this lua filter for breqn support is very important, may be
it can be added to tex4ht sources in TeXLive also so it becomes
part of the installation.

>> Is the above possible to do by any chance without a very great
>> effort and time?  Or there is something technically which would
>> this translation  not possible to do at run time?
> The Lua code can be easily modified to support more environments. In
> other modes than MathJax, it will be probably more difficult, as it
> seems that Breqn clashes heavilly with TeX4ht. I haven't looked at the
> sources yet, so I don't know how serious it is.
> Best regards,
> Michal


More information about the tex4ht mailing list.