[i]JLaTeXMath[/i] provides a number of different environments to work with. Each environment begins and ends in the same manner:[br][br][code]\begin{environment}[options][br] ...[br]\end{environment}[br][br][/code]The following environments are supported:[br][br][table][tr][td]• tabular[/td][td]• array[/td][td]• matrix (and variants)[/td][td]• eqnarray[/td][/tr][tr][td]• align[/td][td]• cases[/td][td]• split[/td][td]• multline[/td][/tr][/table]
The [b]tabular[/b] and [b]array[/b] environment work in similar way and can be used to typeset material with optional horizontal and vertical lines. The options are:[br][br][table][tr][td]l[/td][td]left-justified column[/td][td]c[/td][td]centered column[/td][td]r[/td][td]right-justified column[/td][/tr][tr][td][code]|[/code][/td][td]vertical line[/td][td][code]||[/code][/td][td]double vertical line[/td][td][code]&[/code][/td][td]column separator[/td][/tr][tr][td][code]\\[/code][/td][td]start new row[/td][td][code]\hline||[/code] horizontal line[/td][/tr][/table][b][br]Example 1:[/b][br][code]\begin{tabular}{| l |c ||r |}[/code][br][code]\hline[/code][br][code]1 & 2 & 3 \\ \hline[/code][br][code]4 & 5 & 6 \\ \hline[/code][br][code]7 & 8 & 9 \\[/code][br][code]\hline[/code][br][code]\end{tabular}[/code][br][url=https://web.archive.org/web/20240615043817/http://wiki.geogebra.org/en/File:LTEX1.PNG][img]https://www.geogebra.org/resource/tmqwcf9x/O1usZTJf0kuzhkVL/material-tmqwcf9x.png[/img][br][/url][br]Other example, using [code]\multicolumn[/code] and [b]array[/b] is the following.[br][br][b]Example 2:[/b][br][code]\begin{array}{|c|c|}[/code][br][code]\hline[/code][br][code]\multicolumn{2}{|c|}{\text{Title}} \\[/code][br][code]\hline[/code][br][code]x & y\\ \hline[/code][br][code]a & b\\[/code][br][code]c & c\\[/code][br][code]d & e\\ \hline[/code][br][code]\end{array}[/code][br][url=https://web.archive.org/web/20240615043817/http://wiki.geogebra.org/en/File:LTEX2.PNG][img]https://www.geogebra.org/resource/aabg6drg/pSRbwLjtDOj7eeJC/material-aabg6drg.png[/img][br][br][/url]If you need to add column separator ([code]+[/code] for example) and space (1cm), use: [code][br][br][/code][code]@{{\hspace{1cm}+\hspace{1cm}}}[/code][br][br][b]Example 3:[/b][br][code][/code][code]\begin{tabular}{r@{{\hspace{1cm}+\hspace{1cm}}}l}[br]1 & 23 \\[br]45 & 678 \\[br]910 & 1112 \\[br]\end{tabular}[/code][code][/code][br][img]https://www.geogebra.org/resource/ph4tdxgr/6E3Ek7o4068x1J9Z/material-ph4tdxgr.png[/img]
A basic matrix may be created using the matrix environment. The structures are similar to table-array, entries are specified by row, with columns separated using [code]&[/code] and new rows separated with [code]\\[/code]. [br][br]Matrices are usually enclosed in delimiters (default none) of some kind, and while it is possible to use the [code]\left [/code]and [code]\right[/code] commands. [br][br]The predefined environments which automatically include delimiters:[br][br][table][tr][td]pmatrix[/td][td][code]( )[/code][/td][td]bmatrix[/td][td][code][ ][/code][/td][td]Bmatrix[/td][td][code]{ }[/code][/td][/tr][tr][td]vmatrix[/td][td][code]| |[/code][/td][td]Vmatrix[/td][td][code]|| ||[/code][/td][/tr][/table][b][br]Example:[/b][br][code]\mathsf{A}_{m,n} =[/code][br][code]\begin{Vmatrix}[/code][br][code]a_{1,1} & a_{1,2} &\cdots & a_{1,n} \\[/code][br][code]a_{2,1} & a_{2,2} &\cdots & a_{2,n} \\[/code][br][code]\vdots & \vdots & \ddots & \vdots \\[/code][br][code]a_{m,1} & a_{m,2} &\cdots & a_{m,n}[/code][br][code]\end{Vmatrix}[br][/code][br][url=https://web.archive.org/web/20240615043817/http://wiki.geogebra.org/en/File:LTEX4.PNG][img]https://www.geogebra.org/resource/jspjkqch/EKTLtLvBdbSlOIdz/material-jspjkqch.png[/img][br][br][/url][b]2.1 Small Matrix[/b][br][br]Sometimes you need to write a matrix within text, for this environment we have [b]smallmatrix[/b]. This works the same way the matrix environment, for example:[br][br][code]\mathsf{M} =[/code][br][code]\left\{ [br]\begin{smallmatrix}[br][/code][code]a & b \\ [br]c & d[/code][br][code]\end{smallmatrix} [br]\right\}[/code][br][img]https://www.geogebra.org/resource/mvwhu4hm/ICr22Rkzq19ulnce/material-mvwhu4hm.png[/img]
This environment is designed to write multiline equations or equations that exceed the width of line, it behaves like an array of three columns where the Vrst aligned right, center second and third left. The equations we want to present in this way must be enclosed between [code]\begin{eqnarray} [/code]and [code]\end{eqnarray}[/code][br][br][b]Example:[/b][br][code]\begin{eqnarray}[/code][br][code]y & = & (x+1)^2 \\[/code][br][code] & = & x^2+2x+1[/code][br][code]\end{eqnarray}[/code][br][br][img]https://www.geogebra.org/resource/jcwukq77/z8Cs3I781TVGq1wd/material-jcwukq77.png[/img]
Like [b]eqnarray[/b], but more powerful, you can insert text between lines with the command [code]\intertext{...}[/code].[br][br][b]Example:[/b][br][code][/code][code]\begin{align}[br]x+y-z &= 1\\[br]x-y+z &= 1\\[br]\intertext{text} \hphantom{z=0} \\[br]2x\hphantom{-y}+z &= 1[br]\end{align}[/code][code][/code][br][url=https://web.archive.org/web/20240615043817/http://wiki.geogebra.org/en/File:LTEX7.PNG][img]https://www.geogebra.org/resource/ggnmspyq/Hmo2XrxExAiG5mzY/material-ggnmspyq.png[/img][/url]
For piece-wise functions, or definitions, use the [b]cases[/b] environment.[br][br][b]Example:[/b][br][code]\left\vert x\right\vert =[/code][br][code]\begin{cases}[/code][br][code]\hphantom{-}x &,\, \text{if }x\geq 0 ,\\[/code][br][code]-x&,\, \text{if }x<0[/code][br][code]\end{cases}[br][/code][br][img]https://www.geogebra.org/resource/aargx4ng/P6mGiIeInaHWg1YP/material-aargx4ng.png[/img]
For splitting a long math block.[br][br][b]Example:[/b][br][code]\begin{split}[/code][br][code]a & = b+c-d \\[/code][br][code] & \quad +e-f \\[br][/code][code] & = g+h\\[/code][br][code] & = i[/code][br][code]\end{split}[/code][br][br][img]https://www.geogebra.org/resource/ftnb3zuf/jSd4y29hJOC9Y9JY/material-ftnb3zuf.png[/img]
For multiple lines of math.[br][br][b]Example:[/b][br][code]\begin{multline}[/code][br][code]\left(a+b+c+d+e\right)^2 = a^2+b^2+c^2+d^2+e^2 \\[/code][br][code] +2ab+2ac+2ad+2ae+2bc+2bd+2be+2cd+2ce+2de[/code][br][code]\end{multline}[/code][br][br][img]https://www.geogebra.org/resource/fztrw8mf/or09be3O1yJy2m7x/material-fztrw8mf.png[/img]