Preview equation system in LaTeX

rominf edited this page Oct 19, 2014 · 1 revision
Clone this wiki locally

To preview equation system you need:

  1. Build a list of equations (Eq).
  2. Make a Matrix from them.
  3. Call preview function with appropriate arguments (you need to specify cases environment and that you don't need braces around your equations).

Putting everything together:

from sympy import preview, Eq, Matrix

eqs = [Eq(x + 42, y), Eq(100500*x - 2y)]
eqs_matrix = Matrix(eqs)
preview(eqs_matrix, mode='equation*', mat_str='cases', mat_delim='')

This should produce beautiful equation system.