docs: check for latex availability added to examples.

This commit is contained in:
Fabian Joswig 2022-05-20 11:00:52 +01:00
parent 0d434372e8
commit 1054f749e9
6 changed files with 24 additions and 13 deletions

View file

@ -21,6 +21,7 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"import numpy as np\n", "import numpy as np\n",
"import matplotlib\n",
"import matplotlib.pyplot as plt\n", "import matplotlib.pyplot as plt\n",
"import pyerrors as pe" "import pyerrors as pe"
] ]
@ -32,7 +33,8 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"plt.style.use('./base_style.mplstyle')\n", "plt.style.use('./base_style.mplstyle')\n",
"plt.rc('text', usetex=True)" "usetex = matplotlib.checkdep_usetex(True)\n",
"plt.rc('text', usetex=usetex)"
] ]
}, },
{ {

View file

@ -8,6 +8,7 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"import numpy as np\n", "import numpy as np\n",
"import matplotlib\n",
"import matplotlib.pyplot as plt\n", "import matplotlib.pyplot as plt\n",
"import pyerrors as pe" "import pyerrors as pe"
] ]
@ -20,7 +21,8 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"plt.style.use('./base_style.mplstyle')\n", "plt.style.use('./base_style.mplstyle')\n",
"plt.rc('text', usetex=True)" "usetex = matplotlib.checkdep_usetex(True)\n",
"plt.rc('text', usetex=usetex)"
] ]
}, },
{ {
@ -480,7 +482,7 @@
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "Python 3 (ipykernel)",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
}, },
@ -494,7 +496,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.8" "version": "3.8.10"
} }
}, },
"nbformat": 4, "nbformat": 4,

View file

@ -7,6 +7,7 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"import numpy as np\n", "import numpy as np\n",
"import matplotlib\n",
"import matplotlib.pyplot as plt\n", "import matplotlib.pyplot as plt\n",
"import pyerrors as pe" "import pyerrors as pe"
] ]
@ -18,7 +19,8 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"plt.style.use('./base_style.mplstyle')\n", "plt.style.use('./base_style.mplstyle')\n",
"plt.rc('text', usetex=True)" "usetex = matplotlib.checkdep_usetex(True)\n",
"plt.rc('text', usetex=usetex)"
] ]
}, },
{ {

View file

@ -6,9 +6,10 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"import pyerrors as pe\n",
"import numpy as np\n", "import numpy as np\n",
"import matplotlib.pyplot as plt" "import matplotlib\n",
"import matplotlib.pyplot as plt\n",
"import pyerrors as pe"
] ]
}, },
{ {
@ -18,7 +19,8 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"plt.style.use('./base_style.mplstyle')\n", "plt.style.use('./base_style.mplstyle')\n",
"plt.rc('text', usetex=True)" "usetex = matplotlib.checkdep_usetex(True)\n",
"plt.rc('text', usetex=usetex)"
] ]
}, },
{ {
@ -439,7 +441,7 @@
"hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1"
}, },
"kernelspec": { "kernelspec": {
"display_name": "Python 3.8.10 64-bit", "display_name": "Python 3 (ipykernel)",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
}, },

View file

@ -393,7 +393,7 @@
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "Python 3 (ipykernel)",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
}, },
@ -407,7 +407,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.8.8" "version": "3.8.10"
} }
}, },
"nbformat": 4, "nbformat": 4,

View file

@ -7,6 +7,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"import matplotlib\n",
"import matplotlib.pyplot as plt\n", "import matplotlib.pyplot as plt\n",
"import pyerrors as pe" "import pyerrors as pe"
] ]
@ -18,7 +19,9 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"plt.style.use('./base_style.mplstyle'); plt.rc('text', usetex=True)" "plt.style.use('./base_style.mplstyle')\n",
"usetex = matplotlib.checkdep_usetex(True)\n",
"plt.rc('text', usetex=usetex)"
] ]
}, },
{ {
@ -305,7 +308,7 @@
], ],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "Python 3 (ipykernel)",
"language": "python", "language": "python",
"name": "python3" "name": "python3"
}, },