-
Notifications
You must be signed in to change notification settings - Fork 0
/
tikz.lisp
78 lines (61 loc) · 1.88 KB
/
tikz.lisp
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
;;; needed for tikz
(in-package #:clisptex)
(defstruct point
(pos-x 0)
(pos-y 0))
(defstruct node
content
label
(style "draw")
(width "20em")
option-list
location
on-slides)
(defstruct path
from-node
to-node
(style "line")
option-list
annotation
annotation-position)
(defun only (slide content)
(tex-cmd 'only content nil slide))
(defun onslide (slide content)
(tex-cmd 'onslide content nil slide))
(defun tikz-picture (content &optional show-grid-p)
(tex-env "tikzpicture" content nil (when show-grid-p "show background grid")))
(defun draw-node (node)
(concatenate 'string
(tex-cmd 'node nil (cons
(concatenate 'string "text width=" (node-width node))
(let ((options (node-option-list node)))
(when options options))))
" ("
(node-label node)
") at ("
(write-to-string (point-pos-x (node-location node)))
","
(write-to-string (point-pos-y (node-location node)))
") "
(wrap-braces
(when (node-on-slides node)
(onslide (write-to-string (node-on-slides node)) nil))
(wrap-braces (node-content node)))
";"))
(draw-node
(make-node
:content "This is a test node"
:label "test-node"
:location (make-point :pos-x 1 :pos-y 2)
:on-slides 2))
(defun block (content &optional width)
(make-node ))
;; try this stuff out
(setq exact (make-node :style "bigblock" :pos-x 0 :pos-y 0)))
(setq var-list (make-node :pos-x 7 :pos-y -3))
(setq symmetries (make-node :pos-x 7 :pos-y 0))
(setq lie-theory (make-node))
(make-path :from-node symmetries :to-node exact :annotation lie-theory)
(setq exact-content-list
(list
(make-content :text "-" :overlay 4)))