Skip to content

Commit 8605b7f

Browse files
committed
TwoColumn: don't wrap when the screen is too small
1 parent e4bfcd4 commit 8605b7f

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BmlipTeachingTools"
22
uuid = "656a7065-6f73-6c65-7465-6e646e617262"
33
authors = ["Fons van der Plas <[email protected]>"]
4-
version = "1.3.0"
4+
version = "1.3.1"
55

66
[deps]
77
HypertextLiteral = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2"

src/notebook.jl

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
### A Pluto.jl notebook ###
2-
# v0.20.17
2+
# v0.20.19
33

44
using Markdown
55
using InteractiveUtils
@@ -319,6 +319,47 @@ exercise_statement("Your turn"; prefix="Inference ")
319319
# ╔═╡ 3b7b2e83-c1db-44ad-ad4e-52752c3e4d51
320320
exercises()
321321

322+
# ╔═╡ 678bd199-71a5-4ded-969c-168ba2605c91
323+
md"""
324+
## Layout
325+
"""
326+
327+
# ╔═╡ bc1f427c-538c-4a4d-9be5-ecfa542f959f
328+
const Div = PlutoUI.ExperimentalLayout.Div
329+
330+
# ╔═╡ 0b542219-c593-4083-9a02-e9321db93555
331+
TwoColumn(a, b; wrapping_cutoff_px=400) = Div([
332+
Div(a; style="flex: 1 0 $(wrapping_cutoff_px/2)px;"),
333+
Div(b; style="flex: 1 0 $(wrapping_cutoff_px/2)px;"),
334+
]; style="display: flex; flex-direction: row; gap: 2%; flex-wrap: wrap;")
335+
336+
# ╔═╡ c2bcc8f7-3c9a-40e6-9252-15fe4a1b775a
337+
# ╠═╡ skip_as_script = true
338+
#=╠═╡
339+
TwoColumn(1,2)
340+
╠═╡ =#
341+
342+
# ╔═╡ c1ae92ae-ceda-4ab7-8ddd-e78f1da671de
343+
# ╠═╡ skip_as_script = true
344+
#=╠═╡
345+
TwoColumn(
346+
md"""
347+
Consider an addition node
348+
349+
```math
350+
f_+(x,y,z) = \delta(z-x-y)
351+
```
352+
- Derive an expression for the outgoing message ``\overrightarrow{\mu}_{Z}(z)`` in terms of the incoming messages ``\overrightarrow{\mu}_{X}(\cdot)`` and ``\overrightarrow{\mu}_{Y}(\cdot)``.
353+
354+
""",
355+
356+
@htl """
357+
358+
<img src="https://github.com/bmlip/course/blob/main/assets/figures/ffg-addition-node.png?raw=true" alt=" " style="display: block; width: 100%; margin: 0 auto;">
359+
360+
""")
361+
╠═╡ =#
362+
322363
# ╔═╡ a2704374-33c2-479e-bad0-1bac6c244db1
323364
md"""
324365
## Misc
@@ -533,7 +574,12 @@ export keyconceptsummary
533574
# ╠═8b144173-d002-4c6d-82bd-07c8e8921ddd
534575
# ╠═8dc656fe-0b25-47fd-b087-3ca4b1057e94
535576
# ╠═0fd086b3-81bf-4566-87cf-ec46ca19463e
536-
# ╠═a2704374-33c2-479e-bad0-1bac6c244db1
577+
# ╟─678bd199-71a5-4ded-969c-168ba2605c91
578+
# ╠═bc1f427c-538c-4a4d-9be5-ecfa542f959f
579+
# ╠═0b542219-c593-4083-9a02-e9321db93555
580+
# ╠═c2bcc8f7-3c9a-40e6-9252-15fe4a1b775a
581+
# ╠═c1ae92ae-ceda-4ab7-8ddd-e78f1da671de
582+
# ╟─a2704374-33c2-479e-bad0-1bac6c244db1
537583
# ╠═d0931a54-3bff-4f2d-ad60-eb45721dfa0f
538584
# ╠═06051ef2-08b0-4d7d-bff9-9c2d407c65cc
539585
# ╠═d296808d-04be-483e-831c-32ef170e272b

0 commit comments

Comments
 (0)