Skip to content

The height of \stackrel is too large in SVG output #3250

@hbghlyj

Description

@hbghlyj

Issue Summary

The height of \stackrel is too large when using startup.js with minimal configuration of MathJax.

Steps to Reproduce:

  1. Open the following HTML file on Google Chrome:
<!DOCTYPE html>
<html>

<head>
  <style>
    td {
      border: solid thin gray;
      padding: 10px
    }

    table {
      border-collapse: collapse
    }
  </style>
  <script>
    MathJax = {
      output: {
        font: 'mathjax-modern'
      },
      loader: {
        load: ['input/tex-base', 'output/svg']
      },
      tex: {
        packages: ['base']
      }
    }
  </script>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/startup.js"></script>
</head>

<body>
  <table>
    <tr>
      <td>
        \(\boxed{1 \stackrel {α }{⟵ } 2}\)<br>next line</td>
      <td>
        \(1 \stackrel {α }{⟵ } 2\)<br>next line
      </td>
    </tr>
  </table>
</body>

</html>
  1. See the output: The height of formula in the second table cell is too large
    image

  2. Change MathJax configuration to

<!DOCTYPE html>
<html>

<head>
  <style>
    td {
      border: solid thin gray;
      padding: 10px
    }

    table {
      border-collapse: collapse
    }
  </style>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/tex-svg.js"></script>
</head>

<body>
  <table>
    <tr>
      <td>
        \(\boxed{1 \stackrel {α }{⟵ } 2}\)<br>next line</td>
      <td>
        \(1 \stackrel {α }{⟵ } 2\)<br>next line
      </td>
    </tr>
  </table>
</body>

</html>
  1. See the same issue
  2. Change output font to STIX2
<!DOCTYPE html>
<html>

<head>
  <style>
    td {
      border: solid thin gray;
      padding: 10px
    }

    table {
      border-collapse: collapse
    }
  </style>
  <script>
    MathJax = {
      output: {
        font: 'mathjax-stix2'
      }
    }
  </script>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/tex-svg.js"></script>
</head>

<body>
  <table>
    <tr>
      <td>
        \(\boxed{1 \stackrel {α }{⟵ } 2}\)<br>next line</td>
      <td>
        \(1 \stackrel {α }{⟵ } 2\)<br>next line
      </td>
    </tr>
  </table>
</body>

</html>
  1. See the same issue
    image

Technical details:

  • MathJax Version: 4.0.0-beta.6
  • Client OS: Windows 11
  • Browser: Chrome v126.0.6478.127

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions