Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom math delimiters #2

Closed
emptierset opened this issue Nov 8, 2017 · 3 comments
Closed

Custom math delimiters #2

emptierset opened this issue Nov 8, 2017 · 3 comments

Comments

@emptierset
Copy link

Is it possible to define your own math delimiters? I'm currently writing for a site that requires all LaTeX (both inline and multiline) to be delimited by double dollar signs, but I can't figure out how (or if it's even possible) to do so.

@goessner
Copy link
Owner

goessner commented Nov 8, 2017

Yes, you can simply extend the texmath.rules object in texmath.js.

Might be something like ...

texmath.rules.custom = {
      inline: [
           { /* 1st inline rule */ },
           { /* 2nd optional inline rule */ }
      ],
      block: [
           { /* 1st block rule */ },
           { /* 2nd optional block rule */ }
      ]
}

See texmath.js for details and examples.

@emptierset
Copy link
Author

Nice, thanks. I simply copypasted the "dollars" object, changed its name, and changed the following in "math_inline" and "math_single":

  • add {2} after each $ in rex
  • change tag from "$" to "$$"

Seems to work.

@goessner
Copy link
Owner

goessner commented Nov 9, 2017

cool .. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants