Syntax differences

From Mathtran

Jump to: navigation, search

Introduction

MathTran, at present, uses a variant of the plain TeX format, described in Don Knuth's The TeXbook. LaTeX extends the format of TeX and the AMSMath package includes syntax for roots and matrices that overrides the TeX format. The AMSMath package also includes directives (for example \end{} ) that aren't obeyed because of security considerations.

Roots

LaTeX uses the syntax \sqrt(n){ expression } for cube roots and greater, but this doesn't render correctly with Tex tex:\sqrt(3) {(1 + x^2)}.

The correct TeX notation for roots is \root 3 \of { 1 + x^2 }, which renders as tex:\root 3 \of {1 + x^2}.

Matrices

To create a 2 x 2 matrix using TeX notation the syntax would be \matrix {a & b \cr c & d }. This would render as tex:\matrix {a & b \cr c & d}. Note the \cr to separate the lines.

Braces can be added by using extra markup either side of the matrix code \left[ \matrix {a & b \cr c & d} \right]. This renders as tex:\left[  \matrix {a & b \cr c & d } \right].

The syntax for using additional braces can be found in section 2.9.1 on the Tex-Math site.

Personal tools