Processing math: 40%

MathJax Templates

De Stoa
Edição feita às 10h42min de 7 de maio de 2013 por Patonelli (disc | contribs)

(dif) ← Edição anterior | ver versão atual (dif) | Versão posterior → (dif)
Ir para: navegação, pesquisa

Particularidades do MathJax

Issues on MathJax rendering inside a template

Recently our mediawiki was upgraded to 1.20.2, and the MathJax extension (0.7) was installed. I had a wikipage with lots of formulas inside templates, which rendered great with texvc, and got broken with MathJax extension. This is a list of the issues I've to deal with, and the solution found. In each case, the first form is problematic with MathJax, but renders well with texvc and respect the syntax of a general template.

For illustration we will be using the simple Template:Formula:

<span style="font-size:130%"> {{{1}}} </span>
  • ( the equal sign problem ):
{{Formula | <math>a=b</math> }}

This syntax works well with texvc and fails with MathJax option of standart math extension and MathJax extension. The alternative, naming the parameter, correct the problem in this case:

{{Formula | 1= <math>a=b</math> }}

a=b

  • ( the double curly brackets )
{{Formula | <math>\dot{\mathbf{x}}</math> }}

The first pair of double brackets ends the template!! Providing more spaces between the brackets inside the template correct the render

{{Formula | <math>\dot{\mathbf{x}  }</math> }}

˙x=Ax

  • ( the vertical bar problem )
{{Formula | <math> \|x\|_2</math> }}

is weird. A Latexian correction could be:

 $ \newcommand{\norm}[1]{ \| #1 \|_2 } $
 {{Formula | <math> \norm{x} </math> }} 

\newcommand{\norm}[1]{ \| #1 \|_2 } \norm{x}

X^{scat}_{s,t} ?

Ferramentas pessoais
Espaços nominais

Variantes
Ações
Navegação
Imprimir/exportar
Ferramentas