|
@@ -1,4 +1,4 @@
|
|
|
-;;; org-e-beamer.el --- Beamer Back-End for Org Export Engine
|
|
|
+;;; ox-beamer.el --- Beamer Back-End for Org Export Engine
|
|
|
|
|
|
;; Copyright (C) 2007-2013 Free Software Foundation, Inc.
|
|
|
|
|
@@ -26,24 +26,29 @@
|
|
|
;; document.
|
|
|
;;
|
|
|
;; Depending on the desired output format, three commands are provided
|
|
|
-;; for export: `org-e-beamer-export-as-latex' (temporary buffer),
|
|
|
-;; `org-e-beamer-export-to-latex' ("tex" file) and
|
|
|
-;; `org-e-beamer-export-to-pdf' ("pdf" file).
|
|
|
+;; for export: `org-beamer-export-as-latex' (temporary buffer),
|
|
|
+;; `org-beamer-export-to-latex' ("tex" file) and
|
|
|
+;; `org-beamer-export-to-pdf' ("pdf" file).
|
|
|
;;
|
|
|
-;; On top of buffer keywords and options items supported by `e-latex'
|
|
|
-;; back-end (see `org-e-latex-options-alist'), this back-end
|
|
|
-;; introduces the following keywords: "BEAMER_THEME",
|
|
|
-;; "BEAMER_COLOR_THEME", "BEAMER_FONT_THEME", "BEAMER_INNER_THEME" and
|
|
|
-;; "BEAMER_OUTER_THEME". All accept options in square brackets.
|
|
|
+;; This back-end supports every buffer keyword, attribute and options
|
|
|
+;; items (see `org-latex-options-alist') already supported by `latex'
|
|
|
+;; back-end. As such, it is suggested to add an entry in
|
|
|
+;; `org-latex-classes' variable which is appropriate for Beamer
|
|
|
+;; export.
|
|
|
+;;
|
|
|
+;; On top of this, the `beamer' back-end also introduces the following
|
|
|
+;; keywords: "BEAMER_THEME", "BEAMER_COLOR_THEME",
|
|
|
+;; "BEAMER_FONT_THEME", "BEAMER_INNER_THEME" and "BEAMER_OUTER_THEME".
|
|
|
+;; All accept options in square brackets.
|
|
|
;;
|
|
|
;; Moreover, headlines now fall into three categories: sectioning
|
|
|
;; elements, frames and blocks.
|
|
|
;;
|
|
|
-;; - Like `e-latex' back-end sectioning elements are still set through
|
|
|
-;; `org-e-latex-classes' variable.
|
|
|
+;; - Like `latex' back-end sectioning elements are still set through
|
|
|
+;; `org-latex-classes' variable.
|
|
|
;;
|
|
|
;; - Headlines become frames when their level is equal to
|
|
|
-;; `org-e-beamer-frame-level' (or "H" value in the OPTIONS line).
|
|
|
+;; `org-beamer-frame-level' (or "H" value in the OPTIONS line).
|
|
|
;; Though, if an headline in the current tree has a "BEAMER_env"
|
|
|
;; (see below) property set to either "frame" or "fullframe", its
|
|
|
;; level overrides the variable. A "fullframe" is a frame with an
|
|
@@ -51,8 +56,8 @@
|
|
|
;;
|
|
|
;; - All frames' children become block environments. Special block
|
|
|
;; types can be enforced by setting headline's "BEAMER_env" property
|
|
|
-;; to an appropriate value (see `org-e-beamer-environments-default'
|
|
|
-;; for supported value and `org-e-beamer-environments-extra' for
|
|
|
+;; to an appropriate value (see `org-beamer-environments-default'
|
|
|
+;; for supported value and `org-beamer-environments-extra' for
|
|
|
;; adding more).
|
|
|
;;
|
|
|
;; - As a special case, if the "BEAMER_env" property is set to either
|
|
@@ -86,25 +91,25 @@
|
|
|
;; among `bold', `item', `link', `radio-target' and `target' will
|
|
|
;; control its overlay specifications.
|
|
|
;;
|
|
|
-;; On the minor mode side, `org-e-beamer-select-environment' (bound by
|
|
|
-;; default to "C-c C-b") and `org-e-beamer-insert-options-template'
|
|
|
-;; are the two entry points.
|
|
|
+;; On the minor mode side, `org-beamer-select-environment' (bound by
|
|
|
+;; default to "C-c C-b") and `org-beamer-insert-options-template' are
|
|
|
+;; the two entry points.
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
-(require 'org-e-latex)
|
|
|
+(require 'ox-latex)
|
|
|
|
|
|
|
|
|
|
|
|
;;; User-Configurable Variables
|
|
|
|
|
|
-(defgroup org-export-e-beamer nil
|
|
|
+(defgroup org-export-beamer nil
|
|
|
"Options specific for using the beamer class in LaTeX export."
|
|
|
:tag "Org Beamer"
|
|
|
:group 'org-export
|
|
|
:version "24.2")
|
|
|
|
|
|
-(defcustom org-e-beamer-frame-level 1
|
|
|
+(defcustom org-beamer-frame-level 1
|
|
|
"The level at which headlines become frames.
|
|
|
|
|
|
Headlines at a lower level will be translated into a sectioning
|
|
@@ -121,36 +126,36 @@ appendix or a note.
|
|
|
|
|
|
This integer is relative to the minimal level of an headline
|
|
|
within the parse tree, defined as 1."
|
|
|
- :group 'org-export-e-beamer
|
|
|
+ :group 'org-export-beamer
|
|
|
:type 'integer)
|
|
|
|
|
|
-(defcustom org-e-beamer-frame-default-options ""
|
|
|
+(defcustom org-beamer-frame-default-options ""
|
|
|
"Default options string to use for frames.
|
|
|
For example, it could be set to \"allowframebreaks\"."
|
|
|
- :group 'org-export-e-beamer
|
|
|
+ :group 'org-export-beamer
|
|
|
:type '(string :tag "[options]"))
|
|
|
|
|
|
-(defcustom org-e-beamer-column-view-format
|
|
|
+(defcustom org-beamer-column-view-format
|
|
|
"%45ITEM %10BEAMER_env(Env) %10BEAMER_act(Act) %4BEAMER_col(Col) %8BEAMER_opt(Opt)"
|
|
|
"Column view format that should be used to fill the template."
|
|
|
- :group 'org-export-e-beamer
|
|
|
+ :group 'org-export-beamer
|
|
|
:type '(choice
|
|
|
(const :tag "Do not insert Beamer column view format" nil)
|
|
|
(string :tag "Beamer column view format")))
|
|
|
|
|
|
-(defcustom org-e-beamer-theme "default"
|
|
|
+(defcustom org-beamer-theme "default"
|
|
|
"Default theme used in Beamer presentations."
|
|
|
- :group 'org-export-e-beamer
|
|
|
+ :group 'org-export-beamer
|
|
|
:type '(choice
|
|
|
(const :tag "Do not insert a Beamer theme" nil)
|
|
|
(string :tag "Beamer theme")))
|
|
|
|
|
|
-(defcustom org-e-beamer-environments-extra nil
|
|
|
+(defcustom org-beamer-environments-extra nil
|
|
|
"Environments triggered by tags in Beamer export.
|
|
|
Each entry has 4 elements:
|
|
|
|
|
|
name Name of the environment
|
|
|
-key Selection key for `org-e-beamer-select-environment'
|
|
|
+key Selection key for `org-beamer-select-environment'
|
|
|
open The opening template for the environment, with the following escapes
|
|
|
%a the action/overlay specification
|
|
|
%A the default action/overlay specification
|
|
@@ -159,7 +164,7 @@ open The opening template for the environment, with the following escapes
|
|
|
%H if there is headline text, that text in {} braces
|
|
|
%U if there is headline text, that text in [] brackets
|
|
|
close The closing string of the environment."
|
|
|
- :group 'org-export-e-beamer
|
|
|
+ :group 'org-export-beamer
|
|
|
:type '(repeat
|
|
|
(list
|
|
|
(string :tag "Environment")
|
|
@@ -167,26 +172,26 @@ close The closing string of the environment."
|
|
|
(string :tag "Begin")
|
|
|
(string :tag "End"))))
|
|
|
|
|
|
-(defcustom org-e-beamer-outline-frame-title "Outline"
|
|
|
+(defcustom org-beamer-outline-frame-title "Outline"
|
|
|
"Default title of a frame containing an outline."
|
|
|
- :group 'org-export-e-beamer
|
|
|
+ :group 'org-export-beamer
|
|
|
:type '(string :tag "Outline frame title"))
|
|
|
|
|
|
-(defcustom org-e-beamer-outline-frame-options ""
|
|
|
+(defcustom org-beamer-outline-frame-options ""
|
|
|
"Outline frame options appended after \\begin{frame}.
|
|
|
You might want to put e.g. \"allowframebreaks=0.9\" here."
|
|
|
- :group 'org-export-e-beamer
|
|
|
+ :group 'org-export-beamer
|
|
|
:type '(string :tag "Outline frame options"))
|
|
|
|
|
|
|
|
|
|
|
|
;;; Internal Variables
|
|
|
|
|
|
-(defconst org-e-beamer-column-widths
|
|
|
+(defconst org-beamer-column-widths
|
|
|
"0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.0 :ETC"
|
|
|
"The column widths that should be installed as allowed property values.")
|
|
|
|
|
|
-(defconst org-e-beamer-environments-special
|
|
|
+(defconst org-beamer-environments-special
|
|
|
'(("againframe" "A")
|
|
|
("appendix" "x")
|
|
|
("column" "c")
|
|
@@ -198,11 +203,11 @@ You might want to put e.g. \"allowframebreaks=0.9\" here."
|
|
|
("noteNH" "N"))
|
|
|
"Alist of environments treated in a special way by the back-end.
|
|
|
Keys are environment names, as strings, values are bindings used
|
|
|
-in `org-e-beamer-select-environment'. Environments listed here,
|
|
|
+in `org-beamer-select-environment'. Environments listed here,
|
|
|
along with their binding, are hard coded and cannot be modified
|
|
|
-through `org-e-beamer-environments-extra' variable.")
|
|
|
+through `org-beamer-environments-extra' variable.")
|
|
|
|
|
|
-(defconst org-e-beamer-environments-default
|
|
|
+(defconst org-beamer-environments-default
|
|
|
'(("block" "b" "\\begin{block}%a{%h}" "\\end{block}")
|
|
|
("alertblock" "a" "\\begin{alertblock}%a{%h}" "\\end{alertblock}")
|
|
|
("verse" "v" "\\begin{verse}%a %% %h" "\\end{verse}")
|
|
@@ -217,9 +222,9 @@ through `org-e-beamer-environments-extra' variable.")
|
|
|
("beamercolorbox" "o" "\\begin{beamercolorbox}%o{%h}" "\\end{beamercolorbox}"))
|
|
|
"Environments triggered by properties in Beamer export.
|
|
|
These are the defaults - for user definitions, see
|
|
|
-`org-e-beamer-environments-extra'.")
|
|
|
+`org-beamer-environments-extra'.")
|
|
|
|
|
|
-(defconst org-e-beamer-verbatim-elements
|
|
|
+(defconst org-beamer-verbatim-elements
|
|
|
'(code example-block fixed-width inline-src-block src-block verbatim)
|
|
|
"List of element or object types producing verbatim text.
|
|
|
This is used internally to determine when a frame should have the
|
|
@@ -229,7 +234,7 @@ This is used internally to determine when a frame should have the
|
|
|
|
|
|
;;; Internal functions
|
|
|
|
|
|
-(defun org-e-beamer--normalize-argument (argument type)
|
|
|
+(defun org-beamer--normalize-argument (argument type)
|
|
|
"Return ARGUMENT string with proper boundaries.
|
|
|
|
|
|
TYPE is a symbol among the following:
|
|
@@ -251,11 +256,11 @@ TYPE is a symbol among the following:
|
|
|
(format "[%s]" argument)))
|
|
|
(otherwise argument))))
|
|
|
|
|
|
-(defun org-e-beamer--element-has-overlay-p (element)
|
|
|
+(defun org-beamer--element-has-overlay-p (element)
|
|
|
"Non-nil when ELEMENT has an overlay specified.
|
|
|
An element has an overlay specification when it starts with an
|
|
|
-`e-beamer' export-snippet whose value is between angular
|
|
|
-brackets. Return overlay specification, as a string, or nil."
|
|
|
+`beamer' export-snippet whose value is between angular brackets.
|
|
|
+Return overlay specification, as a string, or nil."
|
|
|
(let ((first-object (car (org-element-contents element))))
|
|
|
(when (eq (org-element-type first-object) 'export-snippet)
|
|
|
(let ((value (org-element-property :value first-object)))
|
|
@@ -265,35 +270,35 @@ brackets. Return overlay specification, as a string, or nil."
|
|
|
|
|
|
;;; Define Back-End
|
|
|
|
|
|
-(org-export-define-derived-backend e-beamer e-latex
|
|
|
+(org-export-define-derived-backend beamer latex
|
|
|
:export-block "BEAMER"
|
|
|
:menu-entry
|
|
|
(?l 1
|
|
|
- ((?B "As TEX buffer (Beamer)" org-e-beamer-export-as-latex)
|
|
|
- (?b "As TEX file (Beamer)" org-e-beamer-export-to-latex)
|
|
|
- (?P "As PDF file (Beamer)" org-e-beamer-export-to-pdf)
|
|
|
+ ((?B "As TEX buffer (Beamer)" org-beamer-export-as-latex)
|
|
|
+ (?b "As TEX file (Beamer)" org-beamer-export-to-latex)
|
|
|
+ (?P "As PDF file (Beamer)" org-beamer-export-to-pdf)
|
|
|
(?O "As PDF file and open (Beamer)"
|
|
|
(lambda (a s v b)
|
|
|
- (if a (org-e-beamer-export-to-pdf t s v b)
|
|
|
- (org-open-file (org-e-beamer-export-to-pdf nil s v b)))))))
|
|
|
+ (if a (org-beamer-export-to-pdf t s v b)
|
|
|
+ (org-open-file (org-beamer-export-to-pdf nil s v b)))))))
|
|
|
:options-alist
|
|
|
- ((:beamer-theme "BEAMER_THEME" nil org-e-beamer-theme)
|
|
|
+ ((:beamer-theme "BEAMER_THEME" nil org-beamer-theme)
|
|
|
(:beamer-color-theme "BEAMER_COLOR_THEME" nil nil t)
|
|
|
(:beamer-font-theme "BEAMER_FONT_THEME" nil nil t)
|
|
|
(:beamer-inner-theme "BEAMER_INNER_THEME" nil nil t)
|
|
|
(:beamer-outer-theme "BEAMER_OUTER_THEME" nil nil t)
|
|
|
- (:headline-levels nil "H" org-e-beamer-frame-level))
|
|
|
- :translate-alist ((bold . org-e-beamer-bold)
|
|
|
- (export-block . org-e-beamer-export-block)
|
|
|
- (export-snippet . org-e-beamer-export-snippet)
|
|
|
- (headline . org-e-beamer-headline)
|
|
|
- (item . org-e-beamer-item)
|
|
|
- (keyword . org-e-beamer-keyword)
|
|
|
- (link . org-e-beamer-link)
|
|
|
- (plain-list . org-e-beamer-plain-list)
|
|
|
- (radio-target . org-e-beamer-radio-target)
|
|
|
- (target . org-e-beamer-target)
|
|
|
- (template . org-e-beamer-template)))
|
|
|
+ (:headline-levels nil "H" org-beamer-frame-level))
|
|
|
+ :translate-alist ((bold . org-beamer-bold)
|
|
|
+ (export-block . org-beamer-export-block)
|
|
|
+ (export-snippet . org-beamer-export-snippet)
|
|
|
+ (headline . org-beamer-headline)
|
|
|
+ (item . org-beamer-item)
|
|
|
+ (keyword . org-beamer-keyword)
|
|
|
+ (link . org-beamer-link)
|
|
|
+ (plain-list . org-beamer-plain-list)
|
|
|
+ (radio-target . org-beamer-radio-target)
|
|
|
+ (target . org-beamer-target)
|
|
|
+ (template . org-beamer-template)))
|
|
|
|
|
|
|
|
|
|
|
@@ -301,18 +306,18 @@ brackets. Return overlay specification, as a string, or nil."
|
|
|
|
|
|
;;;; Bold
|
|
|
|
|
|
-(defun org-e-beamer-bold (bold contents info)
|
|
|
+(defun org-beamer-bold (bold contents info)
|
|
|
"Transcode BLOCK object into Beamer code.
|
|
|
CONTENTS is the text being bold. INFO is a plist used as
|
|
|
a communication channel."
|
|
|
(format "\\alert%s{%s}"
|
|
|
- (or (org-e-beamer--element-has-overlay-p bold) "")
|
|
|
+ (or (org-beamer--element-has-overlay-p bold) "")
|
|
|
contents))
|
|
|
|
|
|
|
|
|
;;;; Export Block
|
|
|
|
|
|
-(defun org-e-beamer-export-block (export-block contents info)
|
|
|
+(defun org-beamer-export-block (export-block contents info)
|
|
|
"Transcode an EXPORT-BLOCK element into Beamer code.
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
channel."
|
|
@@ -322,16 +327,16 @@ channel."
|
|
|
|
|
|
;;;; Export Snippet
|
|
|
|
|
|
-(defun org-e-beamer-export-snippet (export-snippet contents info)
|
|
|
+(defun org-beamer-export-snippet (export-snippet contents info)
|
|
|
"Transcode an EXPORT-SNIPPET object into Beamer code.
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
channel."
|
|
|
(let ((backend (org-export-snippet-backend export-snippet))
|
|
|
(value (org-element-property :value export-snippet)))
|
|
|
- ;; Only "e-latex" and "e-beamer" snippets are retained.
|
|
|
- (cond ((eq backend 'e-latex) value)
|
|
|
- ;; Ignore "e-beamer" snippets specifying overlays.
|
|
|
- ((and (eq backend 'e-beamer)
|
|
|
+ ;; Only "latex" and "beamer" snippets are retained.
|
|
|
+ (cond ((eq backend 'latex) value)
|
|
|
+ ;; Ignore "beamer" snippets specifying overlays.
|
|
|
+ ((and (eq backend 'beamer)
|
|
|
(or (org-export-get-previous-element export-snippet info)
|
|
|
(not (string-match "\\`<.*>\\'" value))))
|
|
|
value))))
|
|
@@ -340,19 +345,19 @@ channel."
|
|
|
;;;; Headline
|
|
|
;;
|
|
|
;; The main function to translate an headline is
|
|
|
-;; `org-e-beamer-headline'.
|
|
|
+;; `org-beamer-headline'.
|
|
|
;;
|
|
|
;; Depending on the level at which an headline is considered as
|
|
|
-;; a frame (given by `org-e-beamer--frame-level'), the headline is
|
|
|
-;; either a section (`org-e-beamer--format-section'), a frame
|
|
|
-;; (`org-e-beamer--format-frame') or a block
|
|
|
-;; (`org-e-beamer--format-block').
|
|
|
+;; a frame (given by `org-beamer--frame-level'), the headline is
|
|
|
+;; either a section (`org-beamer--format-section'), a frame
|
|
|
+;; (`org-beamer--format-frame') or a block
|
|
|
+;; (`org-beamer--format-block').
|
|
|
;;
|
|
|
-;; `org-e-beamer-headline' also takes care of special environments
|
|
|
+;; `org-beamer-headline' also takes care of special environments
|
|
|
;; like "ignoreheading", "note", "noteNH", "appendix" and
|
|
|
;; "againframe".
|
|
|
|
|
|
-(defun org-e-beamer--get-label (headline info)
|
|
|
+(defun org-beamer--get-label (headline info)
|
|
|
"Return label for HEADLINE, as a string.
|
|
|
|
|
|
INFO is a plist used as a communication channel.
|
|
@@ -369,7 +374,7 @@ function assumes HEADLINE will be treated as a frame."
|
|
|
(org-export-get-headline-number headline info)
|
|
|
"-")))))
|
|
|
|
|
|
-(defun org-e-beamer--frame-level (headline info)
|
|
|
+(defun org-beamer--frame-level (headline info)
|
|
|
"Return frame level in subtree containing HEADLINE.
|
|
|
INFO is a plist used as a communication channel."
|
|
|
(or
|
|
@@ -387,23 +392,22 @@ INFO is a plist used as a communication channel."
|
|
|
(and env (member (downcase env) '("frame" "fullframe"))
|
|
|
(org-export-get-relative-level headline info)))
|
|
|
;; 3. Look for "frame" environment in sub-tree.
|
|
|
- (org-element-map
|
|
|
- headline 'headline
|
|
|
- (lambda (hl)
|
|
|
- (let ((env (org-element-property :beamer-env hl)))
|
|
|
- (when (and env (member (downcase env) '("frame" "fullframe")))
|
|
|
- (org-export-get-relative-level hl info))))
|
|
|
- info 'first-match)
|
|
|
+ (org-element-map headline 'headline
|
|
|
+ (lambda (hl)
|
|
|
+ (let ((env (org-element-property :beamer-env hl)))
|
|
|
+ (when (and env (member (downcase env) '("frame" "fullframe")))
|
|
|
+ (org-export-get-relative-level hl info))))
|
|
|
+ info 'first-match)
|
|
|
;; 4. No "frame" environment in tree: use default value.
|
|
|
(plist-get info :headline-levels)))
|
|
|
|
|
|
-(defun org-e-beamer--format-section (headline contents info)
|
|
|
+(defun org-beamer--format-section (headline contents info)
|
|
|
"Format HEADLINE as a sectioning part.
|
|
|
CONTENTS holds the contents of the headline. INFO is a plist
|
|
|
used as a communication channel."
|
|
|
- ;; Use `e-latex' back-end output, inserting overlay specifications
|
|
|
+ ;; Use `latex' back-end output, inserting overlay specifications
|
|
|
;; if possible.
|
|
|
- (let ((latex-headline (org-export-with-backend 'e-latex headline contents info))
|
|
|
+ (let ((latex-headline (org-export-with-backend 'latex headline contents info))
|
|
|
(mode-specs (org-element-property :beamer-act headline)))
|
|
|
(if (and mode-specs
|
|
|
(string-match "\\`\\\\\\(.*?\\)\\(?:\\*\\|\\[.*\\]\\)?{"
|
|
@@ -413,14 +417,14 @@ used as a communication channel."
|
|
|
nil nil latex-headline 1)
|
|
|
latex-headline)))
|
|
|
|
|
|
-(defun org-e-beamer--format-frame (headline contents info)
|
|
|
+(defun org-beamer--format-frame (headline contents info)
|
|
|
"Format HEADLINE as a frame.
|
|
|
CONTENTS holds the contents of the headline. INFO is a plist
|
|
|
used as a communication channel."
|
|
|
(let ((fragilep
|
|
|
;; FRAGILEP is non-nil when HEADLINE contains an element
|
|
|
- ;; among `org-e-beamer-verbatim-elements'.
|
|
|
- (org-element-map headline org-e-beamer-verbatim-elements 'identity
|
|
|
+ ;; among `org-beamer-verbatim-elements'.
|
|
|
+ (org-element-map headline org-beamer-verbatim-elements 'identity
|
|
|
info 'first-match)))
|
|
|
(concat "\\begin{frame}"
|
|
|
;; Overlay specification, if any. When surrounded by
|
|
@@ -430,15 +434,15 @@ used as a communication channel."
|
|
|
(cond
|
|
|
((not action) "")
|
|
|
((string-match "\\`\\[.*\\]\\'" action )
|
|
|
- (org-e-beamer--normalize-argument action 'defaction))
|
|
|
- (t (org-e-beamer--normalize-argument action 'action))))
|
|
|
+ (org-beamer--normalize-argument action 'defaction))
|
|
|
+ (t (org-beamer--normalize-argument action 'action))))
|
|
|
;; Options, if any.
|
|
|
(let* ((beamer-opt (org-element-property :beamer-opt headline))
|
|
|
(options
|
|
|
;; Collect options from default value and headline's
|
|
|
;; properties. Also add a label for links.
|
|
|
(append
|
|
|
- (org-split-string org-e-beamer-frame-default-options ",")
|
|
|
+ (org-split-string org-beamer-frame-default-options ",")
|
|
|
(and beamer-opt
|
|
|
(org-split-string
|
|
|
;; Remove square brackets if user provided
|
|
@@ -452,9 +456,9 @@ used as a communication channel."
|
|
|
(string-match "\\(^\\|,\\)label=" beamer-opt))
|
|
|
(list
|
|
|
(format "label=%s"
|
|
|
- (org-e-beamer--get-label headline info)))))))
|
|
|
+ (org-beamer--get-label headline info)))))))
|
|
|
;; Change options list into a string.
|
|
|
- (org-e-beamer--normalize-argument
|
|
|
+ (org-beamer--normalize-argument
|
|
|
(mapconcat
|
|
|
'identity
|
|
|
(if (or (not fragilep) (member "fragile" options)) options
|
|
@@ -479,7 +483,7 @@ used as a communication channel."
|
|
|
(replace-regexp-in-string "\\`\n*" "\\& " contents))
|
|
|
"\\end{frame}")))
|
|
|
|
|
|
-(defun org-e-beamer--format-block (headline contents info)
|
|
|
+(defun org-beamer--format-block (headline contents info)
|
|
|
"Format HEADLINE as a block.
|
|
|
CONTENTS holds the contents of the headline. INFO is a plist
|
|
|
used as a communication channel."
|
|
@@ -498,13 +502,13 @@ used as a communication channel."
|
|
|
(t (downcase env)))))
|
|
|
(env-format (unless (member environment '("column" "columns"))
|
|
|
(assoc environment
|
|
|
- (append org-e-beamer-environments-special
|
|
|
- org-e-beamer-environments-extra
|
|
|
- org-e-beamer-environments-default))))
|
|
|
+ (append org-beamer-environments-special
|
|
|
+ org-beamer-environments-extra
|
|
|
+ org-beamer-environments-default))))
|
|
|
(title (org-export-data (org-element-property :title headline) info))
|
|
|
(options (let ((options (org-element-property :beamer-opt headline)))
|
|
|
(if (not options) ""
|
|
|
- (org-e-beamer--normalize-argument options 'option))))
|
|
|
+ (org-beamer--normalize-argument options 'option))))
|
|
|
;; Start a "columns" environment when explicitly requested or
|
|
|
;; when there is no previous headline or the previous
|
|
|
;; headline do not have a BEAMER_column property.
|
|
@@ -559,10 +563,10 @@ used as a communication channel."
|
|
|
((not action) (list (cons "a" "") (cons "A" "")))
|
|
|
((string-match "\\`\\[.*\\]\\'" action)
|
|
|
(list
|
|
|
- (cons "A" (org-e-beamer--normalize-argument action 'defaction))
|
|
|
+ (cons "A" (org-beamer--normalize-argument action 'defaction))
|
|
|
(cons "a" "")))
|
|
|
(t
|
|
|
- (list (cons "a" (org-e-beamer--normalize-argument action 'action))
|
|
|
+ (list (cons "a" (org-beamer--normalize-argument action 'action))
|
|
|
(cons "A" "")))))
|
|
|
(list (cons "o" options)
|
|
|
(cons "h" title)
|
|
@@ -575,13 +579,13 @@ used as a communication channel."
|
|
|
(when column-width "\\end{column}\n")
|
|
|
(when end-columns-p "\\end{columns}"))))
|
|
|
|
|
|
-(defun org-e-beamer-headline (headline contents info)
|
|
|
+(defun org-beamer-headline (headline contents info)
|
|
|
"Transcode HEADLINE element into Beamer code.
|
|
|
CONTENTS is the contents of the headline. INFO is a plist used
|
|
|
as a communication channel."
|
|
|
(unless (org-element-property :footnote-section-p headline)
|
|
|
(let ((level (org-export-get-relative-level headline info))
|
|
|
- (frame-level (org-e-beamer--frame-level headline info))
|
|
|
+ (frame-level (org-beamer--frame-level headline info))
|
|
|
(environment (let ((env (org-element-property :beamer-env headline)))
|
|
|
(if (stringp env) (downcase env) "block"))))
|
|
|
(cond
|
|
@@ -595,14 +599,14 @@ as a communication channel."
|
|
|
;; Overlay specification.
|
|
|
(let ((overlay (org-element-property :beamer-act headline)))
|
|
|
(when overlay
|
|
|
- (org-e-beamer--normalize-argument
|
|
|
+ (org-beamer--normalize-argument
|
|
|
overlay
|
|
|
(if (string-match "^\\[.*\\]$" overlay) 'defaction
|
|
|
'action))))
|
|
|
;; Options.
|
|
|
(let ((options (org-element-property :beamer-opt headline)))
|
|
|
(when options
|
|
|
- (org-e-beamer--normalize-argument options 'option)))
|
|
|
+ (org-beamer--normalize-argument options 'option)))
|
|
|
;; Resolve reference provided by "BEAMER_ref"
|
|
|
;; property. This is done by building a minimal fake
|
|
|
;; link and calling the appropriate resolve function,
|
|
@@ -621,7 +625,7 @@ as a communication channel."
|
|
|
(org-export-resolve-id-link link info))))
|
|
|
;; Now use user-defined label provided in TARGET
|
|
|
;; headline, or fallback to standard one.
|
|
|
- (format "{%s}" (org-e-beamer--get-label target info)))))))
|
|
|
+ (format "{%s}" (org-beamer--get-label target info)))))))
|
|
|
;; Case 2: Creation of an appendix is requested.
|
|
|
((equal environment "appendix")
|
|
|
(concat "\\appendix"
|
|
@@ -644,25 +648,25 @@ as a communication channel."
|
|
|
(org-trim contents))))
|
|
|
;; Case 5: HEADLINE is a frame.
|
|
|
((= level frame-level)
|
|
|
- (org-e-beamer--format-frame headline contents info))
|
|
|
+ (org-beamer--format-frame headline contents info))
|
|
|
;; Case 6: Regular section, extracted from
|
|
|
- ;; `org-e-latex-classes'.
|
|
|
+ ;; `org-latex-classes'.
|
|
|
((< level frame-level)
|
|
|
- (org-e-beamer--format-section headline contents info))
|
|
|
+ (org-beamer--format-section headline contents info))
|
|
|
;; Case 7: Otherwise, HEADLINE is a block.
|
|
|
- (t (org-e-beamer--format-block headline contents info))))))
|
|
|
+ (t (org-beamer--format-block headline contents info))))))
|
|
|
|
|
|
|
|
|
;;;; Item
|
|
|
|
|
|
-(defun org-e-beamer-item (item contents info)
|
|
|
+(defun org-beamer-item (item contents info)
|
|
|
"Transcode an ITEM element into Beamer code.
|
|
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
|
contextual information."
|
|
|
(let ((action (let ((first-element (car (org-element-contents item))))
|
|
|
(and (eq (org-element-type first-element) 'paragraph)
|
|
|
- (org-e-beamer--element-has-overlay-p first-element))))
|
|
|
- (output (org-export-with-backend 'e-latex item contents info)))
|
|
|
+ (org-beamer--element-has-overlay-p first-element))))
|
|
|
+ (output (org-export-with-backend 'latex item contents info)))
|
|
|
(if (not action) output
|
|
|
;; If the item starts with a paragraph and that paragraph starts
|
|
|
;; with an export snippet specifying an overlay, insert it after
|
|
@@ -672,14 +676,14 @@ contextual information."
|
|
|
|
|
|
;;;; Keyword
|
|
|
|
|
|
-(defun org-e-beamer-keyword (keyword contents info)
|
|
|
+(defun org-beamer-keyword (keyword contents info)
|
|
|
"Transcode a KEYWORD element into Beamer code.
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
channel."
|
|
|
(let ((key (org-element-property :key keyword))
|
|
|
(value (org-element-property :value keyword)))
|
|
|
;; Handle specifically BEAMER and TOC (headlines only) keywords.
|
|
|
- ;; Otherwise, fallback to `e-latex' back-end.
|
|
|
+ ;; Otherwise, fallback to `latex' back-end.
|
|
|
(cond
|
|
|
((equal key "BEAMER") value)
|
|
|
((and (equal key "TOC") (string-match "\\<headlines\\>" value))
|
|
@@ -693,12 +697,12 @@ channel."
|
|
|
(when (wholenump depth) (format "\\setcounter{tocdepth}{%s}\n" depth))
|
|
|
"\\tableofcontents" options "\n"
|
|
|
"\\end{frame}")))
|
|
|
- (t (org-export-with-backend 'e-latex keyword contents info)))))
|
|
|
+ (t (org-export-with-backend 'latex keyword contents info)))))
|
|
|
|
|
|
|
|
|
;;;; Link
|
|
|
|
|
|
-(defun org-e-beamer-link (link contents info)
|
|
|
+(defun org-beamer-link (link contents info)
|
|
|
"Transcode a LINK object into Beamer code.
|
|
|
CONTENTS is the description part of the link. INFO is a plist
|
|
|
used as a communication channel."
|
|
@@ -710,7 +714,7 @@ used as a communication channel."
|
|
|
(let ((destination (org-export-resolve-radio-link link info)))
|
|
|
(when destination
|
|
|
(format "\\hyperlink%s{%s}{%s}"
|
|
|
- (or (org-e-beamer--element-has-overlay-p link) "")
|
|
|
+ (or (org-beamer--element-has-overlay-p link) "")
|
|
|
(org-export-solidify-link-text path)
|
|
|
(org-export-data (org-element-contents destination) info)))))
|
|
|
((and (member type '("custom-id" "fuzzy" "id"))
|
|
@@ -729,18 +733,18 @@ used as a communication channel."
|
|
|
(if (and (plist-get info :section-numbers) (not contents))
|
|
|
(format "\\ref{%s}" label)
|
|
|
(format "\\hyperlink%s{%s}{%s}"
|
|
|
- (or (org-e-beamer--element-has-overlay-p link) "")
|
|
|
+ (or (org-beamer--element-has-overlay-p link) "")
|
|
|
label
|
|
|
contents))))
|
|
|
(target
|
|
|
(let ((path (org-export-solidify-link-text path)))
|
|
|
(if (not contents) (format "\\ref{%s}" path)
|
|
|
(format "\\hyperlink%s{%s}{%s}"
|
|
|
- (or (org-e-beamer--element-has-overlay-p link) "")
|
|
|
+ (or (org-beamer--element-has-overlay-p link) "")
|
|
|
path
|
|
|
contents))))))))
|
|
|
- ;; Otherwise, use `e-latex' back-end.
|
|
|
- (t (org-export-with-backend 'e-latex link contents info)))))
|
|
|
+ ;; Otherwise, use `latex' back-end.
|
|
|
+ (t (org-export-with-backend 'latex link contents info)))))
|
|
|
|
|
|
|
|
|
;;;; Plain List
|
|
@@ -748,7 +752,7 @@ used as a communication channel."
|
|
|
;; Plain lists support `:environment', `:overlay' and `:options'
|
|
|
;; attributes.
|
|
|
|
|
|
-(defun org-e-beamer-plain-list (plain-list contents info)
|
|
|
+(defun org-beamer-plain-list (plain-list contents info)
|
|
|
"Transcode a PLAIN-LIST element into Beamer code.
|
|
|
CONTENTS is the contents of the list. INFO is a plist holding
|
|
|
contextual information."
|
|
@@ -759,16 +763,16 @@ contextual information."
|
|
|
((eq type 'ordered) "enumerate")
|
|
|
((eq type 'descriptive) "description")
|
|
|
(t "itemize")))))
|
|
|
- (org-e-latex--wrap-label
|
|
|
+ (org-latex--wrap-label
|
|
|
plain-list
|
|
|
(format "\\begin{%s}%s%s\n%s\\end{%s}"
|
|
|
latex-type
|
|
|
;; Default overlay specification, if any.
|
|
|
- (org-e-beamer--normalize-argument
|
|
|
+ (org-beamer--normalize-argument
|
|
|
(format "%s" (or (plist-get attributes :overlay) ""))
|
|
|
'defaction)
|
|
|
;; Second optional argument depends on the list type.
|
|
|
- (org-e-beamer--normalize-argument
|
|
|
+ (org-beamer--normalize-argument
|
|
|
(format "%s" (or (plist-get attributes :options) ""))
|
|
|
'option)
|
|
|
;; Eventually insert contents and close environment.
|
|
@@ -778,12 +782,12 @@ contextual information."
|
|
|
|
|
|
;;;; Radio Target
|
|
|
|
|
|
-(defun org-e-beamer-radio-target (radio-target text info)
|
|
|
+(defun org-beamer-radio-target (radio-target text info)
|
|
|
"Transcode a RADIO-TARGET object into Beamer code.
|
|
|
TEXT is the text of the target. INFO is a plist holding
|
|
|
contextual information."
|
|
|
(format "\\hypertarget%s{%s}{%s}"
|
|
|
- (or (org-e-beamer--element-has-overlay-p radio-target) "")
|
|
|
+ (or (org-beamer--element-has-overlay-p radio-target) "")
|
|
|
(org-export-solidify-link-text
|
|
|
(org-element-property :value radio-target))
|
|
|
text))
|
|
@@ -791,7 +795,7 @@ contextual information."
|
|
|
|
|
|
;;;; Target
|
|
|
|
|
|
-(defun org-e-beamer-target (target contents info)
|
|
|
+(defun org-beamer-target (target contents info)
|
|
|
"Transcode a TARGET object into Beamer code.
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
information."
|
|
@@ -801,10 +805,10 @@ information."
|
|
|
|
|
|
;;;; Template
|
|
|
;;
|
|
|
-;; Template used is similar to the one used in `e-latex' back-end,
|
|
|
+;; Template used is similar to the one used in `latex' back-end,
|
|
|
;; excepted for the table of contents and Beamer themes.
|
|
|
|
|
|
-(defun org-e-beamer-template (contents info)
|
|
|
+(defun org-beamer-template (contents info)
|
|
|
"Return complete document string after Beamer conversion.
|
|
|
CONTENTS is the transcoded contents string. INFO is a plist
|
|
|
holding export options."
|
|
@@ -817,7 +821,7 @@ holding export options."
|
|
|
(let ((class (plist-get info :latex-class))
|
|
|
(class-options (plist-get info :latex-class-options)))
|
|
|
(org-element-normalize-string
|
|
|
- (let* ((header (nth 1 (assoc class org-e-latex-classes)))
|
|
|
+ (let* ((header (nth 1 (assoc class org-latex-classes)))
|
|
|
(document-class-string
|
|
|
(and (stringp header)
|
|
|
(if (not class-options) header
|
|
@@ -825,8 +829,8 @@ holding export options."
|
|
|
"^[ \t]*\\\\documentclass\\(\\(\\[.*\\]\\)?\\)"
|
|
|
class-options header t nil 1)))))
|
|
|
(when document-class-string
|
|
|
- (org-e-latex--guess-babel-language
|
|
|
- (org-e-latex--guess-inputenc
|
|
|
+ (org-latex--guess-babel-language
|
|
|
+ (org-latex--guess-inputenc
|
|
|
(org-splice-latex-header
|
|
|
document-class-string
|
|
|
org-export-latex-default-packages-alist ; defined in org.el
|
|
@@ -868,9 +872,17 @@ holding export options."
|
|
|
(author (format "\\author{%s}\n" author))
|
|
|
(t "\\author{}\n")))
|
|
|
;; 6. Date.
|
|
|
- (let ((date (and (plist-get info :with-date)
|
|
|
- (org-export-data (plist-get info :date) info))))
|
|
|
- (format "\\date{%s}\n" (or date "")))
|
|
|
+ (let ((date (and (plist-get info :with-date) (plist-get info :date))))
|
|
|
+ (format "\\date{%s}\n"
|
|
|
+ (cond ((not date) "")
|
|
|
+ ;; If `:date' consists in a single timestamp and
|
|
|
+ ;; `:date-format' is provided, apply it.
|
|
|
+ ((and (plist-get info :date-format)
|
|
|
+ (not (cdr date))
|
|
|
+ (eq (org-element-type (car date)) 'timestamp))
|
|
|
+ (org-timestamp-format
|
|
|
+ (car date) (plist-get info :date-format)))
|
|
|
+ (t (org-export-data date info)))))
|
|
|
;; 7. Title
|
|
|
(format "\\title{%s}\n" title)
|
|
|
;; 8. Hyperref options.
|
|
@@ -885,19 +897,19 @@ holding export options."
|
|
|
;; 10. Title command.
|
|
|
(org-element-normalize-string
|
|
|
(cond ((string= "" title) nil)
|
|
|
- ((not (stringp org-e-latex-title-command)) nil)
|
|
|
+ ((not (stringp org-latex-title-command)) nil)
|
|
|
((string-match "\\(?:[^%]\\|^\\)%s"
|
|
|
- org-e-latex-title-command)
|
|
|
- (format org-e-latex-title-command title))
|
|
|
- (t org-e-latex-title-command)))
|
|
|
+ org-latex-title-command)
|
|
|
+ (format org-latex-title-command title))
|
|
|
+ (t org-latex-title-command)))
|
|
|
;; 11. Table of contents.
|
|
|
(let ((depth (plist-get info :with-toc)))
|
|
|
(when depth
|
|
|
(concat
|
|
|
(format "\\begin{frame}%s{%s}\n"
|
|
|
- (org-e-beamer--normalize-argument
|
|
|
- org-e-beamer-outline-frame-options 'option)
|
|
|
- org-e-beamer-outline-frame-title)
|
|
|
+ (org-beamer--normalize-argument
|
|
|
+ org-beamer-outline-frame-options 'option)
|
|
|
+ org-beamer-outline-frame-title)
|
|
|
(when (wholenump depth)
|
|
|
(format "\\setcounter{tocdepth}{%d}\n" depth))
|
|
|
"\\tableofcontents\n"
|
|
@@ -919,26 +931,26 @@ holding export options."
|
|
|
;;; Minor Mode
|
|
|
|
|
|
|
|
|
-(defvar org-e-beamer-mode-map (make-sparse-keymap)
|
|
|
- "The keymap for `org-e-beamer-mode'.")
|
|
|
-(define-key org-e-beamer-mode-map "\C-c\C-b" 'org-e-beamer-select-environment)
|
|
|
+(defvar org-beamer-mode-map (make-sparse-keymap)
|
|
|
+ "The keymap for `org-beamer-mode'.")
|
|
|
+(define-key org-beamer-mode-map "\C-c\C-b" 'org-beamer-select-environment)
|
|
|
|
|
|
;;;###autoload
|
|
|
-(define-minor-mode org-e-beamer-mode
|
|
|
+(define-minor-mode org-beamer-mode
|
|
|
"Support for editing Beamer oriented Org mode files."
|
|
|
- nil " Bm" 'org-e-beamer-mode-map)
|
|
|
+ nil " Bm" 'org-beamer-mode-map)
|
|
|
|
|
|
(when (fboundp 'font-lock-add-keywords)
|
|
|
(font-lock-add-keywords
|
|
|
'org-mode
|
|
|
- '((":\\(B_[a-z]+\\|BMCOL\\):" 1 'org-e-beamer-tag prepend))
|
|
|
+ '((":\\(B_[a-z]+\\|BMCOL\\):" 1 'org-beamer-tag prepend))
|
|
|
'prepend))
|
|
|
|
|
|
-(defface org-e-beamer-tag '((t (:box (:line-width 1 :color grey40))))
|
|
|
+(defface org-beamer-tag '((t (:box (:line-width 1 :color grey40))))
|
|
|
"The special face for beamer tags."
|
|
|
- :group 'org-export-e-beamer)
|
|
|
+ :group 'org-export-beamer)
|
|
|
|
|
|
-(defun org-e-beamer-property-changed (property value)
|
|
|
+(defun org-beamer-property-changed (property value)
|
|
|
"Track the BEAMER_env property with tags.
|
|
|
PROPERTY is the name of the modified property. VALUE is its new
|
|
|
value."
|
|
@@ -955,33 +967,33 @@ value."
|
|
|
((equal property "BEAMER_col")
|
|
|
(org-toggle-tag "BMCOL" (if (org-string-nw-p value) 'on 'off)))))
|
|
|
|
|
|
-(add-hook 'org-property-changed-functions 'org-e-beamer-property-changed)
|
|
|
+(add-hook 'org-property-changed-functions 'org-beamer-property-changed)
|
|
|
|
|
|
-(defun org-e-beamer-allowed-property-values (property)
|
|
|
+(defun org-beamer-allowed-property-values (property)
|
|
|
"Supply allowed values for PROPERTY."
|
|
|
(cond
|
|
|
((and (equal property "BEAMER_env")
|
|
|
(not (org-entry-get nil (concat property "_ALL") 'inherit)))
|
|
|
;; If no allowed values for BEAMER_env have been defined,
|
|
|
;; supply all defined environments
|
|
|
- (mapcar 'car (append org-e-beamer-environments-special
|
|
|
- org-e-beamer-environments-extra
|
|
|
- org-e-beamer-environments-default)))
|
|
|
+ (mapcar 'car (append org-beamer-environments-special
|
|
|
+ org-beamer-environments-extra
|
|
|
+ org-beamer-environments-default)))
|
|
|
((and (equal property "BEAMER_col")
|
|
|
(not (org-entry-get nil (concat property "_ALL") 'inherit)))
|
|
|
;; If no allowed values for BEAMER_col have been defined,
|
|
|
;; supply some
|
|
|
- (org-split-string org-e-beamer-column-widths " "))))
|
|
|
+ (org-split-string org-beamer-column-widths " "))))
|
|
|
|
|
|
(add-hook 'org-property-allowed-value-functions
|
|
|
- 'org-e-beamer-allowed-property-values)
|
|
|
+ 'org-beamer-allowed-property-values)
|
|
|
|
|
|
|
|
|
|
|
|
;;; Commands
|
|
|
|
|
|
;;;###autoload
|
|
|
-(defun org-e-beamer-export-as-latex
|
|
|
+(defun org-beamer-export-as-latex
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
|
|
"Export current buffer as a Beamer buffer.
|
|
|
|
|
@@ -1008,30 +1020,30 @@ EXT-PLIST, when provided, is a property list with external
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
file-local settings.
|
|
|
|
|
|
-Export is done in a buffer named \"*Org E-BEAMER Export*\", which
|
|
|
+Export is done in a buffer named \"*Org BEAMER Export*\", which
|
|
|
will be displayed when `org-export-show-temporary-export-buffer'
|
|
|
is non-nil."
|
|
|
(interactive)
|
|
|
(if async
|
|
|
(org-export-async-start
|
|
|
(lambda (output)
|
|
|
- (with-current-buffer (get-buffer-create "*Org E-BEAMER Export*")
|
|
|
+ (with-current-buffer (get-buffer-create "*Org BEAMER Export*")
|
|
|
(erase-buffer)
|
|
|
(insert output)
|
|
|
(goto-char (point-min))
|
|
|
(LaTeX-mode)
|
|
|
- (org-export-add-to-stack (current-buffer) 'e-beamer)))
|
|
|
- `(org-export-as 'e-beamer ,subtreep ,visible-only ,body-only
|
|
|
+ (org-export-add-to-stack (current-buffer) 'beamer)))
|
|
|
+ `(org-export-as 'beamer ,subtreep ,visible-only ,body-only
|
|
|
',ext-plist))
|
|
|
(let ((outbuf (org-export-to-buffer
|
|
|
- 'e-beamer "*Org E-BEAMER Export*"
|
|
|
+ 'beamer "*Org BEAMER Export*"
|
|
|
subtreep visible-only body-only ext-plist)))
|
|
|
(with-current-buffer outbuf (LaTeX-mode))
|
|
|
(when org-export-show-temporary-export-buffer
|
|
|
(switch-to-buffer-other-window outbuf)))))
|
|
|
|
|
|
;;;###autoload
|
|
|
-(defun org-e-beamer-export-to-latex
|
|
|
+(defun org-beamer-export-to-latex
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
|
|
"Export current buffer as a Beamer presentation (tex).
|
|
|
|
|
@@ -1063,16 +1075,16 @@ Return output file's name."
|
|
|
(let ((outfile (org-export-output-file-name ".tex" subtreep)))
|
|
|
(if async
|
|
|
(org-export-async-start
|
|
|
- (lambda (f) (org-export-add-to-stack f 'e-beamer))
|
|
|
+ (lambda (f) (org-export-add-to-stack f 'beamer))
|
|
|
`(expand-file-name
|
|
|
(org-export-to-file
|
|
|
- 'e-beamer ,outfile ,subtreep ,visible-only ,body-only
|
|
|
+ 'beamer ,outfile ,subtreep ,visible-only ,body-only
|
|
|
',ext-plist)))
|
|
|
(org-export-to-file
|
|
|
- 'e-beamer outfile subtreep visible-only body-only ext-plist))))
|
|
|
+ 'beamer outfile subtreep visible-only body-only ext-plist))))
|
|
|
|
|
|
;;;###autoload
|
|
|
-(defun org-e-beamer-export-to-pdf
|
|
|
+(defun org-beamer-export-to-pdf
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
|
|
"Export current buffer as a Beamer presentation (PDF).
|
|
|
|
|
@@ -1104,18 +1116,18 @@ Return PDF file's name."
|
|
|
(if async
|
|
|
(let ((outfile (org-export-output-file-name ".tex" subtreep)))
|
|
|
(org-export-async-start
|
|
|
- (lambda (f) (org-export-add-to-stack f 'e-beamer))
|
|
|
+ (lambda (f) (org-export-add-to-stack f 'beamer))
|
|
|
`(expand-file-name
|
|
|
- (org-e-latex-compile
|
|
|
+ (org-latex-compile
|
|
|
(org-export-to-file
|
|
|
- 'e-beamer ,outfile ,subtreep ,visible-only ,body-only
|
|
|
+ 'beamer ,outfile ,subtreep ,visible-only ,body-only
|
|
|
',ext-plist)))))
|
|
|
- (org-e-latex-compile
|
|
|
- (org-e-beamer-export-to-latex
|
|
|
+ (org-latex-compile
|
|
|
+ (org-beamer-export-to-latex
|
|
|
nil subtreep visible-only body-only ext-plist))))
|
|
|
|
|
|
;;;###autoload
|
|
|
-(defun org-e-beamer-select-environment ()
|
|
|
+(defun org-beamer-select-environment ()
|
|
|
"Select the environment to be used by beamer for this entry.
|
|
|
While this uses (for convenience) a tag selection interface, the
|
|
|
result of this command will be that the BEAMER_env *property* of
|
|
@@ -1124,11 +1136,11 @@ the entry is set.
|
|
|
In addition to this, the command will also set a tag as a visual
|
|
|
aid, but the tag does not have any semantic meaning."
|
|
|
(interactive)
|
|
|
- ;; Make sure `org-e-beamer-environments-special' has a higher
|
|
|
- ;; priority than `org-e-beamer-environments-extra'.
|
|
|
- (let* ((envs (append org-e-beamer-environments-special
|
|
|
- org-e-beamer-environments-extra
|
|
|
- org-e-beamer-environments-default))
|
|
|
+ ;; Make sure `org-beamer-environments-special' has a higher
|
|
|
+ ;; priority than `org-beamer-environments-extra'.
|
|
|
+ (let* ((envs (append org-beamer-environments-special
|
|
|
+ org-beamer-environments-extra
|
|
|
+ org-beamer-environments-default))
|
|
|
(org-tag-alist
|
|
|
(append '((:startgroup))
|
|
|
(mapcar (lambda (e) (cons (concat "B_" (car e))
|
|
@@ -1163,7 +1175,7 @@ aid, but the tag does not have any semantic meaning."
|
|
|
(t (org-entry-delete nil "BEAMER_env"))))))
|
|
|
|
|
|
;;;###autoload
|
|
|
-(defun org-e-beamer-insert-options-template (&optional kind)
|
|
|
+(defun org-beamer-insert-options-template (&optional kind)
|
|
|
"Insert a settings template, to make sure users do this right."
|
|
|
(interactive (progn
|
|
|
(message "Current [s]ubtree or [g]lobal?")
|
|
@@ -1176,19 +1188,18 @@ aid, but the tag does not have any semantic meaning."
|
|
|
(org-entry-put nil "EXPORT_LaTeX_CLASS" "beamer")
|
|
|
(org-entry-put nil "EXPORT_LaTeX_CLASS_OPTIONS" "[presentation]")
|
|
|
(org-entry-put nil "EXPORT_FILE_NAME" "presentation.pdf")
|
|
|
- (when org-e-beamer-column-view-format
|
|
|
- (org-entry-put nil "COLUMNS" org-e-beamer-column-view-format))
|
|
|
- (org-entry-put nil "BEAMER_col_ALL" org-e-beamer-column-widths))
|
|
|
+ (when org-beamer-column-view-format
|
|
|
+ (org-entry-put nil "COLUMNS" org-beamer-column-view-format))
|
|
|
+ (org-entry-put nil "BEAMER_col_ALL" org-beamer-column-widths))
|
|
|
(insert "#+LaTeX_CLASS: beamer\n")
|
|
|
(insert "#+LaTeX_CLASS_OPTIONS: [presentation]\n")
|
|
|
- (when org-e-beamer-theme
|
|
|
- (insert "#+BEAMER_THEME: " org-e-beamer-theme "\n"))
|
|
|
- (when org-e-beamer-column-view-format
|
|
|
- (insert "#+COLUMNS: " org-e-beamer-column-view-format "\n"))
|
|
|
- (insert "#+PROPERTY: BEAMER_col_ALL " org-e-beamer-column-widths "\n")))
|
|
|
+ (when org-beamer-theme (insert "#+BEAMER_THEME: " org-beamer-theme "\n"))
|
|
|
+ (when org-beamer-column-view-format
|
|
|
+ (insert "#+COLUMNS: " org-beamer-column-view-format "\n"))
|
|
|
+ (insert "#+PROPERTY: BEAMER_col_ALL " org-beamer-column-widths "\n")))
|
|
|
|
|
|
;;;###autoload
|
|
|
-(defun org-e-beamer-publish-to-latex (plist filename pub-dir)
|
|
|
+(defun org-beamer-publish-to-latex (plist filename pub-dir)
|
|
|
"Publish an Org file to a Beamer presentation (LaTeX).
|
|
|
|
|
|
FILENAME is the filename of the Org file to be published. PLIST
|
|
@@ -1196,10 +1207,10 @@ is the property list for the given project. PUB-DIR is the
|
|
|
publishing directory.
|
|
|
|
|
|
Return output file name."
|
|
|
- (org-e-publish-org-to 'e-beamer filename ".tex" plist pub-dir))
|
|
|
+ (org-publish-org-to 'beamer filename ".tex" plist pub-dir))
|
|
|
|
|
|
;;;###autoload
|
|
|
-(defun org-e-beamer-publish-to-pdf (plist filename pub-dir)
|
|
|
+(defun org-beamer-publish-to-pdf (plist filename pub-dir)
|
|
|
"Publish an Org file to a Beamer presentation (PDF, via LaTeX).
|
|
|
|
|
|
FILENAME is the filename of the Org file to be published. PLIST
|
|
@@ -1207,13 +1218,18 @@ is the property list for the given project. PUB-DIR is the
|
|
|
publishing directory.
|
|
|
|
|
|
Return output file name."
|
|
|
- ;; Unlike to `org-e-beamer-publish-to-latex', PDF file is generated
|
|
|
- ;; in working directory and then moved to publishing directory.
|
|
|
- (org-e-publish-attachment
|
|
|
+ ;; Unlike to `org-beamer-publish-to-latex', PDF file is generated in
|
|
|
+ ;; working directory and then moved to publishing directory.
|
|
|
+ (org-publish-attachment
|
|
|
plist
|
|
|
- (org-e-latex-compile (org-e-publish-org-to 'e-beamer filename ".tex" plist))
|
|
|
+ (org-latex-compile (org-publish-org-to 'beamer filename ".tex" plist))
|
|
|
pub-dir))
|
|
|
|
|
|
|
|
|
-(provide 'org-e-beamer)
|
|
|
-;;; org-e-beamer.el ends here
|
|
|
+(provide 'ox-beamer)
|
|
|
+
|
|
|
+;; Local variables:
|
|
|
+;; generated-autoload-file: "org-loaddefs.el"
|
|
|
+;; End:
|
|
|
+
|
|
|
+;;; ox-beamer.el ends here
|