-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A few remarks #2
Comments
Thanks for your attention! Feel free to share and use this anywhere! Reply on the remarks:
I didn't think about this.
Oh, nice! I didn't even try this. I'll update the document then.
I've tried this but didn't adopt it. I don't remember why though. Maybe the spacing is not identical with the LaTeX
Yeah, I think there should be some explanations. I'll add this comment by creating a co-authored commit.
Oh yes, mentioning single letter functions without a hashtag may be ambiguous. Thanks for pointing this out.
I just tried to mimic the original LaTeX version 😝 and didn't think much on this.
I have no idea here because I'm not familiar with the |
So here's a simple test. LaTeX | Typst with LaTeX code \documentclass[10pt]{article}
\usepackage{mathtools, amssymb, amsthm}
\begin{document}
\[ \doteq \]
\end{document} and Typst code #set text(10pt)
$ dot(eq) $ |
Remark on script characters: The font files are in a typical LaTeX distribution (CTAN: /tex-archive/fonts/rsfs), but they're postscript type 1 font, and I think Typst only support opentype font. Maybe something in https://stackoverflow.com/questions/9322635/how-can-i-convert-postscript-type-1-font-to-otf-or-ttf can convert them to a Typst-compatible format. https://tex.stackexchange.com/questions/659025/context-lmtx-how-to-use-the-rsfs-font?noredirect=1&lq=1#comment1640490_659025 also has some discussion but nothing too useful. On the doteq issue, I attempt to build the symbol myself a bit but I still don't understand how the box model work in Typst (compared to that in TeX), as well as the issue of spacing between math symbols/mathstyle (mathchoice):
|
I wrote something weird but maybe usable. #let eqdot = $\u{2A66}$
#let doteq2 = style(styles => {
let ex = measure("x", styles).height
box(baseline: -ex, align(center, stack(spacing: (0.3455 - 1 + 0.1874 * 2) * ex, $dot$, $eq$)))
})
$ doteq2 = eqdot quad a doteq2 b, a = b, a eqdot b \
2^(doteq2 = eqdot quad a doteq2 b, a = b, a eqdot b) $ Sad to find out that |
See, the problem is that your doteq2 does not respect mathstyle. In superscript doteq still keeps some spacing around it, while = and eqdot doesn't. In TeX this would be solved with \mathchoice. Not sure about this, maybe there's some way to extract the information whether the current text is in superscript or not from the Unfortunately |
It turns out that #let eqdot = "\u{2A66}"
#let doteq = "\u{2250}"
Customized symbols defined with `"..."`:
$ doteq = eqdot quad a doteq b, a = b, a eqdot b \
2^(doteq = eqdot quad a doteq b, a = b, a eqdot b) $
#let eqdot = $\u{2A66}$
#let doteq = $\u{2250}$
Customized symbols defined with `$...$`:
$ doteq = eqdot quad a doteq b, a = b, a eqdot b \
2^(doteq = eqdot quad a doteq b, a = b, a eqdot b) $ UpdateWith |
The width of |
Good point! I hope that readers can do this with the help of Section Spacing in mathematics. Just out of curiosity: in what context are these use cases? For me:
Footnotes
|
Hey, I'm one of the Typst developers. This is great!
A few remarks:
$hat(x+y)$
$dot(eq)$
because the dot is an accent$angle.l$
h
function are missing a hashtag because the function consists only of a single letter$"9.8" "m/s"^2$
would work for the units thing, but it's obviously hacky and not good. Typst needs to support this better.PS: Would you be fine with us posting this on Twitter with the Typst account?
The text was updated successfully, but these errors were encountered: