blob: 39e017512647842f02a127aeb06a9fe9746fd08a (
plain)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
;;; lout.scm -- Lout implementation of the `slide' package.
;;;
;;; Copyright 2005, 2006 Ludovic Court�s <ludovic.courtes@laas.fr>
;;;
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;; USA.
(define-skribe-module (skribilo package slide lout)
:use-module (skribilo utils syntax)
;; FIXME: For some reason, changing the following `autoload' in
;; `use-modules' doesn't work.
:autoload (skribilo engine lout) (lout-tagify lout-output-pdf-meta-info)
)
(fluid-set! current-reader %skribilo-module-reader)
;;; TODO:
;;;
;;; Make some more PS/PDF trickery.
(format (current-error-port) "Lout slides setup...~%")
(let ((le (find-engine 'lout)))
;; Automatically switch to the `slides' document type.
(engine-custom-set! le 'document-type 'slides)
(markup-writer 'slide le
:options '(:title :number :toc :ident) ;; '(:bg :vspace :image)
:validate (lambda (n e)
(eq? (engine-custom e 'document-type) 'slides))
:before (lambda (n e)
(display "\n@Overhead\n")
(display " @Title { ")
(output (markup-option n :title) e)
(display " }\n")
(if (markup-ident n)
(begin
(display " @Tag { ")
(display (lout-tagify (markup-ident n)))
(display " }\n")))
(if (markup-option n :number)
(begin
(display " @BypassNumber { ")
(output (markup-option n :number) e)
(display " }\n")))
(display "@Begin\n")
;; `doc' documents produce their PDF outline right after
;; `@Text @Begin'; other types of documents must produce it
;; as part of their first chapter.
(lout-output-pdf-meta-info (ast-document n) e))
:after "@End @Overhead\n")
(markup-writer 'slide-vspace le
:options '(:unit)
:validate (lambda (n e)
(and (pair? (markup-body n))
(number? (car (markup-body n)))))
:action (lambda (n e)
(printf "\n//~a~a # slide-vspace\n"
(car (markup-body n))
(case (markup-option n :unit)
((cm) "c")
((point points pt) "p")
((inch inches) "i")
(else
(skribe-error 'lout
"Unknown vspace unit"
(markup-option n :unit)))))))
(markup-writer 'slide-pause le
;; FIXME: Use a `pdfmark' custom action and a PDF transition action.
;; << /Type /Action
;; << /S /Trans
;; entry in the trans dict
;; << /Type /Trans /S /Dissolve >>
:action (lambda (n e)
(let ((filter (make-string-replace lout-verbatim-encoding))
(pdfmark "
[ {ThisPage} << /Trans << /S /Wipe /Dm /V /D 3 /M /O >> >> /PUT pdfmark"))
(display (lout-embedded-postscript-code
(filter pdfmark))))))
;; For movies, see
;; http://www.tug.org/tex-archive/macros/latex/contrib/movie15/movie15.sty .
(markup-writer 'slide-embed le
:options '(:alt :geometry :rgeometry :geometry-opt :command)
;; FIXME: `pdfmark'.
;; << /Type /Action /S /Launch
:action (lambda (n e)
(let ((command (markup-option n :command))
(filter (make-string-replace lout-verbatim-encoding))
(pdfmark "[ /Rect [ 0 ysize xsize 0 ]
/Name /Comment
/Contents (This is an embedded application)
/ANN pdfmark
[ /Type /Action
/S /Launch
/F (~a)
/OBJ pdfmark"))
(display (string-append
"4c @Wide 3c @High "
(lout-embedded-postscript-code
(filter (format #f pdfmark command)))))))))
;;; arch-tag: 0c717553-5cbb-46ed-937a-f844b6aeb145
|