Skip to content

Commit

Permalink
Use $$ and \( \) for inline math, and $$$ and \[ \] for display math.
Browse files Browse the repository at this point in the history
  • Loading branch information
roshanshariff committed Dec 10, 2023
1 parent c359772 commit 4e30022
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,7 @@ check **Format messages with markup**. This should solve the problem.

## How do I get my math rendered?

As you do in TeX, use `$ ... $` for inline math and `$$ ... $$` for display-style math.
If you need to write a lot of dollar-signs in a message and want to prevent rendering,
use backslash to escape them: `\$`.
Use `$$ ... $$` or `\( ... \)` for inline math and `$$$ ... $$$` or `\[ ... \]` for display-style math.

Note that only users with MathJax injected in their client will see the rendered version of your math.
Users with the standard client will see the equations just as you wrote them
Expand Down
6 changes: 3 additions & 3 deletions math-with-slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,9 +977,9 @@ def get_injected_code(mathjax_src, mathjax_tex_options):

if mathjax_tex_options == "default":
mathjax_tex_options = """{
packages: {'[+]': ['noerrors', 'noundefined']},
inlineMath: [['$', '$']],
displayMath: [['$$', '$$']],
packages: {'[+]': ['noerrors', 'noundefined', 'ams', 'color', 'boldsymbol']},
inlineMath: [['$$', '$$'], ['\\\\(', '\\\\)']],
displayMath: [['$$$', '$$$'], ['\\\\[', '\\\\]']],
}"""
elif os.path.isfile(mathjax_tex_options):
with open(mathjax_tex_options, "r") as f:
Expand Down

0 comments on commit 4e30022

Please sign in to comment.