package forester
A tool for tending mathematical forests
Install
Dune Dependency
Authors
Maintainers
Sources
2.4.1.tar.gz
md5=6bdd20df3d77c5fdcf020a74f7964d95
sha512=a60fed82e04be2dc58ca77fd339d0d63e5bfa281f188ddda17c0035a2755c0c575d29d02dfd8742dda81ba02092226029e63b1acc1939f748a3bff3560b79b04
doc/src/forester.render/Render_math_mode.ml.html
Source file Render_math_mode.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
open Prelude open Core module Printer = struct module P0 = struct type out = Format.formatter let text txt fmt = Format.fprintf fmt "%s" txt end include Printer_kit.Kit (P0) let contents (printer : t) : string = Format.asprintf "%a" (fun fmt _ -> printer fmt) () end let rec render_node : Sem.node -> Printer.t = function | Sem.Text txt -> Printer.text txt | Sem.Math(_, xs) -> render xs | Sem.Tag (name, _, body) -> render_tag name body | node -> Format.eprintf "missing case: %a@." Sem.pp_node node; failwith "Render_math_mode.render_node" and render_tag name body = Printer.seq [Printer.text "\\"; Printer.text name; render_arg Braces body] and render xs = Printer.iter ~sep:Printer.space render_node xs and render_arg delim (arg : Sem.t) : Printer.t = match arg with | [] -> Printer.nil | _ -> let l, r = match delim with | Braces -> "{", "}" | Squares -> "[", "]" | Parens -> "(", ")" in Printer.seq [Printer.text l; render arg; Printer.text r]
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>