Skip to content

Instantly share code, notes, and snippets.

@mccurcio
Created September 28, 2022 16:48
Show Gist options
  • Save mccurcio/b3cdbb9fc8904a1c871d9820a5130399 to your computer and use it in GitHub Desktop.
Save mccurcio/b3cdbb9fc8904a1c871d9820a5130399 to your computer and use it in GitHub Desktop.
Latex-Markdown math equations
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"metadata": {},
"cell_type": "markdown",
"source": "### Latex-Markdown for Equations"
},
{
"metadata": {
"trusted": true
},
"cell_type": "code",
"source": "from IPython.display import display, Math, Latex\n\ndisplay(Math(r'F(k) = \\int_{-\\infty}^{\\infty} f(x) e^{2\\pi i k} dx'))",
"execution_count": 1,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": "<IPython.core.display.Math object>",
"text/latex": "$\\displaystyle F(k) = \\int_{-\\infty}^{\\infty} f(x) e^{2\\pi i k} dx$"
},
"metadata": {}
}
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "`$$c = \\sqrt{a^2 + b^2}$$` produces:\n\n$$c = \\sqrt{a^2 + b^2}$$"
}
],
"metadata": {
"kernelspec": {
"name": "python3",
"display_name": "Python 3 (ipykernel)",
"language": "python"
},
"language_info": {
"name": "python",
"version": "3.9.12",
"mimetype": "text/x-python",
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"pygments_lexer": "ipython3",
"nbconvert_exporter": "python",
"file_extension": ".py"
},
"gist": {
"id": "",
"data": {
"description": "Latex-Markdown math equations",
"public": true
}
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment