Skip to content

Commit 2cdb4f3

Browse files
committed
Merge branch 'agoose77/feat-add-more-outputs'
1 parent b40f2aa commit 2cdb4f3

File tree

6 files changed

+96
-19
lines changed

6 files changed

+96
-19
lines changed

content/embeds.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@ MyST This supports embedding of notebook content and other files. The following
1616

1717
:::{embed} #fig-bokeh
1818
:::
19+
20+
### A SymPy Output
21+
22+
![](#fig-sympy-outputs)
23+
![](#fig-sympy-outputs-0)
24+
25+
### A manual equation
26+
27+
![](#eqn-manual)

content/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# Plots
1+
# Jupyter Outputs
22

33
MyST supports embedding plots from other pages and site! Here are some such plots, such as [](#fig-plotly-output) and [](#fig-bokeh-output).
44

55
* [](./figures.md)
66
* [](./embeds.md)
77
* [](./external.md)
8-

content/latex.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
kernelspec:
3+
name: python3
4+
display_name: Python 3
5+
---
6+
7+
# LaTeX Generation
8+
9+
Here's a LaTeX equation:
10+
11+
```{code-cell} python3
12+
13+
from IPython.display import Latex
14+
15+
display(
16+
Latex(
17+
"""
18+
$$
19+
\\label{eqn-manual}
20+
E^2 = \\left(pc\\right)^2 + \\left(m_0c^2\\right)^2
21+
$$
22+
"""
23+
)
24+
)
25+
```
26+
27+
And here's a generated LaTeX equation:
28+
29+
```{code-cell} python3
30+
:name: eqn-sympy
31+
32+
from sympy import symbols
33+
34+
x, y = symbols('x y')
35+
z = x**2 + y**2 + 4
36+
37+
display(z)
38+
```
39+
40+
The generated equation in @eqn-sympy is less fancy than that of @eqn-manual!

content/markdown.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
kernelspec:
3+
name: python3
4+
display_name: Python 3
5+
---
6+
7+
# Markup Generation
8+
9+
:::{math}
10+
:label: eqn-mlp
11+
12+
E(F) = \sum*{f \in F,\,c \in C} T*{fc} D\_{fc}\,,
13+
:::
14+
15+
Here's a generated figure that references an equation:
16+
17+
```{code-cell} python3
18+
:name: fig-jupyter
19+
20+
from IPython.display import Markdown
21+
22+
display(
23+
Markdown(
24+
"""
25+
:::{figure} https://picsum.photos/id/947/800/256/
26+
27+
I'm a programatically generated figure. See @eqn-mlp for more.
28+
:::
29+
"""
30+
)
31+
)
32+
```

content/matplotlib.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,3 @@ plt.axis('equal')
5555
plt.fill(x, y)
5656
plt.show()
5757
```
58-
59-
## Sympy Example
60-
```{code-cell} python3
61-
from sympy.plotting import plot3d
62-
from sympy import symbols
63-
64-
from sympy.plotting import plot3d
65-
x, y = symbols('x y')
66-
z = x**2 + y**2 + 4
67-
68-
display(z)
69-
plot3d(z, (x, -10,10), (y, -10,10))
70-
```

myst.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,27 @@
22
version: 1
33
project:
44
id: ee007168-b9a5-4dba-8823-1639a4aeb956
5-
title: Hello Plots
5+
title: Jupyter Outputs
66
references:
77
guide: https://mystmd.org/guide
88
toc:
99
- file: content/index.md
1010
- file: content/figures.md
1111
- file: content/embeds.md
1212
- file: content/external.md
13-
- file: content/bokeh.md
14-
- file: content/plotly.md
15-
- file: content/matplotlib.md
13+
- title: Content
14+
children:
15+
- file: content/markdown.md
16+
- file: content/latex.md
17+
- title: Plots
18+
children:
19+
- file: content/bokeh.md
20+
- file: content/plotly.md
21+
- file: content/matplotlib.md
22+
- title: Content
23+
children:
24+
- file: content/markdown.md
25+
- file: content/latex.md
1626
site:
1727
template: book-theme
1828
options:

0 commit comments

Comments
 (0)