Skip to content

Commit 2407722

Browse files
committed
DOC: add separate examples for inline, block and cell output math
1 parent 9ee9da6 commit 2407722

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

doc/gallery/cinque-rst.ipynb

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {
6+
"nbsphinx": "hidden"
7+
},
8+
"source": [
9+
"This notebook is part of the `nbsphinx` documentation: https://nbsphinx.readthedocs.io/."
10+
]
11+
},
12+
{
13+
"cell_type": "markdown",
14+
"metadata": {},
15+
"source": [
16+
"# Dummy Notebook 5 for Gallery\n",
17+
"\n",
18+
"This is another dummy file to fill\n",
19+
"[the gallery in the reST file](../a-normal-rst-file.rst#thumbnail-galleries).\n",
20+
"\n",
21+
"The thumbnail image is assigned in [conf.py](../conf.py)."
22+
]
23+
},
24+
{
25+
"cell_type": "markdown",
26+
"metadata": {},
27+
"source": [
28+
"This page has a secondary use, though,\n",
29+
"which is testing whether a single inline math equation works\n",
30+
"(if there is no other math on the same page): $\\text{e}^{i\\pi} = -1$."
31+
]
32+
}
33+
],
34+
"metadata": {
35+
"kernelspec": {
36+
"display_name": "Python 3",
37+
"language": "python",
38+
"name": "python3"
39+
},
40+
"language_info": {
41+
"codemirror_mode": {
42+
"name": "ipython",
43+
"version": 3
44+
},
45+
"file_extension": ".py",
46+
"mimetype": "text/x-python",
47+
"name": "python",
48+
"nbconvert_exporter": "python",
49+
"pygments_lexer": "ipython3",
50+
"version": "3.7.6"
51+
}
52+
},
53+
"nbformat": 4,
54+
"nbformat_minor": 4
55+
}

doc/gallery/due-rst.pct.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,13 @@
1919
filename = 'due-rst.pct.py'
2020

2121
print(Path(filename).read_text())
22+
23+
# %% [markdown]
24+
# This page has a secondary use,
25+
# which is testing whether a single math output cell works
26+
# (if there is no other math on the same page):
27+
28+
# %%
29+
from IPython.display import Math
30+
eq = Math(r'\int\limits_{-\infty}^\infty f(x) \delta(x - x_0) dx = f(x_0)')
31+
eq

doc/gallery/uno-rst.ipynb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@
2020
"\n",
2121
"The thumbnail image is assigned in [conf.py](../conf.py)."
2222
]
23+
},
24+
{
25+
"cell_type": "markdown",
26+
"metadata": {},
27+
"source": [
28+
"This page has a secondary use, though,\n",
29+
"which is testing whether a single block math equation works\n",
30+
"(if there is no other math on the same page):\n",
31+
"\n",
32+
"\\begin{equation}\n",
33+
"\\int\\limits_{-\\infty}^\\infty f(x) \\delta(x - x_0) dx = f(x_0).\n",
34+
"\\end{equation}"
35+
]
2336
}
2437
],
2538
"metadata": {

0 commit comments

Comments
 (0)