2015-10-29 17:39:29 +00:00
|
|
|
|
;;; ox-beamer.el --- Beamer Back-End for Org Export Engine -*- lexical-binding: t; -*-
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
2021-01-01 19:55:31 +00:00
|
|
|
|
;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
;; Author: Carsten Dominik <carsten.dominik AT gmail DOT com>
|
|
|
|
|
;; Nicolas Goaziou <n.goaziou AT gmail DOT com>
|
2021-05-03 04:41:56 +00:00
|
|
|
|
;; Maintainer: Nicolas Goaziou <n.goaziou at gmail dot com>
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;; Keywords: org, wp, tex
|
|
|
|
|
|
Backport changes from Emacs revs 115081 and 115082
2013-11-12 Stefan Monnier <monnier@iro.umontreal.ca>
Address some byte-compiler warnings.
* ob-abc.el (org-babel-expand-body:abc): Use dolist.
(org-babel-execute:abc): Fix regexp quoting.
* ob-calc.el (org--var-syms): Rename from `var-syms'.
* ob-lilypond.el (ly-compile-lilyfile): Remove redundant let-binding.
* ob-table.el (sbe): Move debug declaration.
* org-clock.el (org--msg-extra): Rename from `msg-extra'.
* org.el (org-version): Avoid var name starting with _.
(org-inhibit-startup, org-called-with-limited-levels)
(org-link-search-inhibit-query, org-time-was-given)
(org-end-time-was-given, org-def, org-defdecode, org-with-time):
* org-colview.el (org-agenda-overriding-columns-format):
* org-agenda.el (org-agenda-multi, org-depend-tag-blocked)
(org-agenda-show-log-scoped):
* ob-python.el (py-which-bufname, python-shell-buffer-name):
* ob-haskell.el (org-export-copy-to-kill-ring):
* ob-exp.el (org-link-search-inhibit-query):
* ob-R.el (ess-eval-visibly-p):
* ob-core.el (org-src-window-setup): Declare before use.
(org-babel-expand-noweb-references): Remove unused `blocks-in-buffer'.
* ox-odt.el (org-odt-hfy-face-to-css):
* org-src.el (org-src-associate-babel-session, org-src-get-lang-mode):
* org-bibtex.el (org-bibtex-get, org-bibtex-ask, org-bibtex)
(org-bibtex-check):
* ob-tangle.el (org-babel-tangle, org-babel-spec-to-string)
(org-babel-tangle-single-block, org-babel-tangle-comment-links):
* ob-table.el (sbe):
* ob-sqlite.el (org-babel-sqlite-expand-vars):
* ob-sql.el (org-babel-sql-expand-vars):
* ob-shen.el (org-babel-execute:shen):
* ob-sh.el (org-babel-execute:sh, org-babel-sh-evaluate):
* ob-scala.el (org-babel-scala-evaluate):
* ob-ruby.el (org-babel-ruby-table-or-string)
(org-babel-ruby-evaluate):
* ob-python.el (org-babel-python-table-or-string)
(org-babel-python-evaluate-external-process)
(org-babel-python-evaluate-session):
* ob-picolisp.el (org-babel-execute:picolisp):
* ob-perl.el (org-babel-perl-evaluate):
* ob-maxima.el (org-babel-execute:maxima):
* ob-lisp.el (org-babel-execute:lisp):
* ob-java.el (org-babel-execute:java):
* ob-io.el (org-babel-io-evaluate):
* ob-haskell.el (org-babel-execute:haskell):
* ob-fortran.el (org-babel-execute:fortran):
* ob-exp.el (org-babel-exp-code):
* ob-emacs-lisp.el (org-babel-execute:emacs-lisp):
* ob-ditaa.el (org-babel-execute:ditaa):
* ob-core.el (org-babel-execute-src-block, org-babel-sha1-hash)
(org-babel-parse-header-arguments, org-babel-reassemble-table)
(org-babel-goto-src-block-head, org-babel-mark-block)
(org-babel-expand-noweb-references, org-babel-script-escape)
(org-babel-process-file-name):
* ob-clojure.el (org-babel-execute:clojure):
* ob-calc.el (org-babel-execute:calc):
* ob-awk.el (org-babel-execute:awk):
* ob-abc.el (org-babel-execute:abc):
* ob-R.el (org-babel-expand-body:R):
* ob-C.el (org-babel-C-execute): Avoid deprecated ((lambda) ...).
2013-11-12 Glenn Morris <rgm@gnu.org>
* ox-html.el (org-html-scripts): Add 2013 to copyright years.
(org-html-infojs-template): Copyright holder to FSF.
2013-11-12 19:57:31 +00:00
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;; GNU Emacs 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 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs 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
|
2017-09-13 22:52:52 +00:00
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
;;
|
|
|
|
|
;; This library implements both a Beamer back-end, derived from the
|
|
|
|
|
;; LaTeX one and a minor mode easing structure edition of the
|
2013-10-20 08:58:30 +00:00
|
|
|
|
;; document. See Org manual for more information.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2015-11-06 12:04:20 +00:00
|
|
|
|
(require 'cl-lib)
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(require 'ox-latex)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
2013-04-14 09:41:42 +00:00
|
|
|
|
;; Install a default set-up for Beamer export.
|
|
|
|
|
(unless (assoc "beamer" org-latex-classes)
|
|
|
|
|
(add-to-list 'org-latex-classes
|
|
|
|
|
'("beamer"
|
2014-01-17 11:44:05 +00:00
|
|
|
|
"\\documentclass[presentation]{beamer}"
|
2013-04-14 09:41:42 +00:00
|
|
|
|
("\\section{%s}" . "\\section*{%s}")
|
|
|
|
|
("\\subsection{%s}" . "\\subsection*{%s}")
|
|
|
|
|
("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
|
|
|
|
|
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; User-Configurable Variables
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defgroup org-export-beamer nil
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Options specific for using the beamer class in LaTeX export."
|
|
|
|
|
:tag "Org Beamer"
|
2012-07-06 22:51:02 +00:00
|
|
|
|
:group 'org-export
|
2012-06-30 11:54:43 +00:00
|
|
|
|
:version "24.2")
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-beamer-frame-level 1
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"The level at which headlines become frames.
|
|
|
|
|
|
|
|
|
|
Headlines at a lower level will be translated into a sectioning
|
|
|
|
|
structure. At a higher level, they will be translated into
|
|
|
|
|
blocks.
|
|
|
|
|
|
2013-02-23 12:47:44 +00:00
|
|
|
|
If a headline with a \"BEAMER_env\" property set to \"frame\" is
|
2012-06-30 11:54:43 +00:00
|
|
|
|
found within a tree, its level locally overrides this number.
|
|
|
|
|
|
|
|
|
|
This variable has no effect on headlines with the \"BEAMER_env\"
|
|
|
|
|
property set to either \"ignoreheading\", \"appendix\", or
|
|
|
|
|
\"note\", which will respectively, be invisible, become an
|
|
|
|
|
appendix or a note.
|
|
|
|
|
|
2013-02-23 12:47:44 +00:00
|
|
|
|
This integer is relative to the minimal level of a headline
|
2012-06-30 11:54:43 +00:00
|
|
|
|
within the parse tree, defined as 1."
|
2013-01-27 22:11:34 +00:00
|
|
|
|
:group 'org-export-beamer
|
2012-06-30 11:54:43 +00:00
|
|
|
|
:type 'integer)
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-beamer-frame-default-options ""
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Default options string to use for frames.
|
|
|
|
|
For example, it could be set to \"allowframebreaks\"."
|
2013-01-27 22:11:34 +00:00
|
|
|
|
:group 'org-export-beamer
|
2012-06-30 11:54:43 +00:00
|
|
|
|
:type '(string :tag "[options]"))
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-beamer-column-view-format
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"%45ITEM %10BEAMER_env(Env) %10BEAMER_act(Act) %4BEAMER_col(Col) %8BEAMER_opt(Opt)"
|
|
|
|
|
"Column view format that should be used to fill the template."
|
2013-01-27 22:11:34 +00:00
|
|
|
|
:group 'org-export-beamer
|
Export framework: Add :version and :package-version informations to defcustoms
* lisp/ox-beamer.el (org-beamer-column-view-format, org-beamer-theme,
org-beamer-environments-extra): Add :version and :package-version.
* lisp/ox-html.el (org-html-with-latex, org-html-inline-image-rules):
Add :version and :package-version.
* lisp/ox-latex.el (org-latex-inline-image-rules,
org-latex-default-table-environment, org-latex-default-table-mode,
org-latex-tables-booktabs, org-latex-table-scientific-notation,
org-latex-known-errors): Add :version and :package-version.
* lisp/ox-md.el (org-md-headline-style): Add :version
and :package-version.
* lisp/ox-odt.el (org-odt-with-latex): Add :version
and :package-version.
* lisp/ox.el (org-export-with-drawers, org-export-with-latex,
org-export-with-inlinetasks, org-export-with-planning,
org-export-with-smart-quotes, org-export-with-statistics-cookies,
org-export-allow-bind-keywords, org-export-async-init-file):
Add :version and :package-version.
2013-03-06 13:45:12 +00:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2012-06-30 11:54:43 +00:00
|
|
|
|
:type '(choice
|
|
|
|
|
(const :tag "Do not insert Beamer column view format" nil)
|
|
|
|
|
(string :tag "Beamer column view format")))
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-beamer-theme "default"
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Default theme used in Beamer presentations."
|
2013-01-27 22:11:34 +00:00
|
|
|
|
:group 'org-export-beamer
|
Export framework: Add :version and :package-version informations to defcustoms
* lisp/ox-beamer.el (org-beamer-column-view-format, org-beamer-theme,
org-beamer-environments-extra): Add :version and :package-version.
* lisp/ox-html.el (org-html-with-latex, org-html-inline-image-rules):
Add :version and :package-version.
* lisp/ox-latex.el (org-latex-inline-image-rules,
org-latex-default-table-environment, org-latex-default-table-mode,
org-latex-tables-booktabs, org-latex-table-scientific-notation,
org-latex-known-errors): Add :version and :package-version.
* lisp/ox-md.el (org-md-headline-style): Add :version
and :package-version.
* lisp/ox-odt.el (org-odt-with-latex): Add :version
and :package-version.
* lisp/ox.el (org-export-with-drawers, org-export-with-latex,
org-export-with-inlinetasks, org-export-with-planning,
org-export-with-smart-quotes, org-export-with-statistics-cookies,
org-export-allow-bind-keywords, org-export-async-init-file):
Add :version and :package-version.
2013-03-06 13:45:12 +00:00
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
2012-06-30 11:54:43 +00:00
|
|
|
|
:type '(choice
|
|
|
|
|
(const :tag "Do not insert a Beamer theme" nil)
|
|
|
|
|
(string :tag "Beamer theme")))
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-beamer-environments-extra nil
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Environments triggered by tags in Beamer export.
|
|
|
|
|
Each entry has 4 elements:
|
|
|
|
|
|
|
|
|
|
name Name of the environment
|
2013-01-27 22:11:34 +00:00
|
|
|
|
key Selection key for `org-beamer-select-environment'
|
2012-06-30 11:54:43 +00:00
|
|
|
|
open The opening template for the environment, with the following escapes
|
|
|
|
|
%a the action/overlay specification
|
|
|
|
|
%A the default action/overlay specification
|
2015-06-16 13:26:47 +00:00
|
|
|
|
%R the raw BEAMER_act value
|
|
|
|
|
%o the options argument, with square brackets
|
|
|
|
|
%O the raw BEAMER_opt value
|
2012-06-30 11:54:43 +00:00
|
|
|
|
%h the headline text
|
2013-06-29 12:35:31 +00:00
|
|
|
|
%r the raw headline text (i.e. without any processing)
|
|
|
|
|
%H if there is headline text, that raw text in {} braces
|
|
|
|
|
%U if there is headline text, that raw text in [] brackets
|
2012-06-30 11:54:43 +00:00
|
|
|
|
close The closing string of the environment."
|
2013-01-27 22:11:34 +00:00
|
|
|
|
:group 'org-export-beamer
|
Export framework: Add :version and :package-version informations to defcustoms
* lisp/ox-beamer.el (org-beamer-column-view-format, org-beamer-theme,
org-beamer-environments-extra): Add :version and :package-version.
* lisp/ox-html.el (org-html-with-latex, org-html-inline-image-rules):
Add :version and :package-version.
* lisp/ox-latex.el (org-latex-inline-image-rules,
org-latex-default-table-environment, org-latex-default-table-mode,
org-latex-tables-booktabs, org-latex-table-scientific-notation,
org-latex-known-errors): Add :version and :package-version.
* lisp/ox-md.el (org-md-headline-style): Add :version
and :package-version.
* lisp/ox-odt.el (org-odt-with-latex): Add :version
and :package-version.
* lisp/ox.el (org-export-with-drawers, org-export-with-latex,
org-export-with-inlinetasks, org-export-with-planning,
org-export-with-smart-quotes, org-export-with-statistics-cookies,
org-export-allow-bind-keywords, org-export-async-init-file):
Add :version and :package-version.
2013-03-06 13:45:12 +00:00
|
|
|
|
:version "24.4"
|
2013-06-29 12:35:31 +00:00
|
|
|
|
:package-version '(Org . "8.1")
|
2012-06-30 11:54:43 +00:00
|
|
|
|
:type '(repeat
|
|
|
|
|
(list
|
|
|
|
|
(string :tag "Environment")
|
|
|
|
|
(string :tag "Selection key")
|
|
|
|
|
(string :tag "Begin")
|
|
|
|
|
(string :tag "End"))))
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-beamer-outline-frame-title "Outline"
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Default title of a frame containing an outline."
|
2013-01-27 22:11:34 +00:00
|
|
|
|
:group 'org-export-beamer
|
2012-06-30 11:54:43 +00:00
|
|
|
|
:type '(string :tag "Outline frame title"))
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defcustom org-beamer-outline-frame-options ""
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Outline frame options appended after \\begin{frame}.
|
|
|
|
|
You might want to put e.g. \"allowframebreaks=0.9\" here."
|
2013-01-27 22:11:34 +00:00
|
|
|
|
:group 'org-export-beamer
|
2012-06-30 11:54:43 +00:00
|
|
|
|
:type '(string :tag "Outline frame options"))
|
|
|
|
|
|
|
|
|
|
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 21:09:19 +00:00
|
|
|
|
(defcustom org-beamer-subtitle-format "\\subtitle{%s}"
|
|
|
|
|
"Format string used for transcoded subtitle.
|
|
|
|
|
The format string should have at most one \"%s\"-expression,
|
|
|
|
|
which is replaced with the subtitle."
|
|
|
|
|
:group 'org-export-beamer
|
2017-01-26 04:39:18 +00:00
|
|
|
|
:version "26.1"
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 21:09:19 +00:00
|
|
|
|
:package-version '(Org . "8.3")
|
|
|
|
|
:type '(string :tag "Format string"))
|
|
|
|
|
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
;;; Internal Variables
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defconst org-beamer-column-widths
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"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.")
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defconst org-beamer-environments-special
|
2012-11-17 20:47:04 +00:00
|
|
|
|
'(("againframe" "A")
|
2012-09-04 09:07:56 +00:00
|
|
|
|
("appendix" "x")
|
2012-06-30 11:54:43 +00:00
|
|
|
|
("column" "c")
|
2012-11-17 20:17:19 +00:00
|
|
|
|
("columns" "C")
|
2012-06-30 11:54:43 +00:00
|
|
|
|
("frame" "f")
|
2012-11-17 20:47:04 +00:00
|
|
|
|
("fullframe" "F")
|
2012-06-30 11:54:43 +00:00
|
|
|
|
("ignoreheading" "i")
|
|
|
|
|
("note" "n")
|
|
|
|
|
("noteNH" "N"))
|
|
|
|
|
"Alist of environments treated in a special way by the back-end.
|
|
|
|
|
Keys are environment names, as strings, values are bindings used
|
2013-01-27 22:11:34 +00:00
|
|
|
|
in `org-beamer-select-environment'. Environments listed here,
|
2012-06-30 11:54:43 +00:00
|
|
|
|
along with their binding, are hard coded and cannot be modified
|
2013-01-27 22:11:34 +00:00
|
|
|
|
through `org-beamer-environments-extra' variable.")
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defconst org-beamer-environments-default
|
2012-06-30 11:54:43 +00:00
|
|
|
|
'(("block" "b" "\\begin{block}%a{%h}" "\\end{block}")
|
|
|
|
|
("alertblock" "a" "\\begin{alertblock}%a{%h}" "\\end{alertblock}")
|
|
|
|
|
("verse" "v" "\\begin{verse}%a %% %h" "\\end{verse}")
|
|
|
|
|
("quotation" "q" "\\begin{quotation}%a %% %h" "\\end{quotation}")
|
|
|
|
|
("quote" "Q" "\\begin{quote}%a %% %h" "\\end{quote}")
|
|
|
|
|
("structureenv" "s" "\\begin{structureenv}%a %% %h" "\\end{structureenv}")
|
2018-01-02 10:00:58 +00:00
|
|
|
|
("theorem" "t" "\\begin{theorem}%a[%h]" "\\end{theorem}")
|
|
|
|
|
("definition" "d" "\\begin{definition}%a[%h]" "\\end{definition}")
|
|
|
|
|
("example" "e" "\\begin{example}%a[%h]" "\\end{example}")
|
2012-06-30 11:54:43 +00:00
|
|
|
|
("exampleblock" "E" "\\begin{exampleblock}%a{%h}" "\\end{exampleblock}")
|
2018-01-02 10:00:58 +00:00
|
|
|
|
("proof" "p" "\\begin{proof}%a[%h]" "\\end{proof}")
|
2012-06-30 11:54:43 +00:00
|
|
|
|
("beamercolorbox" "o" "\\begin{beamercolorbox}%o{%h}" "\\end{beamercolorbox}"))
|
|
|
|
|
"Environments triggered by properties in Beamer export.
|
|
|
|
|
These are the defaults - for user definitions, see
|
2013-01-27 22:11:34 +00:00
|
|
|
|
`org-beamer-environments-extra'.")
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defconst org-beamer-verbatim-elements
|
2012-06-30 11:54:43 +00:00
|
|
|
|
'(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
|
|
|
|
|
\"fragile\" option.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Internal functions
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer--normalize-argument (argument type)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Return ARGUMENT string with proper boundaries.
|
|
|
|
|
|
|
|
|
|
TYPE is a symbol among the following:
|
|
|
|
|
`action' Return ARGUMENT within angular brackets.
|
|
|
|
|
`defaction' Return ARGUMENT within both square and angular brackets.
|
|
|
|
|
`option' Return ARGUMENT within square brackets."
|
2012-08-22 15:45:18 +00:00
|
|
|
|
(if (not (string-match "\\S-" argument)) ""
|
2016-05-26 13:56:16 +00:00
|
|
|
|
(cl-case type
|
2016-09-03 00:55:45 +00:00
|
|
|
|
(action (format "<%s>" (org-unbracket-string "<" ">" argument)))
|
|
|
|
|
(defaction
|
|
|
|
|
(format "[<%s>]"
|
|
|
|
|
(org-unbracket-string "<" ">" (org-unbracket-string "[" "]" argument))))
|
|
|
|
|
(option (format "[%s]" (org-unbracket-string "[" "]" argument)))
|
|
|
|
|
(otherwise (error "Invalid `type' argument to `org-beamer--normalize-argument': %s"
|
|
|
|
|
type)))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer--element-has-overlay-p (element)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Non-nil when ELEMENT has an overlay specified.
|
|
|
|
|
An element has an overlay specification when it starts with an
|
2013-01-27 22:11:34 +00:00
|
|
|
|
`beamer' export-snippet whose value is between angular brackets.
|
|
|
|
|
Return overlay specification, as a string, or nil."
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(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)))
|
2016-09-03 01:05:10 +00:00
|
|
|
|
(and (string-prefix-p "<" value) (string-suffix-p ">" value)
|
|
|
|
|
value)))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Define Back-End
|
|
|
|
|
|
2013-03-19 15:24:40 +00:00
|
|
|
|
(org-export-define-derived-backend 'beamer 'latex
|
org-export: Internal changes to back-end definition
* contrib/lisp/org-export.el (org-export-registered-backends): New
variable.
(org-export-define-backend, org-export-define-derived-backend): Use
new variable. Also redefine how sub-menus are defined.
(org-export-backend-filters, org-export-backend-menu,
org-export-backend-options, org-export-backend-translate-table): New
functions.
(org-export-get-environment, org-export--parse-option-keyword,
org-export--get-subtree-options, org-export--get-inbuffer-options,
org-export--get-global-options, org-export-install-filters,
org-export-with-backend): Access to data stored in new variable.
(org-export-dispatch-ui): Display sub-menus according to new
definition.
(org-export-dispatch-menu-entries): Removed variable.
* contrib/lisp/org-e-beamer.el: Use new sub-menu definition.
(org-e-beamer--format-section, org-e-beamer-item,
org-e-beamer-keyword): Use `org-export-with-backend' instead of
relying on removed variables.
* testing/lisp/test-org-export.el: Update tests.
This patch gets rid of "invisible" variables, that is variables
defvar'ed within a macro.
2012-11-12 22:21:05 +00:00
|
|
|
|
:menu-entry
|
2013-03-19 15:24:40 +00:00
|
|
|
|
'(?l 1
|
|
|
|
|
((?B "As LaTeX buffer (Beamer)" org-beamer-export-as-latex)
|
|
|
|
|
(?b "As LaTeX 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-beamer-export-to-pdf t s v b)
|
|
|
|
|
(org-open-file (org-beamer-export-to-pdf nil s v b)))))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
:options-alist
|
2014-06-15 08:26:40 +00:00
|
|
|
|
'((:headline-levels nil "H" org-beamer-frame-level)
|
|
|
|
|
(:latex-class "LATEX_CLASS" nil "beamer" t)
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 21:09:19 +00:00
|
|
|
|
(:beamer-subtitle-format nil nil org-beamer-subtitle-format)
|
2014-06-15 08:26:40 +00:00
|
|
|
|
(:beamer-column-view-format "COLUMNS" nil org-beamer-column-view-format)
|
|
|
|
|
(:beamer-theme "BEAMER_THEME" nil org-beamer-theme)
|
2013-03-19 15:24:40 +00:00
|
|
|
|
(: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)
|
2015-03-09 21:25:15 +00:00
|
|
|
|
(:beamer-header "BEAMER_HEADER" nil nil newline)
|
2014-05-21 07:06:59 +00:00
|
|
|
|
(:beamer-environments-extra nil nil org-beamer-environments-extra)
|
|
|
|
|
(:beamer-frame-default-options nil nil org-beamer-frame-default-options)
|
|
|
|
|
(:beamer-outline-frame-options nil nil org-beamer-outline-frame-options)
|
2014-06-15 08:26:40 +00:00
|
|
|
|
(:beamer-outline-frame-title nil nil org-beamer-outline-frame-title))
|
2013-03-19 15:24:40 +00:00
|
|
|
|
:translate-alist '((bold . org-beamer-bold)
|
2014-09-08 09:57:27 +00:00
|
|
|
|
(export-block . org-beamer-export-block)
|
2013-03-19 15:24:40 +00:00
|
|
|
|
(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)
|
|
|
|
|
(template . org-beamer-template)))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Transcode Functions
|
|
|
|
|
|
|
|
|
|
;;;; Bold
|
|
|
|
|
|
2015-10-29 17:39:29 +00:00
|
|
|
|
(defun org-beamer-bold (bold contents _info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"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}"
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(or (org-beamer--element-has-overlay-p bold) "")
|
2012-06-30 11:54:43 +00:00
|
|
|
|
contents))
|
|
|
|
|
|
|
|
|
|
|
2014-09-08 09:57:27 +00:00
|
|
|
|
;;;; Export Block
|
|
|
|
|
|
2015-10-29 17:54:31 +00:00
|
|
|
|
(defun org-beamer-export-block (export-block _contents _info)
|
2014-09-08 09:57:27 +00:00
|
|
|
|
"Transcode an EXPORT-BLOCK element into Beamer code.
|
|
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
|
|
channel."
|
|
|
|
|
(when (member (org-element-property :type export-block) '("BEAMER" "LATEX"))
|
|
|
|
|
(org-remove-indentation (org-element-property :value export-block))))
|
|
|
|
|
|
|
|
|
|
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;;;; Export Snippet
|
|
|
|
|
|
2015-10-29 17:39:29 +00:00
|
|
|
|
(defun org-beamer-export-snippet (export-snippet _contents info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"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)))
|
2013-01-27 22:11:34 +00:00
|
|
|
|
;; Only "latex" and "beamer" snippets are retained.
|
|
|
|
|
(cond ((eq backend 'latex) value)
|
|
|
|
|
;; Ignore "beamer" snippets specifying overlays.
|
|
|
|
|
((and (eq backend 'beamer)
|
2012-07-27 14:13:57 +00:00
|
|
|
|
(or (org-export-get-previous-element export-snippet info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(not (string-match "\\`<.*>\\'" value))))
|
|
|
|
|
value))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Headline
|
|
|
|
|
;;
|
2013-02-23 12:47:44 +00:00
|
|
|
|
;; The main function to translate a headline is
|
2013-01-27 22:11:34 +00:00
|
|
|
|
;; `org-beamer-headline'.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;;
|
2013-02-23 12:47:44 +00:00
|
|
|
|
;; Depending on the level at which a headline is considered as
|
2013-01-27 22:11:34 +00:00
|
|
|
|
;; 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').
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;;
|
2013-01-27 22:11:34 +00:00
|
|
|
|
;; `org-beamer-headline' also takes care of special environments
|
2012-09-04 09:07:56 +00:00
|
|
|
|
;; like "ignoreheading", "note", "noteNH", "appendix" and
|
|
|
|
|
;; "againframe".
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer--get-label (headline info)
|
2012-09-04 13:03:17 +00:00
|
|
|
|
"Return label for HEADLINE, as a string.
|
|
|
|
|
|
|
|
|
|
INFO is a plist used as a communication channel.
|
|
|
|
|
|
|
|
|
|
The value is either the label specified in \"BEAMER_opt\"
|
2015-10-16 20:53:22 +00:00
|
|
|
|
property, the custom ID, if there is one and
|
2019-09-19 02:32:25 +00:00
|
|
|
|
`:latex-prefer-user-labels' property has a non-nil value, or
|
2015-10-16 20:53:22 +00:00
|
|
|
|
a unique internal label. This function assumes HEADLINE will be
|
|
|
|
|
treated as a frame."
|
|
|
|
|
(cond
|
|
|
|
|
((let ((opt (org-element-property :BEAMER_OPT headline)))
|
|
|
|
|
(and (stringp opt)
|
|
|
|
|
(string-match "\\(?:^\\|,\\)label=\\(.*?\\)\\(?:$\\|,\\)" opt)
|
|
|
|
|
(let ((label (match-string 1 opt)))
|
|
|
|
|
(if (string-match-p "\\`{.*}\\'" label)
|
|
|
|
|
(substring label 1 -1)
|
|
|
|
|
label)))))
|
|
|
|
|
((and (plist-get info :latex-prefer-user-labels)
|
|
|
|
|
(org-element-property :CUSTOM_ID headline)))
|
|
|
|
|
(t (format "sec:%s" (org-export-get-reference headline info)))))
|
2012-09-04 13:03:17 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer--frame-level (headline info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Return frame level in subtree containing HEADLINE.
|
|
|
|
|
INFO is a plist used as a communication channel."
|
|
|
|
|
(or
|
|
|
|
|
;; 1. Look for "frame" environment in parents, starting from the
|
|
|
|
|
;; farthest.
|
|
|
|
|
(catch 'exit
|
2014-11-16 12:27:34 +00:00
|
|
|
|
(dolist (parent (nreverse (org-element-lineage headline)))
|
|
|
|
|
(let ((env (org-element-property :BEAMER_ENV parent)))
|
|
|
|
|
(when (and env (member-ignore-case env '("frame" "fullframe")))
|
|
|
|
|
(throw 'exit (org-export-get-relative-level parent info))))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;; 2. Look for "frame" environment in HEADLINE.
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
(let ((env (org-element-property :BEAMER_ENV headline)))
|
2013-04-20 06:32:10 +00:00
|
|
|
|
(and env (member-ignore-case env '("frame" "fullframe"))
|
2012-11-17 20:47:04 +00:00
|
|
|
|
(org-export-get-relative-level headline info)))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;; 3. Look for "frame" environment in sub-tree.
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(org-element-map headline 'headline
|
|
|
|
|
(lambda (hl)
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
(let ((env (org-element-property :BEAMER_ENV hl)))
|
2013-04-20 06:32:10 +00:00
|
|
|
|
(when (and env (member-ignore-case env '("frame" "fullframe")))
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(org-export-get-relative-level hl info))))
|
|
|
|
|
info 'first-match)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;; 4. No "frame" environment in tree: use default value.
|
|
|
|
|
(plist-get info :headline-levels)))
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer--format-section (headline contents info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Format HEADLINE as a sectioning part.
|
|
|
|
|
CONTENTS holds the contents of the headline. INFO is a plist
|
|
|
|
|
used as a communication channel."
|
2013-10-03 13:11:03 +00:00
|
|
|
|
(let ((latex-headline
|
2013-10-07 10:25:18 +00:00
|
|
|
|
(org-export-with-backend
|
2013-10-03 13:11:03 +00:00
|
|
|
|
;; We create a temporary export back-end which behaves the
|
|
|
|
|
;; same as current one, but adds "\protect" in front of the
|
|
|
|
|
;; output of some objects.
|
|
|
|
|
(org-export-create-backend
|
|
|
|
|
:parent 'latex
|
|
|
|
|
:transcoders
|
|
|
|
|
(let ((protected-output
|
2020-11-17 16:35:49 +00:00
|
|
|
|
(lambda (object contents info)
|
|
|
|
|
(let ((code (org-export-with-backend
|
|
|
|
|
'beamer object contents info)))
|
|
|
|
|
(if (org-string-nw-p code) (concat "\\protect" code)
|
|
|
|
|
code)))))
|
2021-03-30 14:19:06 +00:00
|
|
|
|
(mapcar (lambda (type) (cons type protected-output))
|
2013-10-07 10:25:18 +00:00
|
|
|
|
'(bold footnote-reference italic strike-through timestamp
|
|
|
|
|
underline))))
|
|
|
|
|
headline
|
|
|
|
|
contents
|
2013-10-03 13:11:03 +00:00
|
|
|
|
info))
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
(mode-specs (org-element-property :BEAMER_ACT headline)))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(if (and mode-specs
|
|
|
|
|
(string-match "\\`\\\\\\(.*?\\)\\(?:\\*\\|\\[.*\\]\\)?{"
|
|
|
|
|
latex-headline))
|
2013-10-03 13:11:03 +00:00
|
|
|
|
;; Insert overlay specifications.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(replace-match (concat (match-string 1 latex-headline)
|
|
|
|
|
(format "<%s>" mode-specs))
|
|
|
|
|
nil nil latex-headline 1)
|
|
|
|
|
latex-headline)))
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer--format-frame (headline contents info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Format HEADLINE as a frame.
|
|
|
|
|
CONTENTS holds the contents of the headline. INFO is a plist
|
|
|
|
|
used as a communication channel."
|
2012-08-12 16:24:34 +00:00
|
|
|
|
(let ((fragilep
|
|
|
|
|
;; FRAGILEP is non-nil when HEADLINE contains an element
|
2013-01-27 22:11:34 +00:00
|
|
|
|
;; among `org-beamer-verbatim-elements'.
|
|
|
|
|
(org-element-map headline org-beamer-verbatim-elements 'identity
|
2012-08-12 16:24:34 +00:00
|
|
|
|
info 'first-match)))
|
|
|
|
|
(concat "\\begin{frame}"
|
2012-09-04 06:23:29 +00:00
|
|
|
|
;; Overlay specification, if any. When surrounded by
|
|
|
|
|
;; square brackets, consider it as a default
|
|
|
|
|
;; specification.
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
(let ((action (org-element-property :BEAMER_ACT headline)))
|
2012-08-12 16:24:34 +00:00
|
|
|
|
(cond
|
|
|
|
|
((not action) "")
|
|
|
|
|
((string-match "\\`\\[.*\\]\\'" action )
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(org-beamer--normalize-argument action 'defaction))
|
|
|
|
|
(t (org-beamer--normalize-argument action 'action))))
|
2012-08-12 16:24:34 +00:00
|
|
|
|
;; Options, if any.
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
(let* ((beamer-opt (org-element-property :BEAMER_OPT headline))
|
2012-09-04 06:23:29 +00:00
|
|
|
|
(options
|
2017-08-10 18:31:07 +00:00
|
|
|
|
;; Collect nonempty options from default value and
|
2018-10-20 08:51:06 +00:00
|
|
|
|
;; headline's properties.
|
|
|
|
|
(cl-remove-if-not #'org-string-nw-p
|
2017-08-10 18:31:07 +00:00
|
|
|
|
(append
|
|
|
|
|
(org-split-string
|
|
|
|
|
(plist-get info :beamer-frame-default-options) ",")
|
|
|
|
|
(and beamer-opt
|
|
|
|
|
(org-split-string
|
|
|
|
|
;; Remove square brackets if user provided
|
|
|
|
|
;; them.
|
|
|
|
|
(and (string-match "^\\[?\\(.*\\)\\]?$" beamer-opt)
|
|
|
|
|
(match-string 1 beamer-opt))
|
2018-10-20 08:51:06 +00:00
|
|
|
|
",")))))
|
|
|
|
|
(fragile
|
|
|
|
|
;; Add "fragile" option if necessary.
|
|
|
|
|
(and fragilep
|
|
|
|
|
(not (member "fragile" options))
|
|
|
|
|
(list "fragile")))
|
|
|
|
|
(label
|
|
|
|
|
;; Provide an automatic label for the frame unless
|
|
|
|
|
;; the user specified one. Also refrain from
|
|
|
|
|
;; labeling `allowframebreaks' frames; this is not
|
|
|
|
|
;; allowed by Beamer.
|
|
|
|
|
(and (not (member "allowframebreaks" options))
|
|
|
|
|
(not (cl-some (lambda (s) (string-match-p "^label=" s))
|
|
|
|
|
options))
|
|
|
|
|
(list
|
|
|
|
|
(let ((label (org-beamer--get-label headline info)))
|
|
|
|
|
;; Labels containing colons need to be
|
|
|
|
|
;; wrapped within braces.
|
|
|
|
|
(format (if (string-match-p ":" label)
|
|
|
|
|
"label={%s}"
|
|
|
|
|
"label=%s")
|
|
|
|
|
label))))))
|
2012-08-12 16:24:34 +00:00
|
|
|
|
;; Change options list into a string.
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(org-beamer--normalize-argument
|
2018-10-20 08:51:06 +00:00
|
|
|
|
(mapconcat #'identity (append label fragile options) ",")
|
2012-08-12 16:24:34 +00:00
|
|
|
|
'option))
|
|
|
|
|
;; Title.
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
(let ((env (org-element-property :BEAMER_ENV headline)))
|
2012-11-17 20:47:04 +00:00
|
|
|
|
(format "{%s}"
|
|
|
|
|
(if (and env (equal (downcase env) "fullframe")) ""
|
|
|
|
|
(org-export-data
|
|
|
|
|
(org-element-property :title headline) info))))
|
2012-08-12 16:24:34 +00:00
|
|
|
|
"\n"
|
|
|
|
|
;; The following workaround is required in fragile frames
|
|
|
|
|
;; as Beamer will append "\par" to the beginning of the
|
|
|
|
|
;; contents. So we need to make sure the command is
|
|
|
|
|
;; separated from the contents by at least one space. If
|
|
|
|
|
;; it isn't, it will create "\parfirst-word" command and
|
|
|
|
|
;; remove the first word from the contents in the PDF
|
|
|
|
|
;; output.
|
|
|
|
|
(if (not fragilep) contents
|
2013-04-14 16:28:27 +00:00
|
|
|
|
(replace-regexp-in-string "\\`\n*" "\\& " (or contents "")))
|
2012-08-12 16:24:34 +00:00
|
|
|
|
"\\end{frame}")))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer--format-block (headline contents info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Format HEADLINE as a block.
|
|
|
|
|
CONTENTS holds the contents of the headline. INFO is a plist
|
|
|
|
|
used as a communication channel."
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
(let* ((column-width (org-element-property :BEAMER_COL headline))
|
2012-11-17 20:17:19 +00:00
|
|
|
|
;; ENVIRONMENT defaults to "block" if none is specified and
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;; there is no column specification. If there is a column
|
|
|
|
|
;; specified but still no explicit environment, ENVIRONMENT
|
2012-11-17 20:17:19 +00:00
|
|
|
|
;; is "column".
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
(environment (let ((env (org-element-property :BEAMER_ENV headline)))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(cond
|
|
|
|
|
;; "block" is the fallback environment.
|
|
|
|
|
((and (not env) (not column-width)) "block")
|
|
|
|
|
;; "column" only.
|
2012-11-17 20:17:19 +00:00
|
|
|
|
((not env) "column")
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;; Use specified environment.
|
2013-04-20 06:32:10 +00:00
|
|
|
|
(t env))))
|
2013-06-29 12:35:31 +00:00
|
|
|
|
(raw-title (org-element-property :raw-value headline))
|
2013-09-29 08:22:14 +00:00
|
|
|
|
(env-format
|
|
|
|
|
(cond ((member environment '("column" "columns")) nil)
|
|
|
|
|
((assoc environment
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(append (plist-get info :beamer-environments-extra)
|
2013-09-29 08:22:14 +00:00
|
|
|
|
org-beamer-environments-default)))
|
|
|
|
|
(t (user-error "Wrong block type at a headline named \"%s\""
|
|
|
|
|
raw-title))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(title (org-export-data (org-element-property :title headline) info))
|
2015-06-16 13:26:47 +00:00
|
|
|
|
(raw-options (org-element-property :BEAMER_OPT headline))
|
|
|
|
|
(options (if raw-options
|
|
|
|
|
(org-beamer--normalize-argument raw-options 'option)
|
|
|
|
|
""))
|
2012-11-17 20:17:19 +00:00
|
|
|
|
;; 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.
|
|
|
|
|
(parent-env (org-element-property
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
:BEAMER_ENV (org-export-get-parent-headline headline)))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(start-columns-p
|
2012-11-17 20:17:19 +00:00
|
|
|
|
(or (equal environment "columns")
|
|
|
|
|
(and column-width
|
|
|
|
|
(not (and parent-env
|
|
|
|
|
(equal (downcase parent-env) "columns")))
|
|
|
|
|
(or (org-export-first-sibling-p headline info)
|
|
|
|
|
(not (org-element-property
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
:BEAMER_COL
|
2012-11-17 20:17:19 +00:00
|
|
|
|
(org-export-get-previous-element
|
|
|
|
|
headline info)))))))
|
|
|
|
|
;; End the "columns" environment when explicitly requested or
|
|
|
|
|
;; when there is no next headline or the next headline do not
|
|
|
|
|
;; have a BEAMER_column property.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(end-columns-p
|
2012-11-17 20:17:19 +00:00
|
|
|
|
(or (equal environment "columns")
|
|
|
|
|
(and column-width
|
|
|
|
|
(not (and parent-env
|
|
|
|
|
(equal (downcase parent-env) "columns")))
|
|
|
|
|
(or (org-export-last-sibling-p headline info)
|
|
|
|
|
(not (org-element-property
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
:BEAMER_COL
|
2012-11-17 20:17:19 +00:00
|
|
|
|
(org-export-get-next-element headline info))))))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(concat
|
2012-11-17 20:17:19 +00:00
|
|
|
|
(when start-columns-p
|
|
|
|
|
;; Column can accept options only when the environment is
|
|
|
|
|
;; explicitly defined.
|
|
|
|
|
(if (not (equal environment "columns")) "\\begin{columns}\n"
|
|
|
|
|
(format "\\begin{columns}%s\n" options)))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(when column-width
|
|
|
|
|
(format "\\begin{column}%s{%s}\n"
|
|
|
|
|
;; One can specify placement for column only when
|
|
|
|
|
;; HEADLINE stands for a column on its own.
|
2012-11-17 20:17:19 +00:00
|
|
|
|
(if (equal environment "column") options "")
|
2014-08-29 07:47:46 +00:00
|
|
|
|
(format "%s\\columnwidth" column-width)))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;; Block's opening string.
|
2013-09-29 08:22:14 +00:00
|
|
|
|
(when (nth 2 env-format)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(concat
|
|
|
|
|
(org-fill-template
|
|
|
|
|
(nth 2 env-format)
|
|
|
|
|
(nconc
|
|
|
|
|
;; If BEAMER_act property has its value enclosed in square
|
|
|
|
|
;; brackets, it is a default overlay specification and
|
|
|
|
|
;; overlay specification is empty. Otherwise, it is an
|
|
|
|
|
;; overlay specification and the default one is nil.
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
(let ((action (org-element-property :BEAMER_ACT headline)))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(cond
|
2015-06-16 13:26:47 +00:00
|
|
|
|
((not action) (list (cons "a" "") (cons "A" "") (cons "R" "")))
|
2016-09-03 01:05:10 +00:00
|
|
|
|
((and (string-prefix-p "[" action)
|
|
|
|
|
(string-suffix-p "]" action))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(list
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(cons "A" (org-beamer--normalize-argument action 'defaction))
|
2015-06-16 13:26:47 +00:00
|
|
|
|
(cons "a" "")
|
|
|
|
|
(cons "R" action)))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(t
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(list (cons "a" (org-beamer--normalize-argument action 'action))
|
2015-06-16 13:26:47 +00:00
|
|
|
|
(cons "A" "")
|
|
|
|
|
(cons "R" action)))))
|
2012-11-17 20:17:19 +00:00
|
|
|
|
(list (cons "o" options)
|
2015-06-16 13:26:47 +00:00
|
|
|
|
(cons "O" (or raw-options ""))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(cons "h" title)
|
2013-06-29 12:35:31 +00:00
|
|
|
|
(cons "r" raw-title)
|
|
|
|
|
(cons "H" (if (equal raw-title "") ""
|
|
|
|
|
(format "{%s}" raw-title)))
|
|
|
|
|
(cons "U" (if (equal raw-title "") ""
|
|
|
|
|
(format "[%s]" raw-title))))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"\n"))
|
|
|
|
|
contents
|
2013-09-29 08:22:14 +00:00
|
|
|
|
;; Block's closing string, if any.
|
|
|
|
|
(and (nth 3 env-format) (concat (nth 3 env-format) "\n"))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(when column-width "\\end{column}\n")
|
|
|
|
|
(when end-columns-p "\\end{columns}"))))
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-headline (headline contents info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"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))
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(frame-level (org-beamer--frame-level headline info))
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
(environment (let ((env (org-element-property :BEAMER_ENV headline)))
|
2013-04-20 06:32:10 +00:00
|
|
|
|
(or (org-string-nw-p env) "block"))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(cond
|
2012-09-04 09:07:56 +00:00
|
|
|
|
;; Case 1: Resume frame specified by "BEAMER_ref" property.
|
|
|
|
|
((equal environment "againframe")
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
(let ((ref (org-element-property :BEAMER_REF headline)))
|
2012-09-04 13:03:17 +00:00
|
|
|
|
;; Reference to frame being resumed is mandatory. Ignore
|
|
|
|
|
;; the whole headline if it isn't provided.
|
|
|
|
|
(when (org-string-nw-p ref)
|
|
|
|
|
(concat "\\againframe"
|
|
|
|
|
;; Overlay specification.
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
(let ((overlay (org-element-property :BEAMER_ACT headline)))
|
2012-09-04 13:03:17 +00:00
|
|
|
|
(when overlay
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(org-beamer--normalize-argument
|
2012-09-04 13:03:17 +00:00
|
|
|
|
overlay
|
2015-10-13 21:51:17 +00:00
|
|
|
|
(if (string-match "\\`\\[.*\\]\\'" overlay) 'defaction
|
2012-09-04 13:03:17 +00:00
|
|
|
|
'action))))
|
|
|
|
|
;; Options.
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
(let ((options (org-element-property :BEAMER_OPT headline)))
|
2012-09-04 13:03:17 +00:00
|
|
|
|
(when options
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(org-beamer--normalize-argument options 'option)))
|
2012-09-04 13:03:17 +00:00
|
|
|
|
;; Resolve reference provided by "BEAMER_ref"
|
2015-10-13 21:51:17 +00:00
|
|
|
|
;; property. This is done by building a minimal
|
|
|
|
|
;; fake link and calling the appropriate resolve
|
|
|
|
|
;; function, depending on the reference syntax.
|
|
|
|
|
(let ((target
|
|
|
|
|
(if (string-match "\\`\\(id:\\|#\\)" ref)
|
|
|
|
|
(org-export-resolve-id-link
|
|
|
|
|
`(link (:path ,(substring ref (match-end 0))))
|
|
|
|
|
info)
|
|
|
|
|
(org-export-resolve-fuzzy-link
|
|
|
|
|
`(link (:path
|
|
|
|
|
;; Look for headlines only.
|
|
|
|
|
,(if (eq (string-to-char ref) ?*) ref
|
|
|
|
|
(concat "*" ref))))
|
|
|
|
|
info))))
|
2012-09-04 13:03:17 +00:00
|
|
|
|
;; Now use user-defined label provided in TARGET
|
|
|
|
|
;; headline, or fallback to standard one.
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(format "{%s}" (org-beamer--get-label target info)))))))
|
2012-09-04 09:07:56 +00:00
|
|
|
|
;; Case 2: Creation of an appendix is requested.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
((equal environment "appendix")
|
|
|
|
|
(concat "\\appendix"
|
export-back-ends: Apply changes from b692064e621acbc93876670585f8a4b0fd6a7ffa
* lisp/ox-beamer.el (org-beamer--get-label, org-beamer--frame-level,
org-beamer--format-section, org-beamer--format-frame,
org-beamer--format-block, org-beamer-headline): Apply changes to
properties.
* lisp/ox-html.el (org-html-headline, org-html-link,
org-html-section): Apply changes to properties.
* lisp/ox-icalendar.el (org-icalendar-create-uid,
org-icalendar-blocked-headline-p, org-icalendar-entry,
org-icalendar--valarm): Apply changes to properties.
* lisp/ox-odt.el (org-odt-headline): Apply changes
* lisp/ox-publish.el (org-publish-collect-index): Apply changes to
properties.
* lisp/ox-texinfo.el (org-texinfo--generate-menu-list,
org-texinfo--generate-menu-items, org-texinfo-template,
org-texinfo-headline, org-texinfo-link): Apply changes to
properties.
* lisp/ox.el (org-export-resolve-id-link, org-export-get-category):
Apply changes to properties.
(org-export-get-node-property): Update docstring.
* testing/lisp/test-ox.el: Update tests.
2013-02-17 23:01:21 +00:00
|
|
|
|
(org-element-property :BEAMER_ACT headline)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"\n"
|
|
|
|
|
(make-string (org-element-property :pre-blank headline) ?\n)
|
|
|
|
|
contents))
|
2012-09-04 09:07:56 +00:00
|
|
|
|
;; Case 3: Ignore heading.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
((equal environment "ignoreheading")
|
|
|
|
|
(concat (make-string (org-element-property :pre-blank headline) ?\n)
|
|
|
|
|
contents))
|
2012-09-04 09:07:56 +00:00
|
|
|
|
;; Case 4: HEADLINE is a note.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
((member environment '("note" "noteNH"))
|
2019-01-21 18:01:13 +00:00
|
|
|
|
(concat "\\note"
|
|
|
|
|
;; Overlay specification.
|
|
|
|
|
(let ((overlay (org-element-property :BEAMER_ACT headline)))
|
|
|
|
|
(when overlay
|
|
|
|
|
(org-beamer--normalize-argument
|
|
|
|
|
overlay
|
|
|
|
|
(if (string-match "\\`\\[.*\\]\\'" overlay)
|
|
|
|
|
'defaction 'action))))
|
|
|
|
|
(format "{%s}"
|
|
|
|
|
(concat (and (equal environment "note")
|
|
|
|
|
(concat
|
|
|
|
|
(org-export-data
|
|
|
|
|
(org-element-property :title headline)
|
|
|
|
|
info)
|
|
|
|
|
"\n"))
|
|
|
|
|
(org-trim contents)))))
|
2012-09-04 09:07:56 +00:00
|
|
|
|
;; Case 5: HEADLINE is a frame.
|
2012-09-04 13:03:17 +00:00
|
|
|
|
((= level frame-level)
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(org-beamer--format-frame headline contents info))
|
2012-09-04 09:07:56 +00:00
|
|
|
|
;; Case 6: Regular section, extracted from
|
2013-01-27 22:11:34 +00:00
|
|
|
|
;; `org-latex-classes'.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
((< level frame-level)
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(org-beamer--format-section headline contents info))
|
2012-09-04 09:07:56 +00:00
|
|
|
|
;; Case 7: Otherwise, HEADLINE is a block.
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(t (org-beamer--format-block headline contents info))))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Item
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-item (item contents info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Transcode an ITEM element into Beamer code.
|
|
|
|
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2015-03-24 08:15:47 +00:00
|
|
|
|
(org-export-with-backend
|
|
|
|
|
;; Delegate item export to `latex'. However, we use `beamer'
|
|
|
|
|
;; transcoders for objects in the description tag.
|
|
|
|
|
(org-export-create-backend
|
|
|
|
|
:parent 'beamer
|
|
|
|
|
:transcoders
|
|
|
|
|
(list
|
|
|
|
|
(cons
|
|
|
|
|
'item
|
2015-10-29 17:39:29 +00:00
|
|
|
|
(lambda (item _c _i)
|
2015-03-24 08:15:47 +00:00
|
|
|
|
(let ((action
|
|
|
|
|
(let ((first (car (org-element-contents item))))
|
|
|
|
|
(and (eq (org-element-type first) 'paragraph)
|
|
|
|
|
(org-beamer--element-has-overlay-p first))))
|
|
|
|
|
(output (org-latex-item item contents info)))
|
|
|
|
|
(if (not (and action (string-match "\\\\item" output))) output
|
|
|
|
|
;; If the item starts with a paragraph and that paragraph
|
|
|
|
|
;; starts with an export snippet specifying an overlay,
|
|
|
|
|
;; append it to the \item command.
|
|
|
|
|
(replace-match (concat "\\\\item" action) nil nil output)))))))
|
|
|
|
|
item contents info))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Keyword
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-keyword (keyword contents info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"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.
|
2013-01-27 22:11:34 +00:00
|
|
|
|
;; Otherwise, fallback to `latex' back-end.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(cond
|
|
|
|
|
((equal key "BEAMER") value)
|
|
|
|
|
((and (equal key "TOC") (string-match "\\<headlines\\>" value))
|
|
|
|
|
(let ((depth (or (and (string-match "[0-9]+" value)
|
|
|
|
|
(string-to-number (match-string 0 value)))
|
|
|
|
|
(plist-get info :with-toc)))
|
|
|
|
|
(options (and (string-match "\\[.*?\\]" value)
|
|
|
|
|
(match-string 0 value))))
|
|
|
|
|
(concat
|
|
|
|
|
(when (wholenump depth) (format "\\setcounter{tocdepth}{%s}\n" depth))
|
2013-03-06 12:33:51 +00:00
|
|
|
|
"\\tableofcontents" options)))
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(t (org-export-with-backend 'latex keyword contents info)))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Link
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-link (link contents info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Transcode a LINK object into Beamer code.
|
|
|
|
|
CONTENTS is the description part of the link. INFO is a plist
|
|
|
|
|
used as a communication channel."
|
2020-02-14 09:00:15 +00:00
|
|
|
|
(or (org-export-custom-protocol-maybe link contents 'beamer info)
|
2016-12-13 08:06:48 +00:00
|
|
|
|
;; Fall-back to LaTeX export. However, prefer "\hyperlink" over
|
|
|
|
|
;; "\hyperref" since the former handles overlay specifications.
|
|
|
|
|
(let ((latex-link (org-export-with-backend 'latex link contents info)))
|
|
|
|
|
(if (string-match "\\`\\\\hyperref\\[\\(.*?\\)\\]" latex-link)
|
|
|
|
|
(replace-match
|
|
|
|
|
(format "\\\\hyperlink%s{\\1}"
|
|
|
|
|
(or (org-beamer--element-has-overlay-p link) ""))
|
|
|
|
|
nil nil latex-link)
|
2016-12-12 20:01:02 +00:00
|
|
|
|
latex-link))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Plain List
|
|
|
|
|
;;
|
2012-11-27 20:04:05 +00:00
|
|
|
|
;; Plain lists support `:environment', `:overlay' and `:options'
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;; attributes.
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-plain-list (plain-list contents info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Transcode a PLAIN-LIST element into Beamer code.
|
|
|
|
|
CONTENTS is the contents of the list. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
(let* ((type (org-element-property :type plain-list))
|
2013-02-13 13:30:02 +00:00
|
|
|
|
(attributes (org-combine-plists
|
|
|
|
|
(org-export-read-attribute :attr_latex plain-list)
|
|
|
|
|
(org-export-read-attribute :attr_beamer plain-list)))
|
2012-11-27 20:04:05 +00:00
|
|
|
|
(latex-type (let ((env (plist-get attributes :environment)))
|
2013-03-08 23:58:31 +00:00
|
|
|
|
(cond (env)
|
2012-11-27 20:04:05 +00:00
|
|
|
|
((eq type 'ordered) "enumerate")
|
|
|
|
|
((eq type 'descriptive) "description")
|
|
|
|
|
(t "itemize")))))
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(org-latex--wrap-label
|
2012-06-30 11:54:43 +00:00
|
|
|
|
plain-list
|
|
|
|
|
(format "\\begin{%s}%s%s\n%s\\end{%s}"
|
|
|
|
|
latex-type
|
|
|
|
|
;; Default overlay specification, if any.
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(org-beamer--normalize-argument
|
2013-03-08 23:58:31 +00:00
|
|
|
|
(or (plist-get attributes :overlay) "")
|
2012-11-27 20:04:05 +00:00
|
|
|
|
'defaction)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;; Second optional argument depends on the list type.
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(org-beamer--normalize-argument
|
2013-03-08 23:58:31 +00:00
|
|
|
|
(or (plist-get attributes :options) "")
|
2012-11-27 20:04:05 +00:00
|
|
|
|
'option)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;; Eventually insert contents and close environment.
|
|
|
|
|
contents
|
2015-04-13 09:24:42 +00:00
|
|
|
|
latex-type)
|
|
|
|
|
info)))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Radio Target
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-radio-target (radio-target text info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"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}"
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(or (org-beamer--element-has-overlay-p radio-target) "")
|
2015-04-13 09:24:42 +00:00
|
|
|
|
(org-export-get-reference radio-target info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
text))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Template
|
|
|
|
|
;;
|
2013-01-27 22:11:34 +00:00
|
|
|
|
;; Template used is similar to the one used in `latex' back-end,
|
2012-06-30 11:54:43 +00:00
|
|
|
|
;; excepted for the table of contents and Beamer themes.
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-template (contents info)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Return complete document string after Beamer conversion.
|
|
|
|
|
CONTENTS is the transcoded contents string. INFO is a plist
|
|
|
|
|
holding export options."
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 21:09:19 +00:00
|
|
|
|
(let ((title (org-export-data (plist-get info :title) info))
|
2015-04-09 08:04:29 +00:00
|
|
|
|
(subtitle (org-export-data (plist-get info :subtitle) info)))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(concat
|
2015-10-03 13:43:05 +00:00
|
|
|
|
;; Time-stamp.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(and (plist-get info :time-stamp-file)
|
|
|
|
|
(format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
|
2015-10-03 13:43:05 +00:00
|
|
|
|
;; LaTeX compiler
|
2015-10-03 18:14:23 +00:00
|
|
|
|
(org-latex--insert-compiler info)
|
|
|
|
|
;; Document class and packages.
|
2017-01-21 10:31:25 +00:00
|
|
|
|
(org-latex-make-preamble info)
|
2015-10-03 18:14:23 +00:00
|
|
|
|
;; Insert themes.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(let ((format-theme
|
2020-11-17 16:35:49 +00:00
|
|
|
|
(lambda (prop command)
|
|
|
|
|
(let ((theme (plist-get info prop)))
|
|
|
|
|
(when theme
|
|
|
|
|
(concat command
|
|
|
|
|
(if (not (string-match "\\[.*\\]" theme))
|
|
|
|
|
(format "{%s}\n" theme)
|
|
|
|
|
(format "%s{%s}\n"
|
|
|
|
|
(match-string 0 theme)
|
|
|
|
|
(org-trim
|
|
|
|
|
(replace-match "" nil nil theme))))))))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(mapconcat (lambda (args) (apply format-theme args))
|
|
|
|
|
'((:beamer-theme "\\usetheme")
|
|
|
|
|
(:beamer-color-theme "\\usecolortheme")
|
|
|
|
|
(:beamer-font-theme "\\usefonttheme")
|
|
|
|
|
(:beamer-inner-theme "\\useinnertheme")
|
|
|
|
|
(:beamer-outer-theme "\\useoutertheme"))
|
|
|
|
|
""))
|
2015-10-03 13:43:05 +00:00
|
|
|
|
;; Possibly limit depth for headline numbering.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(let ((sec-num (plist-get info :section-numbers)))
|
|
|
|
|
(when (integerp sec-num)
|
|
|
|
|
(format "\\setcounter{secnumdepth}{%d}\n" sec-num)))
|
2015-10-03 13:43:05 +00:00
|
|
|
|
;; Author.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(let ((author (and (plist-get info :with-author)
|
|
|
|
|
(let ((auth (plist-get info :author)))
|
|
|
|
|
(and auth (org-export-data auth info)))))
|
|
|
|
|
(email (and (plist-get info :with-email)
|
|
|
|
|
(org-export-data (plist-get info :email) info))))
|
|
|
|
|
(cond ((and author email (not (string= "" email)))
|
|
|
|
|
(format "\\author{%s\\thanks{%s}}\n" author email))
|
2014-08-21 22:09:04 +00:00
|
|
|
|
((or author email) (format "\\author{%s}\n" (or author email)))))
|
2015-10-03 13:43:05 +00:00
|
|
|
|
;; Date.
|
2013-04-02 21:59:00 +00:00
|
|
|
|
(let ((date (and (plist-get info :with-date) (org-export-get-date info))))
|
|
|
|
|
(format "\\date{%s}\n" (org-export-data date info)))
|
2015-10-03 13:43:05 +00:00
|
|
|
|
;; Title
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(format "\\title{%s}\n" title)
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 21:09:19 +00:00
|
|
|
|
(when (org-string-nw-p subtitle)
|
|
|
|
|
(concat (format (plist-get info :beamer-subtitle-format) subtitle) "\n"))
|
2015-10-03 13:43:05 +00:00
|
|
|
|
;; Beamer-header
|
2015-03-09 21:25:15 +00:00
|
|
|
|
(let ((beamer-header (plist-get info :beamer-header)))
|
|
|
|
|
(when beamer-header
|
|
|
|
|
(format "%s\n" (plist-get info :beamer-header))))
|
|
|
|
|
;; 9. Hyperref options.
|
2015-03-13 20:55:21 +00:00
|
|
|
|
(let ((template (plist-get info :latex-hyperref-template)))
|
|
|
|
|
(and (stringp template)
|
|
|
|
|
(format-spec template (org-latex--format-spec info))))
|
2015-10-03 13:43:05 +00:00
|
|
|
|
;; Document start.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"\\begin{document}\n\n"
|
2015-10-03 13:43:05 +00:00
|
|
|
|
;; Title command.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(org-element-normalize-string
|
ox: Optional export of title
* ox.el (org-export-with-title): New variable.
* ox (org-export-options-alist),
ox-ascii.el (org-ascii-template--document-title),
ox-beamer.el (org-beamer-template), ox-html.el (org-html-template),
ox-latex.el (org-latex-template), ox-man.el (org-man-template),
ox-odt.el (org-odt-template), ox-org.el (org-org-template),
ox-publish.el (org-publish-project-alist),
ox-texinfo.el (org-texinfo-template),
ox-groff.el (org-groff--mt-head): Use new variable.
* ox-koma-letter.el (org-koma-letter-use-title): Mark obsolete.
* test-ox.el (test-org-export/parse-option-keyword): Add :with-title.
* ORG-NEWS, org.texi: Mention org-export-with-title.
This is useful in e.g. ox-html where title can be set via
`org-html-preamble-template' or when using the {{{title}}}-macro.
2015-02-10 23:09:39 +00:00
|
|
|
|
(cond ((not (plist-get info :with-title)) nil)
|
|
|
|
|
((string= "" title) nil)
|
2013-01-27 22:11:34 +00:00
|
|
|
|
((not (stringp org-latex-title-command)) nil)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
((string-match "\\(?:[^%]\\|^\\)%s"
|
2013-01-27 22:11:34 +00:00
|
|
|
|
org-latex-title-command)
|
|
|
|
|
(format org-latex-title-command title))
|
|
|
|
|
(t org-latex-title-command)))
|
2015-10-03 13:43:05 +00:00
|
|
|
|
;; Table of contents.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(let ((depth (plist-get info :with-toc)))
|
|
|
|
|
(when depth
|
|
|
|
|
(concat
|
|
|
|
|
(format "\\begin{frame}%s{%s}\n"
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(org-beamer--normalize-argument
|
Use options instead of hard-coded variables
* lisp/ox-beamer.el (org-beamer--format-frame,
org-beamer--format-block, org-beamer-template): Use options instead
of hard-coded variables.
* lisp/ox-man.el (org-man-inline-src-block, org-man-src-block,
org-man-table, org-man-table-cell): Use options instead of
hard-coded variables.
* lisp/ox-md.el (org-md-headline): Use options instead of hard-coded
variables.
* lisp/ox-texinfo.el (org-texinfo-format-headline-function,
org-texinfo-format-inlinetask-function): Change default value.
(org-texinfo--text-markup, org-texinfo--format-menu): Change signature
(org-texinfo--build-menu, org-texinfo-bold, org-texinfo-code,
org-texinfo-comment, org-texinfo-italic, org-texinfo-verbatim): Apply
signature change.
(org-texinfo-template, org-texinfo-clock, org-texinfo-drawer,
org-texinfo-link, org-texinfo-plain-list, org-texinfo-planning,
org-texinfo-table, org-texinfo-table-cell, org-texinfo-timestamp): Use
options instead of variable names.
(org-texinfo-format-headline-default-function,
org-texinfo-format-inlinetask-default-function): New functions.
(org-texinfo-headline, org-texinfo-inlinetask): Use new functions.
2014-07-28 13:44:56 +00:00
|
|
|
|
(plist-get info :beamer-outline-frame-options) 'option)
|
|
|
|
|
(plist-get info :beamer-outline-frame-title))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(when (wholenump depth)
|
|
|
|
|
(format "\\setcounter{tocdepth}{%d}\n" depth))
|
|
|
|
|
"\\tableofcontents\n"
|
|
|
|
|
"\\end{frame}\n\n")))
|
2015-10-03 13:43:05 +00:00
|
|
|
|
;; Document's body.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
contents
|
2015-10-03 13:43:05 +00:00
|
|
|
|
;; Creator.
|
2015-03-17 14:40:52 +00:00
|
|
|
|
(if (plist-get info :with-creator)
|
|
|
|
|
(concat (plist-get info :creator) "\n")
|
|
|
|
|
"")
|
2015-10-03 13:43:05 +00:00
|
|
|
|
;; Document end.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"\\end{document}")))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Minor Mode
|
|
|
|
|
|
|
|
|
|
|
2021-04-12 03:47:14 +00:00
|
|
|
|
(defvar org-beamer-mode-map
|
|
|
|
|
(let ((map (make-sparse-keymap)))
|
|
|
|
|
(define-key map "\C-c\C-b" 'org-beamer-select-environment)
|
|
|
|
|
map)
|
2013-01-27 22:11:34 +00:00
|
|
|
|
"The keymap for `org-beamer-mode'.")
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(define-minor-mode org-beamer-mode
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Support for editing Beamer oriented Org mode files."
|
2021-04-12 03:47:14 +00:00
|
|
|
|
:lighter " Bm")
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
(when (fboundp 'font-lock-add-keywords)
|
|
|
|
|
(font-lock-add-keywords
|
|
|
|
|
'org-mode
|
2013-01-27 22:11:34 +00:00
|
|
|
|
'((":\\(B_[a-z]+\\|BMCOL\\):" 1 'org-beamer-tag prepend))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
'prepend))
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defface org-beamer-tag '((t (:box (:line-width 1 :color grey40))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"The special face for beamer tags."
|
2013-01-27 22:11:34 +00:00
|
|
|
|
:group 'org-export-beamer)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-property-changed (property value)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Track the BEAMER_env property with tags.
|
|
|
|
|
PROPERTY is the name of the modified property. VALUE is its new
|
|
|
|
|
value."
|
|
|
|
|
(cond
|
|
|
|
|
((equal property "BEAMER_env")
|
|
|
|
|
(save-excursion
|
|
|
|
|
(org-back-to-heading t)
|
2012-09-09 12:56:17 +00:00
|
|
|
|
;; Filter out Beamer-related tags and install environment tag.
|
2015-11-06 12:04:20 +00:00
|
|
|
|
(let ((tags (cl-remove-if (lambda (x) (string-match "^B_" x))
|
2018-04-18 15:28:52 +00:00
|
|
|
|
(org-get-tags nil t)))
|
2012-09-09 12:56:17 +00:00
|
|
|
|
(env-tag (and (org-string-nw-p value) (concat "B_" value))))
|
2018-04-20 08:45:19 +00:00
|
|
|
|
(org-set-tags (if env-tag (cons env-tag tags) tags))
|
2012-09-09 12:56:17 +00:00
|
|
|
|
(when env-tag (org-toggle-tag env-tag 'on)))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
((equal property "BEAMER_col")
|
|
|
|
|
(org-toggle-tag "BMCOL" (if (org-string-nw-p value) 'on 'off)))))
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(add-hook 'org-property-changed-functions 'org-beamer-property-changed)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-allowed-property-values (property)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"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
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(mapcar 'car (append org-beamer-environments-special
|
|
|
|
|
org-beamer-environments-extra
|
|
|
|
|
org-beamer-environments-default)))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
((and (equal property "BEAMER_col")
|
|
|
|
|
(not (org-entry-get nil (concat property "_ALL") 'inherit)))
|
2017-09-07 12:34:25 +00:00
|
|
|
|
;; If no allowed values for BEAMER_col have been defined, supply
|
|
|
|
|
;; some.
|
|
|
|
|
(split-string org-beamer-column-widths " "))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
(add-hook 'org-property-allowed-value-functions
|
2013-01-27 22:11:34 +00:00
|
|
|
|
'org-beamer-allowed-property-values)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Commands
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-export-as-latex
|
2012-12-02 16:24:19 +00:00
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2012-07-20 11:14:05 +00:00
|
|
|
|
"Export current buffer as a Beamer buffer.
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
2012-12-02 16:24:19 +00:00
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
|
asynchronously. The resulting buffer should be accessible
|
|
|
|
|
through the `org-export-stack' interface.
|
|
|
|
|
|
2012-06-30 11:54:43 +00:00
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
|
first.
|
|
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
|
contents of hidden elements.
|
|
|
|
|
|
|
|
|
|
When optional argument BODY-ONLY is non-nil, only write code
|
|
|
|
|
between \"\\begin{document}\" and \"\\end{document}\".
|
|
|
|
|
|
|
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
|
file-local settings.
|
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
Export is done in a buffer named \"*Org BEAMER Export*\", which
|
2012-07-20 11:11:44 +00:00
|
|
|
|
will be displayed when `org-export-show-temporary-export-buffer'
|
|
|
|
|
is non-nil."
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(interactive)
|
Export back-ends: Apply changes to export functions
* contrib/lisp/ox-confluence.el (org-confluence-export-as-confluence):
* contrib/lisp/ox-deck.el (org-deck-export-as-html,
org-deck-export-to-html):
* contrib/lisp/ox-freemind.el (org-freemind-export-to-freemind):
* contrib/lisp/ox-groff.el (org-groff-export-to-groff,
org-groff-export-to-pdf):
* contrib/lisp/ox-koma-letter.el (org-koma-letter-export-as-latex,
org-koma-letter-export-to-latex, org-koma-letter-export-to-pdf):
* contrib/lisp/ox-rss.el (org-rss-export-as-rss,
org-rss-export-to-rss):
* contrib/lisp/ox-s5.el (org-s5-export-as-html,
org-s5-export-to-html):
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-export):
* lisp/ob-haskell.el:
* lisp/ox-ascii.el (org-ascii-export-as-ascii,
org-ascii-export-to-ascii):
* lisp/ox-beamer.el (org-beamer-export-as-latex,
org-beamer-export-to-latex, org-beamer-export-to-pdf):
* lisp/ox-html.el (org-html-export-as-html, org-html-export-to-html):
* lisp/ox-icalendar.el (org-icalendar-export-to-ics):
* lisp/ox-latex.el (org-latex-export-as-latex,
org-latex-export-to-pdf):
* lisp/ox-man.el (org-man-export-to-man, org-man-export-to-pdf):
* lisp/ox-md.el (org-md-export-as-markdown,
org-md-export-to-markdown):
* lisp/ox-odt.el (org-odt-export-to-odt):
* lisp/ox-org.el (org-org-export-as-org, org-org-export-to-org):
* lisp/ox-publish.el (org-publish-org-to):
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo,
org-texinfo-export-to-info):
* testing/lisp/test-ob-exp.el (test-ob-exp/org-babel-exp-src-blocks/w-no-file):
2013-08-07 08:35:42 +00:00
|
|
|
|
(org-export-to-buffer 'beamer "*Org BEAMER Export*"
|
|
|
|
|
async subtreep visible-only body-only ext-plist (lambda () (LaTeX-mode))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-export-to-latex
|
2012-12-02 16:24:19 +00:00
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"Export current buffer as a Beamer presentation (tex).
|
|
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
2012-12-02 16:24:19 +00:00
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
|
asynchronously. The resulting file should be accessible through
|
|
|
|
|
the `org-export-stack' interface.
|
|
|
|
|
|
2012-06-30 11:54:43 +00:00
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
|
first.
|
|
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
|
contents of hidden elements.
|
|
|
|
|
|
|
|
|
|
When optional argument BODY-ONLY is non-nil, only write code
|
|
|
|
|
between \"\\begin{document}\" and \"\\end{document}\".
|
|
|
|
|
|
|
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
|
file-local settings.
|
|
|
|
|
|
|
|
|
|
Return output file's name."
|
|
|
|
|
(interactive)
|
Export back-ends: Apply changes to export functions
* contrib/lisp/ox-confluence.el (org-confluence-export-as-confluence):
* contrib/lisp/ox-deck.el (org-deck-export-as-html,
org-deck-export-to-html):
* contrib/lisp/ox-freemind.el (org-freemind-export-to-freemind):
* contrib/lisp/ox-groff.el (org-groff-export-to-groff,
org-groff-export-to-pdf):
* contrib/lisp/ox-koma-letter.el (org-koma-letter-export-as-latex,
org-koma-letter-export-to-latex, org-koma-letter-export-to-pdf):
* contrib/lisp/ox-rss.el (org-rss-export-as-rss,
org-rss-export-to-rss):
* contrib/lisp/ox-s5.el (org-s5-export-as-html,
org-s5-export-to-html):
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-export):
* lisp/ob-haskell.el:
* lisp/ox-ascii.el (org-ascii-export-as-ascii,
org-ascii-export-to-ascii):
* lisp/ox-beamer.el (org-beamer-export-as-latex,
org-beamer-export-to-latex, org-beamer-export-to-pdf):
* lisp/ox-html.el (org-html-export-as-html, org-html-export-to-html):
* lisp/ox-icalendar.el (org-icalendar-export-to-ics):
* lisp/ox-latex.el (org-latex-export-as-latex,
org-latex-export-to-pdf):
* lisp/ox-man.el (org-man-export-to-man, org-man-export-to-pdf):
* lisp/ox-md.el (org-md-export-as-markdown,
org-md-export-to-markdown):
* lisp/ox-odt.el (org-odt-export-to-odt):
* lisp/ox-org.el (org-org-export-as-org, org-org-export-to-org):
* lisp/ox-publish.el (org-publish-org-to):
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo,
org-texinfo-export-to-info):
* testing/lisp/test-ob-exp.el (test-ob-exp/org-babel-exp-src-blocks/w-no-file):
2013-08-07 08:35:42 +00:00
|
|
|
|
(let ((file (org-export-output-file-name ".tex" subtreep)))
|
|
|
|
|
(org-export-to-file 'beamer file
|
|
|
|
|
async subtreep visible-only body-only ext-plist)))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-export-to-pdf
|
2012-12-02 16:24:19 +00:00
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2012-07-23 07:51:55 +00:00
|
|
|
|
"Export current buffer as a Beamer presentation (PDF).
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
2012-12-02 16:24:19 +00:00
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
|
asynchronously. The resulting file should be accessible through
|
|
|
|
|
the `org-export-stack' interface.
|
|
|
|
|
|
2012-06-30 11:54:43 +00:00
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
|
first.
|
|
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
|
contents of hidden elements.
|
|
|
|
|
|
|
|
|
|
When optional argument BODY-ONLY is non-nil, only write code
|
|
|
|
|
between \"\\begin{document}\" and \"\\end{document}\".
|
|
|
|
|
|
|
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
|
file-local settings.
|
|
|
|
|
|
|
|
|
|
Return PDF file's name."
|
|
|
|
|
(interactive)
|
Export back-ends: Apply changes to export functions
* contrib/lisp/ox-confluence.el (org-confluence-export-as-confluence):
* contrib/lisp/ox-deck.el (org-deck-export-as-html,
org-deck-export-to-html):
* contrib/lisp/ox-freemind.el (org-freemind-export-to-freemind):
* contrib/lisp/ox-groff.el (org-groff-export-to-groff,
org-groff-export-to-pdf):
* contrib/lisp/ox-koma-letter.el (org-koma-letter-export-as-latex,
org-koma-letter-export-to-latex, org-koma-letter-export-to-pdf):
* contrib/lisp/ox-rss.el (org-rss-export-as-rss,
org-rss-export-to-rss):
* contrib/lisp/ox-s5.el (org-s5-export-as-html,
org-s5-export-to-html):
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-export):
* lisp/ob-haskell.el:
* lisp/ox-ascii.el (org-ascii-export-as-ascii,
org-ascii-export-to-ascii):
* lisp/ox-beamer.el (org-beamer-export-as-latex,
org-beamer-export-to-latex, org-beamer-export-to-pdf):
* lisp/ox-html.el (org-html-export-as-html, org-html-export-to-html):
* lisp/ox-icalendar.el (org-icalendar-export-to-ics):
* lisp/ox-latex.el (org-latex-export-as-latex,
org-latex-export-to-pdf):
* lisp/ox-man.el (org-man-export-to-man, org-man-export-to-pdf):
* lisp/ox-md.el (org-md-export-as-markdown,
org-md-export-to-markdown):
* lisp/ox-odt.el (org-odt-export-to-odt):
* lisp/ox-org.el (org-org-export-as-org, org-org-export-to-org):
* lisp/ox-publish.el (org-publish-org-to):
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo,
org-texinfo-export-to-info):
* testing/lisp/test-ob-exp.el (test-ob-exp/org-babel-exp-src-blocks/w-no-file):
2013-08-07 08:35:42 +00:00
|
|
|
|
(let ((file (org-export-output-file-name ".tex" subtreep)))
|
|
|
|
|
(org-export-to-file 'beamer file
|
|
|
|
|
async subtreep visible-only body-only ext-plist
|
|
|
|
|
(lambda (file) (org-latex-compile file)))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-select-environment ()
|
2012-06-30 11:54:43 +00:00
|
|
|
|
"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
|
|
|
|
|
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)
|
2013-01-27 22:11:34 +00:00
|
|
|
|
;; 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))
|
2016-04-28 21:29:17 +00:00
|
|
|
|
(org-current-tag-alist
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(append '((:startgroup))
|
|
|
|
|
(mapcar (lambda (e) (cons (concat "B_" (car e))
|
|
|
|
|
(string-to-char (nth 1 e))))
|
|
|
|
|
envs)
|
|
|
|
|
'((:endgroup))
|
|
|
|
|
'(("BMCOL" . ?|))))
|
2014-05-19 11:37:16 +00:00
|
|
|
|
(org-tag-persistent-alist nil)
|
2014-01-07 20:50:44 +00:00
|
|
|
|
(org-use-fast-tag-selection t)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(org-fast-tag-selection-single-key t))
|
2018-04-20 08:45:19 +00:00
|
|
|
|
(org-set-tags-command)
|
2018-04-18 21:57:51 +00:00
|
|
|
|
(let ((tags (org-get-tags nil t)))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(cond
|
2012-09-04 09:07:56 +00:00
|
|
|
|
;; For a column, automatically ask for its width.
|
org-export: Use `eq' instead of `equal' when possible
* contrib/lisp/org-export.el (org-export-data,
org-export-footnote-first-reference-p,
org-export-get-footnote-number, org-export-get-ordinal,
org-export-get-loc, org-export-table-row-group,
org-export-table-cell-starts-colgroup-p,
org-export-table-cell-ends-colgroup-p,
org-export-table-cell-address): Use `eq' instead of `equal' when
possible.
* contrib/lisp/org-e-ascii.el (org-e-ascii-table-row):
* contrib/lisp/org-e-beamer.el (org-e-beamer-select-environment):
* contrib/lisp/org-e-html.el (org-e-html-footnote-section,
org-e-html-latex-environment, org-e-html-paragraph): Use `eq'
instead of `equal' when possible.
* contrib/lisp/org-e-latex.el (org-e-latex--get-footnote-counter):
* contrib/lisp/org-e-odt.el (org-e-odt-do-format-code,
org-e-odt-footnote-def, org-e-odt-item, org-e-odt-latex-environment,
org-e-odt-latex-fragment, org-e-odt-plain-list, org-e-odt-table,
org-e-odt-enumerate-element): Use `eq' instead of `equal' when
possible.
In particular, comparing elements shouldn't be done with `equal' since
they are circular lists. On the other hand, using `eq' is fine if
they belong to the same tree.
2012-07-16 14:19:56 +00:00
|
|
|
|
((eq org-last-tag-selection-key ?|)
|
2018-04-18 21:57:51 +00:00
|
|
|
|
(if (member "BMCOL" tags)
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(org-set-property "BEAMER_col" (read-string "Column width: "))
|
|
|
|
|
(org-delete-property "BEAMER_col")))
|
2012-09-04 09:07:56 +00:00
|
|
|
|
;; For an "againframe" section, automatically ask for reference
|
|
|
|
|
;; to resumed frame and overlay specifications.
|
2012-11-17 20:47:04 +00:00
|
|
|
|
((eq org-last-tag-selection-key ?A)
|
2012-09-04 09:07:56 +00:00
|
|
|
|
(if (equal (org-entry-get nil "BEAMER_env") "againframe")
|
|
|
|
|
(progn (org-entry-delete nil "BEAMER_env")
|
|
|
|
|
(org-entry-delete nil "BEAMER_ref")
|
|
|
|
|
(org-entry-delete nil "BEAMER_act"))
|
|
|
|
|
(org-entry-put nil "BEAMER_env" "againframe")
|
|
|
|
|
(org-set-property
|
|
|
|
|
"BEAMER_ref"
|
|
|
|
|
(read-string "Frame reference (*Title, #custom-id, id:...): "))
|
|
|
|
|
(org-set-property "BEAMER_act"
|
|
|
|
|
(read-string "Overlay specification: "))))
|
2018-05-01 21:27:37 +00:00
|
|
|
|
((let* ((tags-re (concat "B_" (regexp-opt (mapcar #'car envs) t)))
|
|
|
|
|
(env (cl-some (lambda (tag)
|
|
|
|
|
(and (string-match tags-re tag)
|
|
|
|
|
(match-string 1 tag)))
|
|
|
|
|
tags)))
|
|
|
|
|
(and env (progn (org-entry-put nil "BEAMER_env" env) t))))
|
2012-06-30 11:54:43 +00:00
|
|
|
|
(t (org-entry-delete nil "BEAMER_env"))))))
|
|
|
|
|
|
2012-12-20 08:58:16 +00:00
|
|
|
|
;;;###autoload
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-publish-to-latex (plist filename pub-dir)
|
2012-12-20 08:58:16 +00:00
|
|
|
|
"Publish an Org file to a Beamer presentation (LaTeX).
|
|
|
|
|
|
|
|
|
|
FILENAME is the filename of the Org file to be published. PLIST
|
|
|
|
|
is the property list for the given project. PUB-DIR is the
|
|
|
|
|
publishing directory.
|
|
|
|
|
|
|
|
|
|
Return output file name."
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(org-publish-org-to 'beamer filename ".tex" plist pub-dir))
|
2012-12-20 08:58:16 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(defun org-beamer-publish-to-pdf (plist filename pub-dir)
|
2012-12-20 08:58:16 +00:00
|
|
|
|
"Publish an Org file to a Beamer presentation (PDF, via LaTeX).
|
|
|
|
|
|
|
|
|
|
FILENAME is the filename of the Org file to be published. PLIST
|
|
|
|
|
is the property list for the given project. PUB-DIR is the
|
|
|
|
|
publishing directory.
|
|
|
|
|
|
|
|
|
|
Return output file name."
|
2013-01-27 22:11:34 +00:00
|
|
|
|
;; Unlike to `org-beamer-publish-to-latex', PDF file is generated in
|
|
|
|
|
;; working directory and then moved to publishing directory.
|
|
|
|
|
(org-publish-attachment
|
2012-12-20 08:58:16 +00:00
|
|
|
|
plist
|
2017-03-08 08:33:09 +00:00
|
|
|
|
;; Default directory could be anywhere when this function is
|
|
|
|
|
;; called. We ensure it is set to source file directory during
|
|
|
|
|
;; compilation so as to not break links to external documents.
|
|
|
|
|
(let ((default-directory (file-name-directory filename)))
|
|
|
|
|
(org-latex-compile
|
|
|
|
|
(org-publish-org-to
|
|
|
|
|
'beamer filename ".tex" plist (file-name-directory filename))))
|
2012-12-20 08:58:16 +00:00
|
|
|
|
pub-dir))
|
|
|
|
|
|
2012-06-30 11:54:43 +00:00
|
|
|
|
|
2013-01-27 22:11:34 +00:00
|
|
|
|
(provide 'ox-beamer)
|
|
|
|
|
|
|
|
|
|
;; Local variables:
|
|
|
|
|
;; generated-autoload-file: "org-loaddefs.el"
|
|
|
|
|
;; End:
|
|
|
|
|
|
|
|
|
|
;;; ox-beamer.el ends here
|