diff --git a/examples/examples.ipynb b/examples/examples.ipynb index dd1aaf8..86a71d7 100644 --- a/examples/examples.ipynb +++ b/examples/examples.ipynb @@ -165,6 +165,35 @@ "\n", "solve" ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "$$ \\displaystyle \\frac{-b + \\sqrt{b^{{2}} - {4}ac}}{{2}a} $$" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# We can also print the output to a .tex file\n", + "@latexify.expression\n", + "def solve1(a, b, c):\n", + " return (-b + math.sqrt(b**2 - 4*a*c)) / (2*a)\n", + "\n", + "with open('latexifyExample.tex', 'w') as fp: \n", + " print(solve1, file = fp) \n" + ] } ], "metadata": {