ITADN

Multi-letter identifiers

#45OpenSimonSapin 创建于 2026-02-02
S
SimonSapincommented
Reduced example input: `total = extracted + toRecycle` In v0.7.1 this is rendered with a separate `<mi>` for each letter, which I guess means implicit multiplication of single-letter variables, whereas I meant this equation to only contain three identifiers in total. I don’t mind changing the input but I’m not very familiar with LaTeX syntax. I’ve found recommendations to use `\mathnormal{example}` or `\mathit{example}` to tweak the rendering in original LaTeX but that doesn’t seem to change grouping in pulldown-latex. `\text{example}` does generate a single MathML element, but it’s `<mtext>` not `<mi>`. Looking at the code, it seems to assume that identifiers are always single-letter with `event::Content::Ordinary` containing `content: char`. But at times I need identifiers to refer to a dozen different things, and assigning them arbitrary letters would be much less readable. So I guess this issue has two parts: * What is the most appropriate source syntax for multi-letter identifiers, unrelated to font style? * Would you be open to a refactor of the code to remove the single-letter assumption? Would “simply” replacing `char` with `&'a str` be a good way to start?
3 条评论