Typst's Math Mode Problem
laurmaedje.github.io
Typst's Math Mode Problem
1–10 of 57 posts
Re: Typst's Math Mode Problem
#2Re: Typst's Math Mode Problem
#3Re: Typst's Math Mode Problem
#4 e^{|x|}
f_{i(x)}
Except with {} for grouping, which I think is a good thing, as {} are never rendered, unlike parenthesis.I haven't used Typst much, so I am a bit wary of typesetting engines that are "too smart": It can be problematic when introducing new notations, which is quite common.
Re: Typst's Math Mode Problem
#5Re: Typst's Math Mode Problem
#6BTW one related trap in LaTeX is if a macro without parameters removes the trailing space from the output. The article mentions this in passing but does not say what Typst's solution is. Do Typst functions always require parentheses?
I'm also confused about the following syntax and especially where the function ends:
table.header([A], [B]) // This one is clear
table.header()[A] // Makes sense, [A] turns magically into last param
table.header()[A][B] // Slightly confusing, why would [B] also belong to the function? But OK.
table.header()[A] [B] // Totally confusing, why is this an error now?
For the last case: If it is a parameter list a space should not matter, if it is not [B] should not be part of the function and treated as unrelated.Re: Typst's Math Mode Problem
#7Re: Typst's Math Mode Problem
#8f_i(x) vs f_i (x)
1/x(a+b) vs 1/x (a+b)
ab vs a b
So simple. Being too "smart" invariably leads to more headaches and confusion than just having a simple, consistent rule.
Re: Typst's Math Mode Problem
#9Re: Typst's Math Mode Problem
#10When I found out that option B was already merged [1] I got very excited because the current behavior is still very unintuitive to me and one of the few areas where I prefer the behavior from Latex. Unfortunately, the changes were reverted shortly after because they discovered deeper issues with the new old design [2]. As far as I can see, there hasn't been any further progress on this, sadly. [1] https://github.com/…
1/2(x + y)
1/x(x + y)
1/2^x(x + y)
With a programming language background, that's just odd to reconcile. If 1/2 is treated as a rational integer literal, it's possible to explain the difference between the first two. (And apparently this difference is wildly expected, uncommon as fractions as literals are in programming languages.) But then the last one should turn into (½)ˣ(x+y) because the exponentiation should not slip inside the literal. (I expect the different outcome in the comment is not the result of an algebraic simplification in his case. I really wish they had used 2/3 as the fraction to clarify this.)It seems that TeX users struggled with this at one point, too. That's why LaTeX users generally write $\frac{a}{b}$ instead of $a \over x$. Copious use of braces not rendered in the output certainly avoids precedence issues.