how to stop rendering \begin{align}...\end{align}

74 views
Skip to first unread message

coib...@gmail.com

unread,
Aug 19, 2012, 12:21:43 AM8/19/12
to mathja...@googlegroups.com
Hi,

I wonder how can I make MathJax stop rendering \begin{align*}...\end{align*} environment. On my bbs, such texts are used to show codes:
[code]
\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}
[/code]

However, MathJax will render them.

Thanks!

Davide P. Cervone

unread,
Aug 21, 2012, 12:15:40 PM8/21/12
to mathja...@googlegroups.com
It depends on what HTML the [code] command generates. If it creates
something like <pre>, then you can add that tag into the skipTags
array in the tex2jax block of your configuration. (But <pre> should
already be there, so I assume [code] is generating something else).
If it creates a tag with a particular class name, you could add that
class to the pattern in the ignoreClass property of the tex2jax block
of your configuration. E.g., if [code] produced <div class="code">
then set ignoreClass to "tex2jax_ignore|code".

If you can't do either of those, then wrapping the code in <div
class="tex2jax_ignore">...</div> would prevent MathJax from processing
the contents of the <div> (i.e., your code).

See

http://www.mathjax.org/docs/2.0/options/tex2jax.html

for details (look for skipTags and ignoreClass).

Davide


On Aug 19, 2012, at 12:21 AM, <coib...@gmail.com>
Reply all
Reply to author
Forward
0 new messages