I don’t know how to explain this clearly so here’s an example.
$(x_(n_k))_(k in NN)$, $(x_n)_(n in NN_0)$
The n_k is above the k in NN, while in LaTeX every subscript just stays on the same “level”.
I think this feature can look a bit messy when al lot of math is used in some paragraphs?
I’ve tried setting show-rules and looked at the docs of the sizing options but can’t make sense of this all.
Hopefully it’s clear and somebody can help, thanks.
Hello @Junot!
Typst automatically scales the delimiters according to the content’s size with left/right.
What happens here is that the attachment (lower right) is always relative to the size of the delimiter. The bigger the parenthesis, the lower “n_k” will be. You can read more about attach in docs.
Briefly, what you need to do is the following: attach the scripts to something else! For our purposes, we can use a zero width space (sym.zws) so it doesn’t affect the layout.
$(x_(n_k))_(k in NN)$, $(x_n)_(n in NN_0)$
#show math.attach : it => {
if it.base.func() == math.lr {
let attachments = it.fields()
_ = attachments.remove("base")
it.base
math.attach(sym.zws, ..attachments)
} else {
it
}
}
$(x_(n_k))_(k in NN)$, $(x_n)_(n in NN_0)$
Note that this does not change the delimiter scaling, or affect further nested attachments. IMO this is a pretty safe way to do this. See
This is also a very reasonable option, I like the way it looks. A small downside is just the “effort” of typing the escape characters for every time i need to want to have this result, especially because in this case I’m working on an already quite extensive document, to which editing all cases like this would be quite tedious (I know some good vim macros could come in handy but still :)…).