Hacker News new | ask | show | jobs
by alephaleph 1186 days ago
The first bullet point is incorrect. In normal text, you use # for functions and symbols, i.e. #sym.phi or #emph. In math blocks, you don't use # for stuff like phi or floor but that's because it interprets everything as a function or symbol, with an exception for single letters. If you want any plain text in a math block, whether it's a function name or not, you just put quotes around it. If you want implicit multiplication, you need spaces between each letter.

I also don't know what you mean by the second bullet point. If you want repeatable single word or sentence formatting, you can define a function for it, which there is easy syntax for.

1 comments

> If you want any plain text in a math block, whether it's a function name or not, you just put quotes around it.

Math fonts and plain text fonts should be different. If you put quotes around something, you get plain text font.

> If you want implicit multiplication, you need spaces between each letter.

Probably the first rule of any good typographical system is that it should not force the user to change how they normally write (barring special exceptions). Any syntax for typography should be additional to this, which is why escape syntax is so good. Forcing the user to put spaces between variables is a no go.

> Math fonts and plain text fonts should be different. If you put quotes around something, you get plain text font.

Why? LaTeX defaults to Computer Modern for both text in math and normal text. And if you want to change just the math font in Typst I'm pretty sure you can do that with a one line set rule.

> Probably the first rule of any good typographical system is that it should not force the user to change how they normally write (barring special exceptions). Any syntax for typography should be additional to this, which is why escape syntax is so good. Forcing the user to put spaces between variables is a no go.

Did you have a habit of putting backslashes before everything before you used TeX? This is a nonsense standard. The math that appears in papers is mostly special characters and so it makes sense to prioritize the syntax for that over implicit multiplication, which is often written with spaces anyway.

Yeah, I have all of my textbooks full of \frac{}{}, that’s definitely how I write math..
We had programming languages that didn't require spaces back in the 80s. It led to code like this:

    10 IFA=3ANDB=5THENPRINT"HELLO"
Even better, Fortran allowed spaces anywhere¹

    I FACE. EQ. BUT HEN GOT O1
¹ OK, not in a Hollerith constant.