_ and ^ eat newline in math
Open
Nobody has claimed this yet.
bug
math
syntax
- Dominant language
- Rust
- Stars
- 56.1k
- Forks
- 1.7k
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 22
Description
Description
$
a = b_ \
c = d
$
will render as
The same is the case if _ is replaced with ^
This is not ideal, because it makes the output jump around whenever you add a sub- or superscript at the end of an existing line in an equation.
Reproduction URL
No response
Operating system
No response
Typst version
- I am using the latest version of Typst
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the shown math snippet with the latest Typst and compare the layout with and without a trailing subscript or superscript. Trace the math handling for line breaks around trailing _ and ^; done means adding either at the end of a line no longer makes the rendered output jump unexpectedly while the equation still renders correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100