Preview equation system in LaTeX - sympy/sympy GitHub Wiki

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 - 2*y, 0)]
eqs_matrix = Matrix(eqs)
preview(eqs_matrix, mode='equation*', mat_str='cases', mat_delim='')

This should produce beautiful equation system.