Hello there!
I am trying to create images of various mathematical equations so that I can include them in a document that I am working on. Using the code below, I have been successful rendering every type of equation that I have tried except a matrix equations.
The LaTex markup that I used to generate the matrix is:
r'$begin{Bmatrix} 1 & 2 \\ 3 & 4 \end{Bmatrix}$'
Does Pythonista support rendering matrix equations? If so, how is it done?
Thanks for the help!!
Code:
#import matplotlib.pyplot as plt
from matplotlib import rc
df_fig_sz = [1, 1]
formulas = [[r'$\alpha > \beta$', df_fig_sz, 0.2, 0.25, 'alpha beta'],
[r'$\alpha_i > \beta_i$', df_fig_sz, 0.2, .25, 'ss_script'],
[r'$\sqrt{2}$', df_fig_sz, 0.2, .25, 'radicals_01'],
[r'$\sqrt[3]{x}$', df_fig_sz, 0.2, .25, 'radicals_02']
]
for f in formulas:
params = {'figure.figsize': f[1],}
plt.rcParams.update(params)
fig = plt.figure()
fig.text(f[2], f[3], f[0])
plt.savefig(f[4] + '.png')