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
  • #1438
Closed
Open
Issue created Apr 11, 2016 by Davide P. Cervone@dpvcContributor

Use font-size in ex to match surrounding fonts rather than measuring ex-heights directly.

Something like

<style>
.mjx-chtml {font-size: 2.26ex ! important}
.mjx-chtml .mjx-chtml {font-size: inherit ! important}
</style>

works for CommonHTML output, and something similar could be used for HTML-CSS and PreviewHTML as well. This would avoid having to measure em and ex heights (though a corresponding adjustment would need to be made for text with mtextInheritFont set). This should also resolve some problems with mobile devices that change the font size after the page is loaded (and after MathJax has already measured the size), causing the math to be scaled incorrectly for the new font size.

Note that for HTML-CSS, each of the different web fonts would require a different scaling factor (since their em-to-ex ratios differ, and this font-size is the em-size divided by the ex-height).

Assignee
Assign to
Time tracking