"Fossies" - the Fresh Open Source Software Archive

Member "auctex-12.3/style/prosper.el" (18 Oct 2020, 5883 Bytes) of package /linux/misc/auctex-12.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Lisp source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "prosper.el": 12.2_vs_12.3.

    1 ;;; prosper.el --- Prosper style file for AUCTeX
    2 
    3 ;; Copyright (C) 2001, 2002, 2014, 2020 Free Software Foundation, Inc.
    4 
    5 ;; Authors:  Phillip Lord<p.lord@russet.org.uk>
    6 ;;           Nevin Kapur <nevin@jhu.edu>
    7 ;; Keywords: tex, wp, prosper
    8 ;; Version: 0.6
    9 ;; URL: http://www.mts.jhu.edu/~kapur/emacs/prosper.el
   10 
   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)
   14 ;; any later version.
   15 
   16 ;;; Commentary:
   17 
   18 ;; This is a propser (http://prosper.sourceforge.net/) style file for
   19 ;; AUCTeX.
   20 
   21 ;;; Installation:
   22 ;;
   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
   27 ;; latter.
   28 ;;
   29 ;; Then stick the current for into your .emacs
   30 ;; (eval-after-load "latex"
   31 ;;   '(add-to-list 'LaTeX-style-list '("prosper")))
   32 ;;
   33 ;;
   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
   37 ;; overlays.
   38 ;;
   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.
   42 
   43 ;;; Bugs:
   44 ;;
   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
   48 ;; around this.
   49 
   50 ;;; Code:
   51 
   52 ;; Constants:
   53 
   54 
   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.
   61 
   62 
   63 
   64 (defconst LaTeX-prosper-version "2008-05-25"
   65   "prosper.el version.")
   66 
   67 (defconst LaTeX-prosper-transition-styles '("Split"
   68                       "Blinds"
   69                       "Box"
   70                       "Wipe"
   71                       "Dissolve"
   72                       "Glitter"
   73                       "Replace")
   74   "List of transition styles provided by prosper.")
   75 
   76 (defconst LaTeX-prosper-slide-styles
   77   '("alienglow" "autumn" "azure"
   78     "contemporain" "darkblue" "default" "frames"
   79     "lignesbleues" "nuancegris" "troispoints"
   80     "alcatel" "gyom" "pascal" "rico"
   81     ))
   82 
   83 (defun LaTeX-prosper-insert-title (_optional)
   84   (newline)
   85   (mapc (lambda(f)
   86       (TeX-insert-macro f)
   87       (newline))
   88     '("title" "subtitle" "author" "email" "institution" "slideCaption"
   89       "Logo" "DefaultTransition"))
   90   (LaTeX-insert-environment "document")
   91   (TeX-insert-macro "maketitle"))
   92 
   93 
   94 ;; Utility functions
   95 (defun LaTeX-prosper-arg-pdftransition (_environment)
   96   (let ((default
   97           (if (boundp 'LaTeX-prosper-transition-history)
   98               (car LaTeX-prosper-transition-history)
   99             "Replace")))
  100     (TeX-argument-insert
  101      (completing-read
  102       (TeX-argument-prompt nil
  103                            (format "Transition (Default %s) " default)
  104                            t)
  105       (mapcar 'list LaTeX-prosper-transition-styles)
  106       nil
  107       t
  108       nil
  109       'LaTeX-prosper-transition-history
  110       default)
  111      nil)))
  112 
  113 (defun LaTeX-prosper-slide-style-prompt()
  114   (completing-read
  115    "Slide Style?"
  116    (mapcar 'list LaTeX-prosper-slide-styles)
  117    nil nil nil nil "default" ))
  118 
  119 
  120 (defun LaTeX-prosper-insert-options(_environment)
  121   (insert "[" )
  122   (insert (LaTeX-prosper-slide-style-prompt) " ")
  123   (mapc (lambda(f)
  124       (if (y-or-n-p (car f))
  125           (insert (car (cdr f)) " ")))
  126     '(("Draft?" "draft")
  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")))
  131   (delete-char -1)
  132   (insert "]"))
  133 
  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)
  138                  (progn
  139                    (goto-char (+ 1 (point)))
  140                    (insert "%\n")))))
  141   (let ((title (TeX-read-string "Title: ")))
  142     (LaTeX-insert-environment "slide" (concat TeX-grop title TeX-grcl))))
  143 
  144 ;; AUCTeX configuration
  145 (TeX-add-style-hook
  146  "prosper"
  147  (lambda ()
  148    (LaTeX-add-environments
  149     '("slide" LaTeX-prosper-insert-slide)
  150     '("itemstep" LaTeX-env-item)
  151     '("Itemize" LaTeX-env-item))
  152    (TeX-add-symbols
  153     '("documentclass"
  154       LaTeX-prosper-insert-options
  155       LaTeX-prosper-insert-title)
  156     '("title" "Title of the presentation")
  157     '("subtitle" "Subtitle of the presentation")
  158     '("author" "Author name")
  159     '("email" "Author email")
  160     '("institution" "Author institution")
  161     '("slideCaption" "Caption for slide")
  162     '("Logo" "Logo")
  163     '("displayVersion" TeX-arg-free)
  164     '("DefaultTransition"
  165       LaTeX-prosper-arg-pdftransition)
  166     '("NoFrenchBabelItemize" TeX-arg-free)
  167     '("part" LaTeX-prosper-arg-part)
  168     '("overlays" "Number of overlays" t)
  169     '("FontTitle" "Color slides" "Black & White Slides")
  170     '("FontText" "Color slides" "Black & White Slides")
  171     '("fontTitle" "Text")
  172     '("fontText" "Text")
  173     '("ColorFoot" "Color")
  174     '("PDFtransition" LaTeX-prosper-arg-pdftransition)
  175     '("myitem" "Level" "Definition")
  176     '("fromSlide" "Number" t)
  177     '("fromSlide*" "Number" t)
  178     '("onlySlide" "Number" t)
  179     '("onlySlide*" "Number" t)
  180     '("OnlySlide" "Number")
  181     '("UntilSlide" "Number")
  182     '("untilSlide*" "Number")
  183     '("PDForPS" TeX-arg-conditional)
  184     '("onlyInPS" t)
  185     '("onlyInPDF" t)
  186     '("FromSlide" "Number")))
  187  LaTeX-dialect)
  188 
  189 ;;; prosper.el ends here