Directions for Math - ESCOMP/CTSM GitHub Wiki

Equation arrays look intimidating, especially the way they appear after conversion from the old format. An array just means that there are multiple equations. Most have one column, and each line is enclosed in brackets ‘{ … }‘. A better format results from having two columns, and getting rid of the brackets.

To add a column, change this ‘\begin{array}{l}’ to ‘\begin{array}{lr}’. Now there will be a left- and a right-justified column. To split each line into columns, place a ‘&’. Lines are broken with the ‘\\’. If you write one equation line per line of document, it’s much more readable.

Here’s an example:

.. math::

  D_{irrig} = \left\{
  \begin{array}{lr}
  w_{thresh} - w_{avail} &\qquad w_{thresh} > w_{avail} \\
  0 &\qquad w_{thresh} \le w_{avail}
  \end{array}
  \right\}

To add blank space, you can place ‘\’ symbols for a single space, or things like ‘\quad’ or ‘\qquad’ for bigger spaces. ‘_{}’ give subscript text, ‘^{}’ gives superscript text. Using a ‘(‘ will give a standard size parenthesis, while using ‘\left(‘ will give a parenthesis that scales up to fit the following text (i.e. it gets bigger to fit the entire array).

⚠️ **GitHub.com Fallback** ⚠️