Preview equation system in LaTeX - gxyd/sympy GitHub Wiki
To preview equation system you need:
- Build a list of equations (
Eq
). - Make a
Matrix
from them. - Call
preview
function with appropriate arguments (you need to specifycases
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.