laurent.orseau
2021-7-15 09:07:38

The monospace font ensures that blocks of texts can be combined and aligned easily, and also make compound symbols like the sum, sqrt and the big parentheses that require multiple characters to be properly aligned. Even with monospace, you’d be surprised how non-trivial it is to get alignment right. It took me a few hours to find the right CSS style! Many editors (even IDEs) add blank pixel lines between lines of text, and many fonts don’t scale well resulting in added pixels.


spdegabrielle
2021-7-15 17:50:58

I like it. Makes me want to add mathematical elements for pict & 2htdp/image


laurent.orseau
2021-7-15 17:53:34

Yes, it would be great to have the same tools for pict. This will be more demanding though, because it’s possible to do much better, which means much more time trying to get things right :wink:


laurent.orseau
2021-7-15 17:55:01

But text-block is super light weight, which means it renders instantly and does not require any GUI. You can display math on the command line. I’m already using it to make read some formulas written for Racket, it makes them much more readable.


laurent.orseau
2021-7-15 17:55:59

@soegaard2 It should be pretty straightforward to write a racket-cas displayer like this one: https://github.com/Metaxal/text-block/blob/main/math.rkt#L301


soegaard2
2021-7-15 18:06:43

Thanks for the pointer!