mathjax / mathjax/MathJax

Unexpected SVG output for `\multiline` environment

Open
#3,430 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request v4
Dominant language
JavaScript
Stars
10.9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Using MathJax v4 (node direct method), given a multiline environment:

\begin{multline*}
a \\ b
\end{multline*}

I noticed using the 2 new and useful demo pages for SVG and CHTML the behaviour is different when resizing the browser window— the CHTML version has a fluid width but the SVG version has a fixed width.

I came across this behaviour when using SVG rendering in my project, with abnormally scaled maths here:

Image

I think the problem is I need to tell MathJax what the appropriate line width is, and potentially re-render on window resize.

Would switching to the CHTML renderer solve this issue without having to re-render on resize? Are there any other pros and cons to using the CHTML renderer instead?

Thanks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked SVG and CHTML demo pages and the Node direct method, reproducing the multline* example while resizing the browser window. Compare the SVG and CHTML output and determine whether the reported fixed-width and scaling behavior is expected; the issue does not name repository files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.