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
  • #1881
Closed
Open
Issue created Dec 06, 2017 by Administrator@rootContributor

[CommonHTML] Bad linebreaking when using mstyle scriptlevel

Created by: DorianLamaro

On our project we want the elements inside a fraction to be bigger, so we are wrapping fractions with <mstyle scriptlevel="-1"> which makes elements inside the fraction appear as if they are one level less nested (so normal for the first level). However, it causes some linebreaking issues(linebreaking is set to automatic:true). Some fractions wrapped this way go out of their elements so part of them is outside of their <div> even though they can linebreak. I am assuming this is due the width being calculated before <mstyle> is applied? This only happens for CommonHTML. Other modes such as HTML-CSS or SVG perform satisfactory linebreaking in this case.

Here is the code. The issue is also reproducible on the mathjax demo on the official page if the below code is copied and pasted.

<math xmlns="http://www.w3.org/1998/Math/MathML"> 
       <msub> 
        <mi>
          t 
        </mi> 
        <mn>
          1,2 
        </mn> 
       </msub> 
       <mo linebreak="goodbreak">
         = 
       </mo> 
       <mstyle scriptlevel="-1"> 
        <mfrac> 
         <mrow> 
          <mo linebreak="goodbreak" indentalign="left">
            - 
          </mo> 
          <mn>
            2 
          </mn> 
          <mo>
            ± 
          </mo> 
          <msqrt> 
           <mrow> 
            <msup> 
             <mn>
               2 
             </mn> 
             <mn>
               2 
             </mn> 
            </msup> 
            <mo linebreak="goodbreak">
              - 
            </mo> 
            <mn>
              4 
            </mn> 
            <mo>
              · 
            </mo> 
            <mn>
              1 
            </mn> 
            <mo>
              · 
            </mo> 
            <mn>
              1 
            </mn> 
           </mrow> 
          </msqrt> 
         </mrow> 
         <mrow> 
          <mn>
            2 
          </mn> 
          <mo>
            · 
          </mo> 
          <mn>
            1 
          </mn> 
         </mrow> 
        </mfrac> 
       </mstyle> 
       <mo linebreak="goodbreak">
         = 
       </mo> 
       <mstyle scriptlevel="-1"> 
        <mfrac> 
         <mrow> 
          <mo linebreak="goodbreak">
            - 
          </mo> 
          <mn>
            2 
          </mn> 
          <mo>
            ± 
          </mo> 
          <mn>
            0 
          </mn> 
         </mrow> 
         <mn>
           2 
         </mn> 
        </mfrac> 
       </mstyle> 
       <mo linebreak="goodbreak">
         = 
       </mo> 
       <mo linebreak="goodbreak">
         - 
       </mo> 
       <mn>
         1 
       </mn> 
      </math>

Is there a workaround for this?

Assignee
Assign to
Time tracking