mathjax / mathjax/MathJax

Overflow bug with quotation marks inside \text

Open
#3,494 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Issue Summary

If LaTeX quotation marks are used in a \text box in display math, they cause everything after the opening quote to be repeated on the line below

Steps to Reproduce:
  1. Create some display math, using $$...$$ delimiters
  2. Add text to the equation, using \text{...}
  3. Put a quotation inside the text. Example:
$$x^2 = 4 \Rightarrow x = \pm 2, \text{``just because''}$$

Here is a screenshot of testing in the MathJax demo:

Image

If I use single quotes instead of double quotes, I don't encounter the issue.

I first observed this in a PreTeXt book. The offending equation is here:

https://opentext.uleth.ca/Math1410/SetTheory.html#SetTheory-11

I have tested using the MathJax demo page on both Firefox and Chrome, on both Windows 11 and Pop! OS 22.04

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

Reproduce the issue in the MathJax demo using the display-math example with \text{``just because''}, then compare it with the single-quote case. Trace the handling of quotation marks inside \text in display math; done means the text after the opening quote is no longer repeated on a following line while the shown expression still renders correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, latex
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.