-
Notifications
You must be signed in to change notification settings - Fork 0
/
beamer.lisp
66 lines (54 loc) · 1.91 KB
/
beamer.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
;;; environments and math stuff needed in beamer presentations
(in-package #:clisptex)
(defun beamer-frame (title content)
(tex-env "frame" content title nil (tex-newline) (tex-newline)))
(defun beamer-set-template (item style)
(tex-inverse-cmd 'setbeamertemplate item style))
(defun extract-single-equation-list-pause (eq-list &optional omit-newlines-p label)
"extract a single multiline equation, with lines given as a list"
(concatenate 'string (extract-list-of-strings
(butlast eq-list)
(concatenate 'string "\\onslide<+->{" (tex-newline))
(concatenate 'string "}" (unless omit-newlines-p (tex-eq-newline))))
(concatenate 'string "\\onslide<+->{" (tex-newline))
(car (last eq-list))
"}"))
(defun tex-eq-pause (body &optional label punctuation)
"create a single latex equation, possibly spanning multiple lines"
(cond ((listp body) (tex-env "align*"
(concatenate 'string (extract-single-equation-list-pause body label))))
(t (tex-env "equation*"
body))))
(defun on-slide (content &optional count-from count-to)
(tex-cmd 'onslide
content
nil
(cond ((and count-from count-to) (concatenate 'string
(write-to-string count-from)
"-"
(write-to-string count-to)))
(count-from (concatenate 'string
(write-to-string count-from)
"-"))
(count-to (concatenate 'string
"-"
(write-to-string count-to)))
(t "+-"))))
;; TODO (tex-eval '(on-slide test))
(defstruct beamer-node
name
content
connection
pos-x
pos-y)
(defstruct beamer-node-connection
content
from-node
to-node)
;; (make-beamer-node :name "test-node" :content "some text")
;; (make-beamer-node :name "test-node" :content "some text" :to test-node-2)
;; (make-beamer-node :name "test-node-2" :content "some more text" :from test-node-2)
;; three steps:
;; (1) define nodes and connection
;; (2) arange them nicely
;; (3) worry about onslide stuff