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
  • Merge requests
  • !2042

Support TeX-in-<math>-tags, a la Wikipedia's math markdown.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/Quuxplusone/math-tag-to-tex into develop Aug 05, 2018
  • Overview 3
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: Quuxplusone

This minor change in mml2jax allows you to write inline math markup just like you would on Wikipedia or Stack Overflow: <math>1+2=3</math>. We accomplish this by mixing the "mml2jax" preprocessor (which knows how to find math tags) with the "tex" middle-end (which knows how to render TeX input).

The one complication is that the TeX middle-end expects to see the text without the surrounding <math> ... </math>, whereas the MathML middle-end expects to see it with the surrounding <math> ... </math>. So if we're outputting to the TeX middle-end, we need to take innerHTML instead of outerHTML.

To test the functionality, copy mml2jax.js from unpacked/extensions/ into extensions/, and then open index.html in a Web browser. You should see two identical display-mode equations: one rendered by <math mode=display> ... </math> and one rendered by \[ ... \].

I plan to use this extension on my blog, which uses Jekyll, and where I don't trust myself to avoid writing \( or \[ or $$ by accident. Whereas I definitely do trust myself to never write <math> by accident!

Fixes #2043 (closed).

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/Quuxplusone/math-tag-to-tex