Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • M MathJax
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 304
    • Issues 304
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MathJax
  • MathJax
  • Issues
  • #2964
Closed
Open
Issue created Nov 13, 2022 by R. N. West@rnwst

Numbered, centered, long equations are incorrectly indented

Issue Summary

Numbered, centered, long equations are indented even though they shouldn't be. This means that long equations are flowing into the margin much sooner than they should be. Here is a screenshot:

Steps to Reproduce:

Please open the attached HTML file (see at the bottom).

The issue does not occur when equations are {unnumbered and centered} or {numbered and left-aligned} (via displayAlign: 'left'). The issue occurs both with SVG and CHTML.

Technical details:

  • MathJax Version: 3.2.2 (according to MathJax.version in browser console)
  • Tested with the following browsers:
    • Firefox 105.0.3 (64-bit)
    • Chromium 106.0.5249.119 (Official Build) Arch Linux (64-bit)
    • Microsoft Edge Version 106.0.1370.47 (Official build) (64-bit)

I am using the following MathJax configuration:

MathJax = {
  tex: {
    tags: 'all'
  }
}

and loading MathJax via

<script 
  type="text/javascript"
  id="MathJax-script"
  async
  src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
</script>

Feature request

In addition to fixing this bug, it would be great if MathJax were able to put the equation number below the equation for long equations, like LaTeX does:

I can open a feature request for this separately should this be desired.

HTML file

<!DOCTYPE html>
<html>
<head>
<style>
  body {
    width: 650px;
    margin: auto;
    text-align: justify;
  }
</style>
<script>
  MathJax = {
    tex: {
      tags: 'all'
    }
  }
</script>
<script
  type="text/javascript"
  id="MathJax-script"
  async
  src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
</script>
</head>
<body>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
\[
\left(1+x\right)^n
= 1 + nx + \frac{n\left(n-1\right)}{2!}x^2
  + \frac{n\left(n-1\right)\left(n-2\right)}{3!}x^3
  + \frac{n\left(n-1\right)\left(n-2\right)\left(n-3\right)}{4!}x^4
  + \ldots
\]
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</body>
</html>
Assignee
Assign to
Time tracking