Unlike the other unresolved questions about painless latex to HTML conversion, I just want to know the conversions for math symbols.

For example, when I give


as input to that program, I should get back


Alternatively, is there an equivalent of : detexify.kirelabs.org/classify.html

for HTML symbols?


In HTML, references like ⇔ are nothing but notations indicating specific characters, and as soon as you know the identity of a symbol as a character, by its Unicode number or Unicode name, you can check the HTML 4 list of named references or the much larger HTML5 CR list of named references (the added references have much more limited browser support, and using them is almost always a bad idea). On the other hand, you don’t achieve anything except perhaps some source code readability by using the named references instead of numeric references like ⇔. The numeric references are more reliable, since there have been some silent changes in the meanings of named references, between HTML versions. – Besides, when generating HTML, you can use the character themselves, if you are generating a UTF-8 encoded file, as you should.

Thus, the key question would be how to find the identity of a character. This needs to be resolved case by case, since LaTeX is about producing graphic presentations of symbols, not characters as defined in character code standards. For example, The Comprehensive LATEX Symbol List does not identify characters by code number or Unicode name, it just shows glyphs produced. In many cases, there is no real ambiguity, but often there is.

The Shapecatcher page lets you draw a symbol and then it tries to recognize it as a Unicode character. But recognizing a character from a graphic is complicated and risky. When I tested by drawing a symbol that looks like the one \Leftrightarrow produces, I got several suggestions, including U+27FA LONG LEFT RIGHT DOUBLE ARROW, but not U+21D4 LEFT RIGHT DOUBLE ARROW. These are encoded as separate characters in Unicode, and they can apparently be regarded as corresponding to \Leftrightarrow and \Longleftrightarrow, but distinguishing the two can be difficult or impossible when considering just one graphic, one glyph (since the length of the arrow naturally depends on font design, too).

  • thanks for the pointer to shapecatcher -- i hadn't heard of it, and intend to spread the word via my tugboat column. regarding "long" vs. "ordinary" arrows -- the "long" versions in unicode are intended to indicate arrows that can be stretched, a condition that requires markup; the short ones are intended to always remain the same size. i'll check on the text in the unicode technical report on support for math to make sure this is clear. – barbara beeton Feb 6 '14 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.