1 ;;; prosper.el --- Prosper style file for AUCTeX
3 ;; Copyright (C) 2001, 2002 by Philip Lord, Nevin Kapur
5 ;; Authors: Phillip Lord<p.lord@russet.org.uk>
6 ;; Nevin Kapur <nevin@jhu.edu>
7 ;; Keywords: tex, wp, prosper
9 ;; URL: http://www.mts.jhu.edu/~kapur/emacs/prosper.el
11 ;; This is free software; you can redistribute it and/or modify it
12 ;; under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 3, or (at your option)
18 ;; This is a propser (http://prosper.sourceforge.net/) style file for
23 ;; For this file to work you need to have a working installation of
24 ;; AucTeX. After that installtion is simple. Put this file into one of
25 ;; the directories specified in `TeX-style-path', with the name
26 ;; "style" rather than "auto" as it might get over written in the
29 ;; Then stick the current for into your .emacs
30 ;; (eval-after-load "latex"
31 ;; '(add-to-list 'LaTeX-style-list '("prosper")))
34 ;; And that should be it. You check whether it's worked or not by
35 ;; opening a prosper document, and trying `LaTeX-environment'. "slide"
36 ;; should be available by tab completion and it should ask you about
39 ;; The environment "prosper" should be inserted immediately after the
40 ;; document environment. It will prompt you for options available
41 ;; under prosper and create a skeleton document.
45 ;; Currently the documentclass expansion doesn't work, unless you
46 ;; enter a documentclass line to let auctex know which style files to
47 ;; load. Then delete this and do it again. Not good. I know no way
55 ;;;; This is partly working now, and it a little neater than it
56 ;;;; was. The main problem is that the redefinition of "documentclass"
57 ;;;; does not happen until its all too late, so that stuff never
58 ;;;; happens correctly. This is easy enough to fix by fiddling with
59 ;;;; auctex. I shall have to download the latest version, and see if
60 ;;;; its already been fixed.
64 (defconst LaTeX-prosper-version "2008-05-25"
65 "prosper.el version.")
67 (defconst LaTeX-prosper-transition-styles '("Split"
74 "List of transition styles provided by prosper.")
76 (defconst LaTeX-prosper-slide-styles
77 '("alienglow" "autumn" "azure"
78 "contemporain" "darkblue" "default" "frames"
79 "lignesbleues" "nuancegris" "troispoints"
80 "alcatel" "gyom" "pascal" "rico"
83 (defun LaTeX-prosper-insert-title (optional)
88 '("title" "subtitle" "author" "email" "institution" "slideCaption"
89 "Logo" "DefaultTransition"))
90 (LaTeX-insert-environment "document")
91 (TeX-insert-macro "maketitle"))
95 (defun LaTeX-prosper-arg-pdftransition (environment)
97 (if (boundp 'LaTeX-prosper-transition-history)
98 (car LaTeX-prosper-transition-history)
102 (TeX-argument-prompt nil
103 (format "Transition (Default %s) " default)
105 (mapcar 'list LaTeX-prosper-transition-styles)
109 'LaTeX-prosper-transition-history
113 (defun LaTeX-prosper-slide-style-prompt()
116 (mapcar 'list LaTeX-prosper-slide-styles)
117 nil nil nil nil "default" ))
120 (defun LaTeX-prosper-insert-options(environment)
122 (insert (LaTeX-prosper-slide-style-prompt) " ")
124 (if (y-or-n-p (car f))
125 (insert (car (cdr f)) " ")))
127 ("Color Slides?" "slideColor")
128 ("Disable running total on each slide?" "nototal")
129 ("Is the final version going to be PDF?" "pdf")
130 ("Are you going to use Adobe Distiller" "distiller")))
134 (defun LaTeX-prosper-insert-slide (environment)
135 (if (y-or-n-p "Surround with overlay ?")
136 (progn (TeX-insert-macro "overlays")
137 (if (search-backward "{" 0 t)
139 (goto-char (+ 1 (point)))
141 (let ((title (read-string "Title: ")))
142 (LaTeX-insert-environment "slide" (concat TeX-grop title TeX-grcl))))
146 ;; AUCTeX configuration
147 (TeX-add-style-hook "prosper"
150 (LaTeX-add-environments
151 '("slide" LaTeX-prosper-insert-slide)
152 '("itemstep" LaTeX-env-item)
153 '("Itemize" LaTeX-env-item))
156 LaTeX-prosper-insert-options
157 LaTeX-prosper-insert-title)
158 '("title" "Title of the presentation")
159 '("subtitle" "Subtitle of the presentation")
160 '("author" "Author name")
161 '("email" "Author email")
162 '("institution" "Author institution")
163 '("slideCaption" "Caption for slide")
165 '("displayVersion" TeX-arg-free)
166 '("DefaultTransition"
167 LaTeX-prosper-arg-pdftransition)
168 '("NoFrenchBabelItemize" TeX-arg-free)
169 '("part" LaTeX-prosper-arg-part)
170 '("overlays" "Number of overlays" t)
171 '("FontTitle" "Color slides" "Black & White Slides")
172 '("FontText" "Color slides" "Black & White Slides")
173 '("fontTitle" "Text")
175 '("ColorFoot" "Color")
176 '("PDFtransition" LaTeX-prosper-arg-pdftransition)
177 '("myitem" "Level" "Definition")
178 '("fromSlide" "Number" t)
179 '("fromSlide*" "Number" t)
180 '("onlySlide" "Number" t)
181 '("onlySlide*" "Number" t)
182 '("OnlySlide" "Number")
183 '("UntilSlide" "Number")
184 '("untilSlide*" "Number")
185 '("PDForPS" TeX-arg-conditional)
188 '("FromSlide" "Number"))))
192 ;;; prosper.el ends here