tgoop.com/CodeProgrammer/2685
Create:
Last Update:
Last Update:
Cool Python library that allows you to display functions in LaTeX formatpip install latexify
That is, you simply define the function as usual, like this:
def quadratic(a,b,c):
return (-b + math.sqrt(b**2 - 4*a*c)) / (2*a)
To output a LaTeX formula, we simply place the
@latexify.function
decorator above the function definition and print the function name quadratic
in the Google Colab cell.It turns out like this - and we will see the formula:
@latexify.function
def quadratic(a,b,c):
return (-b + math.sqrt(b**2 - 4*a*c)) / (2*a)
quadratic
Perfect for those who study at the intersection of IT and physics/mathematics/other disciplines;
Here in Google Colab you can test how it works