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

added support for rendering LaTeX equations using MathJax #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion library/Sample Markdown document.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Markdown: Syntax
* [Miscellaneous](#misc)
* [Backslash Escapes](#backslash)
* [Automatic Links](#autolink)
* [\\(\rm\LaTeX\\) Mathematics](#latexmath)

* * *

Expand Down Expand Up @@ -886,4 +887,27 @@ Markdown provides backslash escapes for the following characters:
+ plus sign
- minus sign (hyphen)
. dot
! exclamation mark
! exclamation mark

<h3 id="latexmath">LaTeX Mathematics</h3>

\\(\rm\LaTeX\\) is a markup language for typesetting books, reports, articles,
presentations, and many other types of documents.
It is popular in the quantitative sciences since it renders beautiful
equations from relatively straightforward plaintext markup.
\\(\rm\LaTeX\\) formatted equations can be inserted into Markdown and HTML documents;
they will be rendered using the MathJax library.

Note that the opening and closing backslashes must be escaped, but special characters
in the equations do not need escaping. The following source:

This is an inline equation: \\({{x+y}\over{z}}=5\\).
This is a block equation: $${{x+y}\over{z}}=5$$
This is a block equation too: \\[{{x+y}\over{z}}=5\\]

Renders to:

This is an inline equation: \\({{x+y}\over{z}}=5\\).
This is a block equation: $${{x+y}\over{z}}=5$$
This is a block equation too: \\[{{x+y}\over{z}}=5\\]

1 change: 1 addition & 0 deletions views/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function e($dirty) {
<script src="static/js/jquery.min.js"></script>
<script src="static/js/prettify.js"></script>
<script src="static/js/codemirror.min.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML"></script>
</head>
<body>
<div id="main">
Expand Down