bugtex4ht - Bugs: bug #351, equation in alt attribute?

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #351: equation in alt attribute?

Submitted by:  Karl Berry <karl>
Submitted on:  Mon Jan 16 19:21:29 2017  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Tue Jan 17 23:05:28 2017, comment #2:

thanks for all the info, Michal. FWIW, I agree that HTML+CSS, or Mathjax itself for that matter, seems more interesting/fruitful than image-based math.

Karl Berry <karl>
Project Administrator
Mon Jan 16 23:55:14 2017, comment #1:

There are several `pic-[mathtype]` options, see [1]. pic-equation requests images for equations, but it doesn't include TeX code in the alt attribute, it seems that it is derived from the DVI code by the tex4ht command.

To get TeX in the alt attribute, we would need to fetch the whole math content, and use it twice. One time to typeset it, the second time to save it in the alt attribute, using token register or `\detokenize` command. It seems that `pic-m+` option does that, but only for `$...$` and `$$...$$`. The configurations for `\(...\)` and `\[...\]` are commented out in the literate sources. And there is also "not safe!!" comment, so I guess that it has some issues. But it works for me on some basic samples.

It seems that GladTeX processes the HTML page for LaTeX code, so it should work if we leave the math unprocessed. There is a support for that in one package from Helpers4ht bundle [2]. It uses verbatim to support environments like equation or align.

Personally, I am more interested in Mathjax-node [3], because it can convert MathML to the plain HTML+CSS, with correct rendering in both Firefox and Webkit based browsers. Basically, it is rendered in the same way as if Mathjax was used, but the loading is much faster, because no Javascript processing is involved.

[1] http://cvr.cc/?p=504
[2] https://github.com/michal-h21/helpers4ht/blob/master/mathjax-latex-4ht.sty
[3] https://github.com/mathjax/MathJax-node

Michal Hoftich <michal_h21>
Project Member
Mon Jan 16 19:21:29 2017, original submission:

Michal or anyone - I seem to recall that tex4ht has an option to make images for equations, but of course am failing to remember the specifics.

If so, I wonder if the equation text is inserted as the alt= attribute and if not, if it easily could be.

Barbara Beeton noticed that the new version of gladtex, http://ctan.org/pkg/gladtex, has this as a feature.

I'm not overly excited about the whole approach of images for equations, but if it's already supported ...

Karl Berry <karl>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by michal_h21 (Posted a comment)
  • -unavailable- added by karl (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    1 latest change follows.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue Jan 17 23:05:28 2017karlOpen/ClosedOpen=>Closed
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray