Skip to content

Commit

Permalink
Recognize \begin{foo}...\end{foo} not surrounded by math delimiters.
Browse files Browse the repository at this point in the history
This includes numbered equations, but they're pretty unusable (#2).
  • Loading branch information
cben committed Feb 11, 2014
1 parent 533c3c9 commit 1e63647
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions demo-v4.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true
},
TeX: { noErrors: { disabled: true } }
TeX: { noErrors: { disabled: true },
equationNumbers: { autoNumber: "AMS" } }
});
</script>
<!-- Safe extension (http://docs.mathjax.org/en/latest/safe-mode.html)
Expand All @@ -79,9 +80,10 @@ <h1>attempt at CodeMirror + in-place MathJax</h1>
> xXxXxXxXxXxXxXxXxXxXxXxX
$$\sum^b_c \frac{1}{a}$$
xXxXxXxXxXxXxXxXxXxXxXxX
\begin{equation}\sum_{n=0}^\infty \frac{1}{n} = \infty\end{equation} Bug: numbering is unusable, inrements with every edit.

## Maxwell's Equations
\[ \begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} \]
\begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}

# In monospace
xXxXxXxXxXxXxXxXxXxXxXxX
Expand Down
6 changes: 4 additions & 2 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true
},
TeX: { noErrors: { disabled: true } }
TeX: { noErrors: { disabled: true },
equationNumbers: { autoNumber: "AMS" } }
});
</script>
<!-- Safe extension (http://docs.mathjax.org/en/latest/safe-mode.html)
Expand All @@ -79,9 +80,10 @@ <h1>attempt at CodeMirror + in-place MathJax</h1>
> xXxXxXxXxXxXxXxXxXxXxXxX
$$\sum^b_c \frac{1}{a}$$
xXxXxXxXxXxXxXxXxXxXxXxX
\begin{equation}\sum_{n=0}^\infty \frac{1}{n} = \infty\end{equation} Bug: numbering is unusable, inrements with every edit.

## Maxwell's Equations
\[ \begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} \]
\begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}

# In monospace
xXxXxXxXxXxXxXxXxXxXxXxX
Expand Down

0 comments on commit 1e63647

Please sign in to comment.