Add math.var so that text in math mode uses the text font#7855
Add math.var so that text in math mode uses the text font#7855mkorje wants to merge 2 commits intotypst:mainfrom
math.var so that text in math mode uses the text font#7855Conversation
|
It's great to see some movement in this area! Thank you for your continued work on math.
Does that mean
I there a reason why this is the case, other than being LaTeX's default? To me, it seems that operators are "mathy" enough to be typeset in a math font.
Why is it no longer applicable? Wouldn't #5081 (comment) reproduce the issue? |
Math fonts aren't designed to typeset runs of letters
I'm not sure this is quite true. It does use a text font, but I believe the text font used for regular text and math operators can technically be different. Sometimes you want to use a font which more closely matches the actual math font. |
Not sure about 6. I think the text used for math operators should correspond more closely to |
I suppose |
But what if I want to display an operator in bold or sans? Text font aren't designed to typeset mathematical letters. Multi-letter Is there a technical reason why math fonts can't typeset runs of letters? Or is it just that ligatures, kerning, and such are often only present in text fonts? If it's the latter, I suspect this would be mainly due to the precedent set by LaTeX and we should just ask math font authors to clone metrics and ligatures from the corresponding text font. |
Therefore, using the body text font for math.op seems a reasonable default, and it is also consistent with how unicode-math treats \mathrm. |
|
From this table (especially the last row) it seems that care is usually taken to have the So if the user changes the main font, but keeps the default math font (New Computer Modern Math), the best might be to keep New Computer Modern for math text such as operators. |
|
So it looks like we have (without manual override of the
while LaTeX has
I think I find the LaTeX division more logical: sentences in math should use the body font, and |
|
What font would/should numbers use? Should they match the operator font? |
They should match the math/operator font to remain visually consistent. In my LaTeX example above, |

The main change is the addition of a
math.varelement, which single letters symbols in math are automatically wrapped in. As a consequence, string literals ("...") and content blocks (#[...]) in math use the body text font (in particular, equation numbers use the body font).Q&A
(Subject to change)
Note that it defaults to the body text font.
Use a string literal or content block:
math.op?The body text font - this matches LaTeX.
math.op?Use
math.varwithmath.op:"latin-in-cjk"covers?If you only want to use CJK text in strings and content in math: if you've set the body font to a CJK font everything will just work.
Otherwise: do the same thing as before (as described here).
Issues
mathsize style functions actually overrideshowrules #6390)To-Do