Skip to content

Commit 694235f

Browse files
authored
Introduce {{<contents ...>}} in FDG chapter01 (#296)
1 parent abec044 commit 694235f

3 files changed

Lines changed: 22 additions & 12 deletions

File tree

src/mentat_collective/emmy/emmy_interactive.clj

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
(->infix (simplify (down (first tuple) '= (second tuple))))))
6464

6565
^:kindly/hide-code
66-
(def tex (comp kind/tex emmy.expression.render/->TeX))
66+
(def tex str)
6767

6868
^:kindly/hide-code
6969
(def tex-simp (comp tex simplify))
@@ -139,3 +139,18 @@
139139
:on-click #(swap! *click-count inc)}]])])
140140

141141
(show-tex "x^2")
142+
143+
(kind/hiccup
144+
[:div#target])
145+
146+
(kind/scittle
147+
'(let [source-div (.getElementById js/document "source")
148+
target-div (.getElementById js/document "target")
149+
clone-div (.cloneNode source-div true)]
150+
(.appendChild target-div clone-div)))
151+
152+
;;^{:kindly/kind :kind/hidden :kindly/hide-code true}
153+
154+
(kind/hiccup
155+
[:div {:id "source"}
156+
[:p "test"]])

src/mentat_collective/emmy/fdg_ch01.clj

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,13 @@
433433
(kind/hidden
434434
(define-coordinates t e/R1-rect))
435435

436-
^:kindly/hide-code
437-
(def Cartan
436+
;; :::{#cartan}
437+
(define Cartan
438438
(Christoffel->Cartan
439439
(metric->Christoffel-2
440440
the-metric
441441
(coordinate-system->basis R2-rect))))
442+
;; :::
442443

443444
(def geodesic-equation-residuals
444445
(((((covariant-derivative Cartan gamma) d:dt)
@@ -453,13 +454,7 @@
453454

454455
;;The Christoffel coefficients are computed from the metric:
455456

456-
^:kindly/hide-code
457-
(kind/code
458-
"(def Cartan
459-
(Christoffel->Cartan
460-
(metric->Christoffel-2
461-
the-metric
462-
(coordinate-system->basis R2-rect))))")
457+
;; {{<contents cartan>}}
463458

464459
;; The two messy residual results that we did not show are related by the metric.
465460
;; If we change the representation of the geodesic equations by "lowering" them

src/mentat_collective/emmy/silcm_ch01.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
[mentat-collective.emmy.scheme :refer [define-1 let-scheme lambda]]
1717
[civitas.repl :as repl]))
1818

19-
;; TODO: Make a button for @path-dimension to make dimensions switchable from 4 -> 2
20-
2119
;; I investigate a Lorentz covariant Lagrangian that is not widely known. It is discussed in the textbooks of Greiner, "Systems of Particles and Hamiltonian Mechanics" (chapter 21), and also [on-line in: Cline, "Variational Principles in Classical Mechanics"](https://phys.libretexts.org/Bookshelves/Classical_Mechanics/Variational_Principles_in_Classical_Mechanics_(Cline)/17%3A_Relativistic_Mechanics/17.06%3A_Lorentz-Invariant_Formulation_of_Lagrangian_Mechanics).
2220

2321
;; Then I derive, along deBroglie's argument, the momentum-wavelength relation of a free particle.
2422

23+
#_"TODO: Make a button for @path-dimension to make dimensions switchable from 4 -> 2"
24+
2525
^:kindly/hide-code
2626
(def prod true) #_"used to check Emmy in Scittle kitchen"
2727

0 commit comments

Comments
 (0)