How to html math ?

Tuesday, 11 December, Year 10 d.Tr. | Author: Mircea Popescu

It started as things start, and it continues as things continue :


X
M
=
(
k
2
M
+
k mod M
2
M
)

Now let's go through the principles.

1. The fractional line is not rendered as a character, chiefly because it is not one! The fractional line is instead rendered as a bottom border on the logical cell it margins, which is exactly what it is. Really, nobody thought of this before ? Why not ? Is it really not evident the fractional line is not part of the alphabet ?

2. Peculiar symbols, such as here the parens but in general anything else, integral signs, sigma, what have you can be made any fucking size you wish. Why not ?

3. The fractional line vertical alignment (where all the = and fraction lines line up) is handled via correct description of the height of cells.i Note in the code how the k mod M portion is slightly smaller (24 px) whereas the 2 it exponents is slightly larger (32px) yet nevertheless the cell they go into is 112 px tall. Because all the logical "high" cells have the same height and all the logical "low" cells have also the same height (here the same throughout but this is not necessary) therefore the borders align.

4. Items under the fractional line are floated to the top ; items over the fractional line are floated to the bottom. You know which these are, because they're the cells that had a border in the first place!

5. The exponentiation spatiation is produced the logical way -- by creating a set of four cells, and filling the top right and the bottom left. Because that's the convention of exponent notation, isn't it, exactly : "cut the zone in four spaces, write the base bottom left and the exponent top right". So then ?

6. Localized fractional arrangements work exactly like the general! Within the context of that one particular cell of interest, the whole orchestra can be reproduced verbatim and to identical results.

———
  1. There's a slight misalignment in naive equal-size approaches because the single cell operand ends up slightly higher than the double cell fraction. This is an inherent limit of the poor quality of html itself. It can be mitigated by numeric skullduggery, but never perfectly (as different browsers viewports etc) and so I opt not to bother. []
Category: Meta psihoza
Comments feed : RSS 2.0. Leave your own comment below, or send a trackback.

3 Responses

  1. Or maybe don't bother overmuch, and use a wordpress plugin: https://ro.wordpress.org/plugins/wp-latex/

  2. Mircea Popescu`s avatar
    2
    Mircea Popescu 
    Wednesday, 12 December 2018

    I passed it along, kinda curious from the sidelines "what the problems will be".

  1. [...] won't be of any use for text-based browsers. Mircea Popescu provides a solution based on the use of html tables and top/bottom floating alignments, publishing it on Trilema as well, for future reference. At first, Asciilifeform balks at the [...]

Add your cents! »
    If this is your first comment, it will wait to be approved. This usually takes a few hours. Subsequent comments are not delayed.