2013-01-27 17:11:34 -05:00
|
|
|
|
;;; ox-koma-letter.el --- KOMA Scrlttr2 Back-End for Org Export Engine
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
2018-01-07 00:27:54 -05:00
|
|
|
|
;; Copyright (C) 2007-2018 Free Software Foundation, Inc.
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
|
|
|
|
;; Author: Nicolas Goaziou <n.goaziou AT gmail DOT com>
|
|
|
|
|
;; Alan Schmitt <alan.schmitt AT polytechnique DOT org>
|
2013-05-19 11:32:44 -04:00
|
|
|
|
;; Viktor Rosenfeld <listuser36 AT gmail DOT com>
|
|
|
|
|
;; Rasmus Pank Roulund <emacs AT pank DOT eu>
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;; Keywords: org, wp, tex
|
|
|
|
|
|
2013-03-10 12:57:47 -04:00
|
|
|
|
;; This program is free software: you can redistribute it and/or modify
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;; 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.
|
|
|
|
|
|
2013-03-10 12:57:47 -04:00
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
;;
|
|
|
|
|
;; This library implements a KOMA Scrlttr2 back-end, derived from the
|
|
|
|
|
;; LaTeX one.
|
|
|
|
|
;;
|
|
|
|
|
;; Depending on the desired output format, three commands are provided
|
|
|
|
|
;; for export: `org-koma-letter-export-as-latex' (temporary buffer),
|
|
|
|
|
;; `org-koma-letter-export-to-latex' ("tex" file) and
|
|
|
|
|
;; `org-koma-letter-export-to-pdf' ("pdf" file).
|
|
|
|
|
;;
|
2013-01-27 17:11:34 -05:00
|
|
|
|
;; On top of buffer keywords supported by `latex' back-end (see
|
2013-02-08 16:59:47 -05:00
|
|
|
|
;; `org-latex-options-alist'), this back-end introduces the following
|
2013-05-27 11:29:14 -04:00
|
|
|
|
;; keywords:
|
2014-01-25 08:08:15 -05:00
|
|
|
|
;; - CLOSING: see `org-koma-letter-closing',
|
|
|
|
|
;; - FROM_ADDRESS: see `org-koma-letter-from-address',
|
|
|
|
|
;; - LCO: see `org-koma-letter-class-option-file',
|
|
|
|
|
;; - OPENING: see `org-koma-letter-opening',
|
|
|
|
|
;; - PHONE_NUMBER: see `org-koma-letter-phone-number',
|
2017-07-13 21:14:52 -04:00
|
|
|
|
;; - URL: see `org-koma-letter-url',
|
2018-04-28 00:15:34 -04:00
|
|
|
|
;; - FROM_LOGO: see `org-koma-letter-from-logo',
|
2014-01-25 08:08:15 -05:00
|
|
|
|
;; - SIGNATURE: see `org-koma-letter-signature',
|
|
|
|
|
;; - PLACE: see `org-koma-letter-place',
|
2016-01-27 13:18:38 -05:00
|
|
|
|
;; - LOCATION: see `org-koma-letter-location',
|
2014-01-25 08:08:15 -05:00
|
|
|
|
;; - TO_ADDRESS: If unspecified this is set to "\mbox{}".
|
2013-06-01 13:52:36 -04:00
|
|
|
|
;;
|
2016-01-27 13:18:38 -05:00
|
|
|
|
;; TO_ADDRESS, FROM_ADDRESS, LOCATION, CLOSING, and SIGNATURE can also
|
|
|
|
|
;; be specified using "special headings" with the special tags
|
|
|
|
|
;; specified in `org-koma-letter-special-tags-in-letter'. LaTeX line
|
|
|
|
|
;; breaks are not necessary for TO_ADDRESS, FROM_ADDRESS and LOCATION.
|
|
|
|
|
;; If both a headline and a keyword specify a to or from address the
|
2013-06-01 13:52:36 -04:00
|
|
|
|
;; value is determined in accordance with
|
|
|
|
|
;; `org-koma-letter-prefer-special-headings'.
|
2013-05-27 11:29:14 -04:00
|
|
|
|
;;
|
|
|
|
|
;; A number of OPTIONS settings can be set to change which contents is
|
|
|
|
|
;; exported.
|
|
|
|
|
;; - backaddress (see `org-koma-letter-use-backaddress')
|
|
|
|
|
;; - foldmarks (see `org-koma-letter-use-foldmarks')
|
|
|
|
|
;; - phone (see `org-koma-letter-use-phone')
|
2017-07-13 21:14:52 -04:00
|
|
|
|
;; - url (see `org-koma-letter-use-url')
|
2018-04-28 00:15:34 -04:00
|
|
|
|
;; - from-logo (see `org-koma-letter-use-from-logo')
|
2013-05-27 11:29:14 -04:00
|
|
|
|
;; - email (see `org-koma-letter-use-email')
|
|
|
|
|
;; - place (see `org-koma-letter-use-place')
|
2016-01-27 13:18:38 -05:00
|
|
|
|
;; - location (see `org-koma-letter-use-location')
|
2013-05-27 11:29:14 -04:00
|
|
|
|
;; - subject, a list of format options
|
|
|
|
|
;; (see `org-koma-letter-subject-format')
|
|
|
|
|
;; - after-closing-order, a list of the ordering of headings with
|
|
|
|
|
;; special tags after closing (see
|
2013-08-17 16:50:47 -04:00
|
|
|
|
;; `org-koma-letter-special-tags-after-closing')
|
|
|
|
|
;; - after-letter-order, as above, but after the end of the letter
|
2013-05-27 11:29:14 -04:00
|
|
|
|
;; (see `org-koma-letter-special-tags-after-letter').
|
|
|
|
|
;;
|
|
|
|
|
;; The following variables works differently from the main LaTeX class
|
2014-01-25 08:08:15 -05:00
|
|
|
|
;; - AUTHOR: Default to user-full-name but may be disabled.
|
|
|
|
|
;; (See also `org-koma-letter-author'),
|
|
|
|
|
;; - EMAIL: Same as AUTHOR. (see also `org-koma-letter-email'),
|
2013-05-27 11:29:14 -04:00
|
|
|
|
;;
|
|
|
|
|
;; Headlines are in general ignored. However, headlines with special
|
|
|
|
|
;; tags can be used for specified contents like postscript (ps),
|
|
|
|
|
;; carbon copy (cc), enclosures (encl) and code to be inserted after
|
|
|
|
|
;; \end{letter} (after_letter). Specials tags are defined in
|
|
|
|
|
;; `org-koma-letter-special-tags-after-closing' and
|
|
|
|
|
;; `org-koma-letter-special-tags-after-letter'. Currently members of
|
|
|
|
|
;; `org-koma-letter-special-tags-after-closing' used as macros and the
|
|
|
|
|
;; content of the headline is the argument.
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;;
|
2016-01-02 05:25:15 -05:00
|
|
|
|
;; Headlines with to and from may also be used rather than the keyword
|
|
|
|
|
;; approach described above. If both a keyword and a headline with
|
|
|
|
|
;; information is present precedence is determined by
|
2013-06-02 11:59:48 -04:00
|
|
|
|
;; `org-koma-letter-prefer-special-headings'.
|
|
|
|
|
;;
|
2014-01-17 05:22:37 -05:00
|
|
|
|
;; You need an appropriate association in `org-latex-classes' in order
|
|
|
|
|
;; to use the KOMA Scrlttr2 class. By default, a sparse scrlttr2
|
|
|
|
|
;; class is provided: "default-koma-letter". You can also add you own
|
|
|
|
|
;; letter class. For instance:
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;;
|
2013-01-27 17:11:34 -05:00
|
|
|
|
;; (add-to-list 'org-latex-classes
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;; '("my-letter"
|
|
|
|
|
;; "\\documentclass\[%
|
|
|
|
|
;; DIV=14,
|
|
|
|
|
;; fontsize=12pt,
|
|
|
|
|
;; parskip=half,
|
|
|
|
|
;; subject=titled,
|
|
|
|
|
;; backaddress=false,
|
|
|
|
|
;; fromalign=left,
|
|
|
|
|
;; fromemail=true,
|
|
|
|
|
;; fromphone=true\]\{scrlttr2\}
|
|
|
|
|
;; \[DEFAULT-PACKAGES]
|
|
|
|
|
;; \[PACKAGES]
|
|
|
|
|
;; \[EXTRA]"))
|
|
|
|
|
;;
|
|
|
|
|
;; Then, in your Org document, be sure to require the proper class
|
2014-01-25 08:08:15 -05:00
|
|
|
|
;; with:
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;;
|
|
|
|
|
;; #+LATEX_CLASS: my-letter
|
2013-06-02 11:59:48 -04:00
|
|
|
|
;;
|
|
|
|
|
;; Or by setting `org-koma-letter-default-class'.
|
2014-01-25 08:08:15 -05:00
|
|
|
|
;;
|
|
|
|
|
;; You may have to load (LaTeX) Babel as well, e.g., by adding
|
|
|
|
|
;; it to `org-latex-packages-alist',
|
|
|
|
|
;;
|
|
|
|
|
;; (add-to-list 'org-latex-packages-alist '("AUTO" "babel" nil))
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(require 'ox-latex)
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
2014-01-17 05:22:37 -05:00
|
|
|
|
;; Install a default letter class.
|
2014-01-17 05:33:26 -05:00
|
|
|
|
(unless (assoc "default-koma-letter" org-latex-classes)
|
2014-01-17 05:22:37 -05:00
|
|
|
|
(add-to-list 'org-latex-classes
|
|
|
|
|
'("default-koma-letter" "\\documentclass[11pt]{scrlttr2}")))
|
|
|
|
|
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
|
|
|
|
;;; User-Configurable Variables
|
|
|
|
|
|
|
|
|
|
(defgroup org-export-koma-letter nil
|
|
|
|
|
"Options for exporting to KOMA scrlttr2 class in LaTeX export."
|
|
|
|
|
:tag "Org Koma-Letter"
|
2013-02-26 11:57:13 -05:00
|
|
|
|
:group 'org-export)
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
|
|
|
|
(defcustom org-koma-letter-class-option-file "NF"
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
"Letter Class Option File.
|
|
|
|
|
This option can also be set with the LCO keyword."
|
2012-11-26 02:55:27 -05:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2013-05-26 10:13:39 -04:00
|
|
|
|
(defcustom org-koma-letter-author 'user-full-name
|
ox-koma-letter: Cleanup some docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-author,
org-koma-letter-email, org-koma-letter-place,
org-koma-letter-prefer-special-headings, org-koma-letter-signature,
org-koma-letter-subject-format, org-koma-letter-use-backaddress,
org-koma-letter-use-phone, org-koma-letter-use-email,
org-koma-letter-use-place,
org-koma-letter-headline-is-opening-maybe,
org-koma-letter--get-tagged-contents,
org-koma-letter--format-string-as-macro,
org-koma-letter--normalize-string): Cleanup docstrings.
2014-01-16 12:18:21 -05:00
|
|
|
|
"Sender's name.
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
|
2013-05-26 10:13:39 -04:00
|
|
|
|
This variable defaults to calling the function `user-full-name'
|
ox-koma-letter: Cleanup some docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-author,
org-koma-letter-email, org-koma-letter-place,
org-koma-letter-prefer-special-headings, org-koma-letter-signature,
org-koma-letter-subject-format, org-koma-letter-use-backaddress,
org-koma-letter-use-phone, org-koma-letter-use-email,
org-koma-letter-use-place,
org-koma-letter-headline-is-opening-maybe,
org-koma-letter--get-tagged-contents,
org-koma-letter--format-string-as-macro,
org-koma-letter--normalize-string): Cleanup docstrings.
2014-01-16 12:18:21 -05:00
|
|
|
|
which just returns the current function `user-full-name'.
|
|
|
|
|
Alternatively a string, nil or a function may be given.
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
Functions must return a string.
|
|
|
|
|
|
|
|
|
|
This option can also be set with the AUTHOR keyword."
|
2013-05-26 10:13:39 -04:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type '(radio (function-item user-full-name)
|
|
|
|
|
(string)
|
|
|
|
|
(function)
|
2013-05-27 11:29:14 -04:00
|
|
|
|
(const :tag "Do not export author" nil)))
|
2013-05-26 10:13:39 -04:00
|
|
|
|
|
|
|
|
|
(defcustom org-koma-letter-email 'org-koma-letter-email
|
ox-koma-letter: Cleanup some docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-author,
org-koma-letter-email, org-koma-letter-place,
org-koma-letter-prefer-special-headings, org-koma-letter-signature,
org-koma-letter-subject-format, org-koma-letter-use-backaddress,
org-koma-letter-use-phone, org-koma-letter-use-email,
org-koma-letter-use-place,
org-koma-letter-headline-is-opening-maybe,
org-koma-letter--get-tagged-contents,
org-koma-letter--format-string-as-macro,
org-koma-letter--normalize-string): Cleanup docstrings.
2014-01-16 12:18:21 -05:00
|
|
|
|
"Sender's email address.
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
|
2013-05-26 10:13:39 -04:00
|
|
|
|
This variable defaults to the value `org-koma-letter-email' which
|
ox-koma-letter: Cleanup some docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-author,
org-koma-letter-email, org-koma-letter-place,
org-koma-letter-prefer-special-headings, org-koma-letter-signature,
org-koma-letter-subject-format, org-koma-letter-use-backaddress,
org-koma-letter-use-phone, org-koma-letter-use-email,
org-koma-letter-use-place,
org-koma-letter-headline-is-opening-maybe,
org-koma-letter--get-tagged-contents,
org-koma-letter--format-string-as-macro,
org-koma-letter--normalize-string): Cleanup docstrings.
2014-01-16 12:18:21 -05:00
|
|
|
|
returns `user-mail-address'. Alternatively a string, nil or
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
a function may be given. Functions must return a string.
|
|
|
|
|
|
|
|
|
|
This option can also be set with the EMAIL keyword."
|
2013-05-26 10:13:39 -04:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type '(radio (function-item org-koma-letter-email)
|
|
|
|
|
(string)
|
|
|
|
|
(function)
|
2013-05-27 11:29:14 -04:00
|
|
|
|
(const :tag "Do not export email" nil)))
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
2014-01-16 16:33:43 -05:00
|
|
|
|
(defcustom org-koma-letter-from-address ""
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
"Sender's address, as a string.
|
|
|
|
|
This option can also be set with one or more FROM_ADDRESS
|
|
|
|
|
keywords."
|
2012-11-26 02:55:27 -05:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2014-01-16 16:33:43 -05:00
|
|
|
|
(defcustom org-koma-letter-phone-number ""
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
"Sender's phone number, as a string.
|
|
|
|
|
This option can also be set with the PHONE_NUMBER keyword."
|
ox-koma-letter: Export options to control letter
* ox-koma-letter.el ((org-koma-letter-use-subject):
Configure printing of subject line.
(org-koma-letter-use-backaddress): Configure presence of back
address.
(org-koma-letter-use-foldmarks): Configure presence of foldmarks.
(org-koma-letter-use-phone): Configure printing of phone number.
(org-koma-letter-use-email): Configure printing of email.
(org-koma-letter-use-place): Configure printing of place.
(koma-letter): Add export option to exporter backend.
(org-koma-letter-template): Evaluate export options in
exporter template.
Usage:
#+OPTIONS: backaddress:t foldmarks:t subject:titled phone:t email:t place:t
Except for `subject', all options are boolean, i.e., the accept the
values `nil' and `t'. `subject' accepts the values defined in
`scrlttr2`, i.e., `afteropening', `beforeopening', `centered', `left',
`right', `titled', `underlined', and `untitled'.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-21 10:34:35 -04:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2017-07-13 21:14:52 -04:00
|
|
|
|
(defcustom org-koma-letter-url ""
|
|
|
|
|
"Sender's URL, e. g., the URL of her homepage.
|
|
|
|
|
This option can also be set with the URL keyword."
|
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'string
|
|
|
|
|
:safe #'stringp)
|
|
|
|
|
|
2018-04-28 00:15:34 -04:00
|
|
|
|
(defcustom org-koma-letter-from-logo ""
|
|
|
|
|
"Commands for inserting the sender's logo, e. g., \\includegraphics{logo}.
|
|
|
|
|
This option can also be set with the FROM_LOGO keyword."
|
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'string
|
|
|
|
|
:safe #'stringp)
|
|
|
|
|
|
2014-01-16 16:33:43 -05:00
|
|
|
|
(defcustom org-koma-letter-place ""
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
"Place from which the letter is sent, as a string.
|
|
|
|
|
This option can also be set with the PLACE keyword."
|
ox-koma-letter: Export options to control letter
* ox-koma-letter.el ((org-koma-letter-use-subject):
Configure printing of subject line.
(org-koma-letter-use-backaddress): Configure presence of back
address.
(org-koma-letter-use-foldmarks): Configure presence of foldmarks.
(org-koma-letter-use-phone): Configure printing of phone number.
(org-koma-letter-use-email): Configure printing of email.
(org-koma-letter-use-place): Configure printing of place.
(koma-letter): Add export option to exporter backend.
(org-koma-letter-template): Evaluate export options in
exporter template.
Usage:
#+OPTIONS: backaddress:t foldmarks:t subject:titled phone:t email:t place:t
Except for `subject', all options are boolean, i.e., the accept the
values `nil' and `t'. `subject' accepts the values defined in
`scrlttr2`, i.e., `afteropening', `beforeopening', `centered', `left',
`right', `titled', `underlined', and `untitled'.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-21 10:34:35 -04:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2016-01-27 13:18:38 -05:00
|
|
|
|
(defcustom org-koma-letter-location ""
|
|
|
|
|
"Sender's extension field, as a string.
|
|
|
|
|
|
|
|
|
|
This option can also be set with the LOCATION keyword.
|
|
|
|
|
Moreover, when:
|
|
|
|
|
(1) Either `org-koma-letter-prefer-special-headings' is non-nil
|
|
|
|
|
or there is no LOCATION keyword or the LOCATION keyword is
|
|
|
|
|
empty;
|
|
|
|
|
(2) the letter contains a headline with the special
|
|
|
|
|
tag \"location\";
|
|
|
|
|
then the location will be set as the content of the location
|
|
|
|
|
special heading.
|
|
|
|
|
|
|
|
|
|
The location field is typically printed right of the address
|
|
|
|
|
field (See Figure 4.9. in the English manual of 2015-10-03)."
|
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2014-01-16 16:33:43 -05:00
|
|
|
|
(defcustom org-koma-letter-opening ""
|
2013-08-17 14:24:36 -04:00
|
|
|
|
"Letter's opening, as a string.
|
2014-01-17 16:52:37 -05:00
|
|
|
|
|
|
|
|
|
This option can also be set with the OPENING keyword. Moreover,
|
|
|
|
|
when:
|
2015-08-29 08:02:42 -04:00
|
|
|
|
(1) Either `org-koma-letter-prefer-special-headings' is non-nil
|
|
|
|
|
or the CLOSING keyword is empty
|
|
|
|
|
(2) `org-koma-letter-headline-is-opening-maybe' is non-nil;
|
|
|
|
|
(3) the letter contains a headline without a special
|
2014-01-17 16:52:37 -05:00
|
|
|
|
tag (e.g. \"to\" or \"ps\");
|
2015-08-29 08:02:42 -04:00
|
|
|
|
then the opening will be implicitly set as the untagged headline title."
|
2012-11-26 02:55:27 -05:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2014-01-16 16:33:43 -05:00
|
|
|
|
(defcustom org-koma-letter-closing ""
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
"Letter's closing, as a string.
|
2015-07-15 18:38:06 -04:00
|
|
|
|
This option can also be set with the CLOSING keyword. Moreover,
|
|
|
|
|
when:
|
2015-08-29 08:02:42 -04:00
|
|
|
|
(1) Either `org-koma-letter-prefer-special-headings' is non-nil
|
|
|
|
|
or the CLOSING keyword is empty;
|
2015-07-15 18:38:06 -04:00
|
|
|
|
(2) `org-koma-letter-headline-is-opening-maybe' is non-nil;
|
|
|
|
|
(3) the letter contains a headline with the special
|
2015-08-29 08:02:42 -04:00
|
|
|
|
tag \"closing\";
|
2015-07-15 18:38:06 -04:00
|
|
|
|
then the opening will be set as the title of the closing special
|
2015-08-29 08:02:42 -04:00
|
|
|
|
heading title."
|
2012-11-26 02:55:27 -05:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2014-01-16 16:33:43 -05:00
|
|
|
|
(defcustom org-koma-letter-signature ""
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
"Signature, as a string.
|
2015-07-15 18:38:06 -04:00
|
|
|
|
This option can also be set with the SIGNATURE keyword.
|
|
|
|
|
Moreover, when:
|
2015-08-29 08:02:42 -04:00
|
|
|
|
(1) Either `org-koma-letter-prefer-special-headings' is non-nil
|
|
|
|
|
or there is no CLOSING keyword or the CLOSING keyword is empty;
|
2015-07-15 18:38:06 -04:00
|
|
|
|
(2) `org-koma-letter-headline-is-opening-maybe' is non-nil;
|
|
|
|
|
(3) the letter contains a headline with the special
|
2015-08-29 08:02:42 -04:00
|
|
|
|
tag \"closing\";
|
2015-07-15 18:38:06 -04:00
|
|
|
|
then the signature will be set as the content of the
|
2015-08-29 08:02:42 -04:00
|
|
|
|
closing special heading.
|
|
|
|
|
|
|
|
|
|
Note if the content is empty the signature will not be set."
|
2014-01-16 16:33:43 -05:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2013-06-01 13:52:36 -04:00
|
|
|
|
(defcustom org-koma-letter-prefer-special-headings nil
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
"Non-nil means prefer headlines over keywords for TO and FROM.
|
|
|
|
|
This option can also be set with the OPTIONS keyword, e.g.:
|
|
|
|
|
\"special-headings:t\"."
|
2013-06-01 13:52:36 -04:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2013-05-19 11:32:44 -04:00
|
|
|
|
(defcustom org-koma-letter-subject-format t
|
2014-12-01 10:50:12 -05:00
|
|
|
|
"Non-nil means include the subject.
|
|
|
|
|
|
|
|
|
|
Support formatting options.
|
2013-08-17 16:50:47 -04:00
|
|
|
|
|
2014-01-17 03:43:45 -05:00
|
|
|
|
When t, insert a subject using default options. When nil, do not
|
|
|
|
|
insert a subject at all. It can also be a list of symbols among
|
|
|
|
|
the following ones:
|
2013-08-17 16:50:47 -04:00
|
|
|
|
|
ox-koma-letter: Cleanup some docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-author,
org-koma-letter-email, org-koma-letter-place,
org-koma-letter-prefer-special-headings, org-koma-letter-signature,
org-koma-letter-subject-format, org-koma-letter-use-backaddress,
org-koma-letter-use-phone, org-koma-letter-use-email,
org-koma-letter-use-place,
org-koma-letter-headline-is-opening-maybe,
org-koma-letter--get-tagged-contents,
org-koma-letter--format-string-as-macro,
org-koma-letter--normalize-string): Cleanup docstrings.
2014-01-16 12:18:21 -05:00
|
|
|
|
`afteropening' Subject after opening
|
|
|
|
|
`beforeopening' Subject before opening
|
|
|
|
|
`centered' Subject centered
|
|
|
|
|
`left' Subject left-justified
|
|
|
|
|
`right' Subject right-justified
|
|
|
|
|
`titled' Add title/description to subject
|
|
|
|
|
`underlined' Set subject underlined
|
|
|
|
|
`untitled' Do not add title/description to subject
|
|
|
|
|
|
2014-01-16 16:33:43 -05:00
|
|
|
|
Please refer to the KOMA-script manual (Table 4.16. in the
|
2014-01-17 03:43:45 -05:00
|
|
|
|
English manual of 2012-07-22).
|
|
|
|
|
|
|
|
|
|
This option can also be set with the OPTIONS keyword, e.g.:
|
|
|
|
|
\"subject:(underlined centered)\"."
|
2014-01-17 05:14:00 -05:00
|
|
|
|
:type
|
|
|
|
|
'(choice
|
|
|
|
|
(const :tag "No export" nil)
|
|
|
|
|
(const :tag "Default options" t)
|
|
|
|
|
(set :tag "Configure options"
|
|
|
|
|
(const :tag "Subject after opening" afteropening)
|
|
|
|
|
(const :tag "Subject before opening" beforeopening)
|
|
|
|
|
(const :tag "Subject centered" centered)
|
|
|
|
|
(const :tag "Subject left-justified" left)
|
|
|
|
|
(const :tag "Subject right-justified" right)
|
|
|
|
|
(const :tag "Add title or description to subject" underlined)
|
|
|
|
|
(const :tag "Set subject underlined" titled)
|
|
|
|
|
(const :tag "Do not add title or description to subject" untitled)))
|
2013-05-19 11:32:44 -04:00
|
|
|
|
:group 'org-export-koma-letter)
|
|
|
|
|
|
2013-07-22 10:46:02 -04:00
|
|
|
|
(defcustom org-koma-letter-use-backaddress nil
|
2014-01-25 08:08:15 -05:00
|
|
|
|
"Non-nil prints return address in line above to address.
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
This option can also be set with the OPTIONS keyword, e.g.:
|
|
|
|
|
\"backaddress:t\"."
|
2013-04-21 07:41:22 -04:00
|
|
|
|
:group 'org-export-koma-letter
|
ox-koma-letter: Export options to control letter
* ox-koma-letter.el ((org-koma-letter-use-subject):
Configure printing of subject line.
(org-koma-letter-use-backaddress): Configure presence of back
address.
(org-koma-letter-use-foldmarks): Configure presence of foldmarks.
(org-koma-letter-use-phone): Configure printing of phone number.
(org-koma-letter-use-email): Configure printing of email.
(org-koma-letter-use-place): Configure printing of place.
(koma-letter): Add export option to exporter backend.
(org-koma-letter-template): Evaluate export options in
exporter template.
Usage:
#+OPTIONS: backaddress:t foldmarks:t subject:titled phone:t email:t place:t
Except for `subject', all options are boolean, i.e., the accept the
values `nil' and `t'. `subject' accepts the values defined in
`scrlttr2`, i.e., `afteropening', `beforeopening', `centered', `left',
`right', `titled', `underlined', and `untitled'.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-21 10:34:35 -04:00
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2014-01-16 19:29:06 -05:00
|
|
|
|
(defcustom org-koma-letter-use-foldmarks t
|
2014-01-17 05:01:15 -05:00
|
|
|
|
"Configure appearance of folding marks.
|
2013-05-05 09:22:51 -04:00
|
|
|
|
|
2014-01-17 05:01:15 -05:00
|
|
|
|
When t, activate default folding marks. When nil, do not insert
|
|
|
|
|
folding marks at all. It can also be a list of symbols among the
|
|
|
|
|
following ones:
|
|
|
|
|
|
|
|
|
|
`B' Activate upper horizontal mark on left paper edge
|
|
|
|
|
`b' Deactivate upper horizontal mark on left paper edge
|
|
|
|
|
|
|
|
|
|
`H' Activate all horizontal marks on left paper edge
|
|
|
|
|
`h' Deactivate all horizontal marks on left paper edge
|
|
|
|
|
|
|
|
|
|
`L' Activate left vertical mark on upper paper edge
|
|
|
|
|
`l' Deactivate left vertical mark on upper paper edge
|
2013-05-05 09:22:51 -04:00
|
|
|
|
|
2014-01-17 05:01:15 -05:00
|
|
|
|
`M' Activate middle horizontal mark on left paper edge
|
|
|
|
|
`m' Deactivate middle horizontal mark on left paper edge
|
2014-01-16 19:29:06 -05:00
|
|
|
|
|
2014-01-17 05:01:15 -05:00
|
|
|
|
`P' Activate punch or center mark on left paper edge
|
|
|
|
|
`p' Deactivate punch or center mark on left paper edge
|
|
|
|
|
|
|
|
|
|
`T' Activate lower horizontal mark on left paper edge
|
|
|
|
|
`t' Deactivate lower horizontal mark on left paper edge
|
|
|
|
|
|
|
|
|
|
`V' Activate all vertical marks on upper paper edge
|
|
|
|
|
`v' Deactivate all vertical marks on upper paper edge
|
|
|
|
|
|
|
|
|
|
This option can also be set with the OPTIONS keyword, e.g.:
|
|
|
|
|
\"foldmarks:(b l m t)\"."
|
ox-koma-letter: Export options to control letter
* ox-koma-letter.el ((org-koma-letter-use-subject):
Configure printing of subject line.
(org-koma-letter-use-backaddress): Configure presence of back
address.
(org-koma-letter-use-foldmarks): Configure presence of foldmarks.
(org-koma-letter-use-phone): Configure printing of phone number.
(org-koma-letter-use-email): Configure printing of email.
(org-koma-letter-use-place): Configure printing of place.
(koma-letter): Add export option to exporter backend.
(org-koma-letter-template): Evaluate export options in
exporter template.
Usage:
#+OPTIONS: backaddress:t foldmarks:t subject:titled phone:t email:t place:t
Except for `subject', all options are boolean, i.e., the accept the
values `nil' and `t'. `subject' accepts the values defined in
`scrlttr2`, i.e., `afteropening', `beforeopening', `centered', `left',
`right', `titled', `underlined', and `untitled'.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-21 10:34:35 -04:00
|
|
|
|
:group 'org-export-koma-letter
|
2014-01-16 19:29:06 -05:00
|
|
|
|
:type '(choice
|
|
|
|
|
(const :tag "Activate default folding marks" t)
|
|
|
|
|
(const :tag "Deactivate folding marks" nil)
|
2014-01-17 05:01:15 -05:00
|
|
|
|
(set
|
|
|
|
|
:tag "Configure folding marks"
|
|
|
|
|
(const :tag "Activate upper horizontal mark on left paper edge" B)
|
|
|
|
|
(const :tag "Deactivate upper horizontal mark on left paper edge" b)
|
|
|
|
|
(const :tag "Activate all horizontal marks on left paper edge" H)
|
|
|
|
|
(const :tag "Deactivate all horizontal marks on left paper edge" h)
|
|
|
|
|
(const :tag "Activate left vertical mark on upper paper edge" L)
|
|
|
|
|
(const :tag "Deactivate left vertical mark on upper paper edge" l)
|
|
|
|
|
(const :tag "Activate middle horizontal mark on left paper edge" M)
|
|
|
|
|
(const :tag "Deactivate middle horizontal mark on left paper edge" m)
|
|
|
|
|
(const :tag "Activate punch or center mark on left paper edge" P)
|
|
|
|
|
(const :tag "Deactivate punch or center mark on left paper edge" p)
|
|
|
|
|
(const :tag "Activate lower horizontal mark on left paper edge" T)
|
|
|
|
|
(const :tag "Deactivate lower horizontal mark on left paper edge" t)
|
|
|
|
|
(const :tag "Activate all vertical marks on upper paper edge" V)
|
|
|
|
|
(const :tag "Deactivate all vertical marks on upper paper edge" v))))
|
ox-koma-letter: Export options to control letter
* ox-koma-letter.el ((org-koma-letter-use-subject):
Configure printing of subject line.
(org-koma-letter-use-backaddress): Configure presence of back
address.
(org-koma-letter-use-foldmarks): Configure presence of foldmarks.
(org-koma-letter-use-phone): Configure printing of phone number.
(org-koma-letter-use-email): Configure printing of email.
(org-koma-letter-use-place): Configure printing of place.
(koma-letter): Add export option to exporter backend.
(org-koma-letter-template): Evaluate export options in
exporter template.
Usage:
#+OPTIONS: backaddress:t foldmarks:t subject:titled phone:t email:t place:t
Except for `subject', all options are boolean, i.e., the accept the
values `nil' and `t'. `subject' accepts the values defined in
`scrlttr2`, i.e., `afteropening', `beforeopening', `centered', `left',
`right', `titled', `underlined', and `untitled'.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-21 10:34:35 -04:00
|
|
|
|
|
2013-07-22 10:46:02 -04:00
|
|
|
|
(defcustom org-koma-letter-use-phone nil
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
"Non-nil prints sender's phone number.
|
|
|
|
|
This option can also be set with the OPTIONS keyword, e.g.:
|
|
|
|
|
\"phone:t\"."
|
ox-koma-letter: Export options to control letter
* ox-koma-letter.el ((org-koma-letter-use-subject):
Configure printing of subject line.
(org-koma-letter-use-backaddress): Configure presence of back
address.
(org-koma-letter-use-foldmarks): Configure presence of foldmarks.
(org-koma-letter-use-phone): Configure printing of phone number.
(org-koma-letter-use-email): Configure printing of email.
(org-koma-letter-use-place): Configure printing of place.
(koma-letter): Add export option to exporter backend.
(org-koma-letter-template): Evaluate export options in
exporter template.
Usage:
#+OPTIONS: backaddress:t foldmarks:t subject:titled phone:t email:t place:t
Except for `subject', all options are boolean, i.e., the accept the
values `nil' and `t'. `subject' accepts the values defined in
`scrlttr2`, i.e., `afteropening', `beforeopening', `centered', `left',
`right', `titled', `underlined', and `untitled'.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-21 10:34:35 -04:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2017-07-13 21:14:52 -04:00
|
|
|
|
(defcustom org-koma-letter-use-url nil
|
|
|
|
|
"Non-nil prints sender's URL.
|
|
|
|
|
This option can also be set with the OPTIONS keyword, e.g.:
|
|
|
|
|
\"url:t\"."
|
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:safe #'booleanp)
|
|
|
|
|
|
2018-04-28 00:15:34 -04:00
|
|
|
|
(defcustom org-koma-letter-use-from-logo nil
|
|
|
|
|
"Non-nil prints sender's FROM_LOGO.
|
|
|
|
|
This option can also be set with the OPTIONS keyword, e.g.:
|
|
|
|
|
\"from-logo:t\"."
|
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'boolean
|
|
|
|
|
:safe #'booleanp)
|
|
|
|
|
|
2013-07-22 10:46:02 -04:00
|
|
|
|
(defcustom org-koma-letter-use-email nil
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
"Non-nil prints sender's email address.
|
|
|
|
|
This option can also be set with the OPTIONS keyword, e.g.:
|
|
|
|
|
\"email:t\"."
|
ox-koma-letter: Export options to control letter
* ox-koma-letter.el ((org-koma-letter-use-subject):
Configure printing of subject line.
(org-koma-letter-use-backaddress): Configure presence of back
address.
(org-koma-letter-use-foldmarks): Configure presence of foldmarks.
(org-koma-letter-use-phone): Configure printing of phone number.
(org-koma-letter-use-email): Configure printing of email.
(org-koma-letter-use-place): Configure printing of place.
(koma-letter): Add export option to exporter backend.
(org-koma-letter-template): Evaluate export options in
exporter template.
Usage:
#+OPTIONS: backaddress:t foldmarks:t subject:titled phone:t email:t place:t
Except for `subject', all options are boolean, i.e., the accept the
values `nil' and `t'. `subject' accepts the values defined in
`scrlttr2`, i.e., `afteropening', `beforeopening', `centered', `left',
`right', `titled', `underlined', and `untitled'.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-21 10:34:35 -04:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
|
|
|
|
(defcustom org-koma-letter-use-place t
|
ox-koma-letter: Improve defcustom docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-class-option-file,
org-koma-letter-author, org-koma-letter-email,
org-koma-letter-from-address, org-koma-letter-phone-number,
org-koma-letter-place, org-koma-letter-closing,
org-koma-letter-signature, org-koma-letter-prefer-special-headings,
org-koma-letter-use-backaddress, org-koma-letter-use-phone,
org-koma-letter-use-email, org-koma-letter-use-place): Improve
docstring.
2014-01-17 17:05:20 -05:00
|
|
|
|
"Non-nil prints the letter's place next to the date.
|
|
|
|
|
This option can also be set with the OPTIONS keyword, e.g.:
|
|
|
|
|
\"place:nil\"."
|
ox-koma-letter: Export options to control letter
* ox-koma-letter.el ((org-koma-letter-use-subject):
Configure printing of subject line.
(org-koma-letter-use-backaddress): Configure presence of back
address.
(org-koma-letter-use-foldmarks): Configure presence of foldmarks.
(org-koma-letter-use-phone): Configure printing of phone number.
(org-koma-letter-use-email): Configure printing of email.
(org-koma-letter-use-place): Configure printing of place.
(koma-letter): Add export option to exporter backend.
(org-koma-letter-template): Evaluate export options in
exporter template.
Usage:
#+OPTIONS: backaddress:t foldmarks:t subject:titled phone:t email:t place:t
Except for `subject', all options are boolean, i.e., the accept the
values `nil' and `t'. `subject' accepts the values defined in
`scrlttr2`, i.e., `afteropening', `beforeopening', `centered', `left',
`right', `titled', `underlined', and `untitled'.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-21 10:34:35 -04:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'boolean)
|
2013-04-21 07:41:22 -04:00
|
|
|
|
|
2014-01-17 05:22:37 -05:00
|
|
|
|
(defcustom org-koma-letter-default-class "default-koma-letter"
|
2013-08-17 16:50:47 -04:00
|
|
|
|
"Default class for `org-koma-letter'.
|
|
|
|
|
The value must be a member of `org-latex-classes'."
|
2013-06-02 11:59:48 -04:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
2013-08-17 14:24:36 -04:00
|
|
|
|
(defcustom org-koma-letter-headline-is-opening-maybe t
|
2015-08-29 08:02:42 -04:00
|
|
|
|
"Non-nil means a headline may be used as an opening and closing.
|
|
|
|
|
See also `org-koma-letter-opening' and
|
|
|
|
|
`org-koma-letter-closing'."
|
2013-08-17 14:24:36 -04:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2014-01-25 08:15:03 -05:00
|
|
|
|
(defcustom org-koma-letter-prefer-subject nil
|
2015-06-11 16:44:15 -04:00
|
|
|
|
"Non-nil means title should be interpreted as subject if subject is missing.
|
2014-01-25 08:15:03 -05:00
|
|
|
|
This option can also be set with the OPTIONS keyword,
|
2015-06-11 16:44:15 -04:00
|
|
|
|
e.g. \"title-subject:t\"."
|
2014-01-25 08:15:03 -05:00
|
|
|
|
:group 'org-export-koma-letter
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2016-01-27 13:18:38 -05:00
|
|
|
|
(defconst org-koma-letter-special-tags-in-letter '(to from closing location)
|
2013-08-17 16:50:47 -04:00
|
|
|
|
"Header tags related to the letter itself.")
|
2013-05-27 11:29:14 -04:00
|
|
|
|
|
2016-03-29 11:06:26 -04:00
|
|
|
|
(defconst org-koma-letter-special-tags-after-closing '(after_closing ps encl cc)
|
|
|
|
|
"Header tags to be inserted in the letter after closing.")
|
|
|
|
|
|
|
|
|
|
(defconst org-koma-letter-special-tags-as-macro '(ps encl cc)
|
|
|
|
|
"Header tags to be inserted as macros")
|
2013-05-26 10:14:51 -04:00
|
|
|
|
|
2013-05-27 11:29:14 -04:00
|
|
|
|
(defconst org-koma-letter-special-tags-after-letter '(after_letter)
|
2016-03-29 10:09:06 -04:00
|
|
|
|
"Header tags to be inserted after the letter.")
|
2013-05-26 10:14:51 -04:00
|
|
|
|
|
2013-05-27 11:29:14 -04:00
|
|
|
|
(defvar org-koma-letter-special-contents nil
|
2013-08-17 16:50:47 -04:00
|
|
|
|
"Holds special content temporarily.")
|
2013-05-26 10:14:51 -04:00
|
|
|
|
|
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 18:09:39 -05:00
|
|
|
|
(make-obsolete-variable 'org-koma-letter-use-title
|
|
|
|
|
'org-export-with-title
|
|
|
|
|
"25.1" 'set)
|
2013-05-26 10:14:51 -04:00
|
|
|
|
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
|
|
|
|
;;; Define Back-End
|
|
|
|
|
|
2013-03-19 11:26:30 -04:00
|
|
|
|
(org-export-define-derived-backend 'koma-letter 'latex
|
2012-11-26 02:55:27 -05:00
|
|
|
|
:options-alist
|
2014-01-22 09:50:54 -05:00
|
|
|
|
'((:latex-class "LATEX_CLASS" nil org-koma-letter-default-class t)
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(:lco "LCO" nil org-koma-letter-class-option-file)
|
2015-06-18 04:34:17 -04:00
|
|
|
|
(:author "AUTHOR" nil (org-koma-letter--get-value org-koma-letter-author) parse)
|
2013-07-22 10:46:02 -04:00
|
|
|
|
(:author-changed-in-buffer-p "AUTHOR" nil nil t)
|
2014-09-20 15:32:52 -04:00
|
|
|
|
(:from-address "FROM_ADDRESS" nil org-koma-letter-from-address newline)
|
2013-03-19 11:26:30 -04:00
|
|
|
|
(:phone-number "PHONE_NUMBER" nil org-koma-letter-phone-number)
|
2017-07-13 21:14:52 -04:00
|
|
|
|
(:url "URL" nil org-koma-letter-url)
|
2018-04-28 00:15:34 -04:00
|
|
|
|
(:from-logo "FROM_LOGO" nil org-koma-letter-from-logo)
|
2014-01-22 09:50:54 -05:00
|
|
|
|
(:email "EMAIL" nil (org-koma-letter--get-value org-koma-letter-email) t)
|
|
|
|
|
(:to-address "TO_ADDRESS" nil nil newline)
|
ox-koma-letter: Export options to control letter
* ox-koma-letter.el ((org-koma-letter-use-subject):
Configure printing of subject line.
(org-koma-letter-use-backaddress): Configure presence of back
address.
(org-koma-letter-use-foldmarks): Configure presence of foldmarks.
(org-koma-letter-use-phone): Configure printing of phone number.
(org-koma-letter-use-email): Configure printing of email.
(org-koma-letter-use-place): Configure printing of place.
(koma-letter): Add export option to exporter backend.
(org-koma-letter-template): Evaluate export options in
exporter template.
Usage:
#+OPTIONS: backaddress:t foldmarks:t subject:titled phone:t email:t place:t
Except for `subject', all options are boolean, i.e., the accept the
values `nil' and `t'. `subject' accepts the values defined in
`scrlttr2`, i.e., `afteropening', `beforeopening', `centered', `left',
`right', `titled', `underlined', and `untitled'.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-21 10:34:35 -04:00
|
|
|
|
(:place "PLACE" nil org-koma-letter-place)
|
2016-01-27 13:18:38 -05:00
|
|
|
|
(:location "LOCATION" nil org-koma-letter-location)
|
2015-04-05 08:06:59 -04:00
|
|
|
|
(:subject "SUBJECT" nil nil parse)
|
2015-06-18 04:34:17 -04:00
|
|
|
|
(:opening "OPENING" nil org-koma-letter-opening parse)
|
|
|
|
|
(:closing "CLOSING" nil org-koma-letter-closing parse)
|
ox-koma-letter: Export options to control letter
* ox-koma-letter.el ((org-koma-letter-use-subject):
Configure printing of subject line.
(org-koma-letter-use-backaddress): Configure presence of back
address.
(org-koma-letter-use-foldmarks): Configure presence of foldmarks.
(org-koma-letter-use-phone): Configure printing of phone number.
(org-koma-letter-use-email): Configure printing of email.
(org-koma-letter-use-place): Configure printing of place.
(koma-letter): Add export option to exporter backend.
(org-koma-letter-template): Evaluate export options in
exporter template.
Usage:
#+OPTIONS: backaddress:t foldmarks:t subject:titled phone:t email:t place:t
Except for `subject', all options are boolean, i.e., the accept the
values `nil' and `t'. `subject' accepts the values defined in
`scrlttr2`, i.e., `afteropening', `beforeopening', `centered', `left',
`right', `titled', `underlined', and `untitled'.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-21 10:34:35 -04:00
|
|
|
|
(:signature "SIGNATURE" nil org-koma-letter-signature newline)
|
2016-03-29 11:06:26 -04:00
|
|
|
|
(:special-headings nil "special-headings" org-koma-letter-prefer-special-headings)
|
|
|
|
|
(:special-tags-as-macro nil nil org-koma-letter-special-tags-as-macro)
|
|
|
|
|
(:special-tags-in-letter nil nil org-koma-letter-special-tags-in-letter)
|
|
|
|
|
(:special-tags-after-closing nil "after-closing-order"
|
|
|
|
|
org-koma-letter-special-tags-after-closing)
|
|
|
|
|
(:special-tags-after-letter nil "after-letter-order"
|
|
|
|
|
org-koma-letter-special-tags-after-letter)
|
ox-koma-letter: Export options to control letter
* ox-koma-letter.el ((org-koma-letter-use-subject):
Configure printing of subject line.
(org-koma-letter-use-backaddress): Configure presence of back
address.
(org-koma-letter-use-foldmarks): Configure presence of foldmarks.
(org-koma-letter-use-phone): Configure printing of phone number.
(org-koma-letter-use-email): Configure printing of email.
(org-koma-letter-use-place): Configure printing of place.
(koma-letter): Add export option to exporter backend.
(org-koma-letter-template): Evaluate export options in
exporter template.
Usage:
#+OPTIONS: backaddress:t foldmarks:t subject:titled phone:t email:t place:t
Except for `subject', all options are boolean, i.e., the accept the
values `nil' and `t'. `subject' accepts the values defined in
`scrlttr2`, i.e., `afteropening', `beforeopening', `centered', `left',
`right', `titled', `underlined', and `untitled'.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-21 10:34:35 -04:00
|
|
|
|
(:with-backaddress nil "backaddress" org-koma-letter-use-backaddress)
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(:with-email nil "email" org-koma-letter-use-email)
|
ox-koma-letter: Export options to control letter
* ox-koma-letter.el ((org-koma-letter-use-subject):
Configure printing of subject line.
(org-koma-letter-use-backaddress): Configure presence of back
address.
(org-koma-letter-use-foldmarks): Configure presence of foldmarks.
(org-koma-letter-use-phone): Configure printing of phone number.
(org-koma-letter-use-email): Configure printing of email.
(org-koma-letter-use-place): Configure printing of place.
(koma-letter): Add export option to exporter backend.
(org-koma-letter-template): Evaluate export options in
exporter template.
Usage:
#+OPTIONS: backaddress:t foldmarks:t subject:titled phone:t email:t place:t
Except for `subject', all options are boolean, i.e., the accept the
values `nil' and `t'. `subject' accepts the values defined in
`scrlttr2`, i.e., `afteropening', `beforeopening', `centered', `left',
`right', `titled', `underlined', and `untitled'.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-21 10:34:35 -04:00
|
|
|
|
(:with-foldmarks nil "foldmarks" org-koma-letter-use-foldmarks)
|
|
|
|
|
(:with-phone nil "phone" org-koma-letter-use-phone)
|
2017-07-13 21:14:52 -04:00
|
|
|
|
(:with-url nil "url" org-koma-letter-use-url)
|
2018-04-28 00:15:34 -04:00
|
|
|
|
(:with-from-logo nil "from-logo" org-koma-letter-use-from-logo)
|
ox-koma-letter: Export options to control letter
* ox-koma-letter.el ((org-koma-letter-use-subject):
Configure printing of subject line.
(org-koma-letter-use-backaddress): Configure presence of back
address.
(org-koma-letter-use-foldmarks): Configure presence of foldmarks.
(org-koma-letter-use-phone): Configure printing of phone number.
(org-koma-letter-use-email): Configure printing of email.
(org-koma-letter-use-place): Configure printing of place.
(koma-letter): Add export option to exporter backend.
(org-koma-letter-template): Evaluate export options in
exporter template.
Usage:
#+OPTIONS: backaddress:t foldmarks:t subject:titled phone:t email:t place:t
Except for `subject', all options are boolean, i.e., the accept the
values `nil' and `t'. `subject' accepts the values defined in
`scrlttr2`, i.e., `afteropening', `beforeopening', `centered', `left',
`right', `titled', `underlined', and `untitled'.
Signed-off-by: Alan Schmitt <alan.schmitt@polytechnique.org>
2013-04-21 10:34:35 -04:00
|
|
|
|
(:with-place nil "place" org-koma-letter-use-place)
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(:with-subject nil "subject" org-koma-letter-subject-format)
|
2014-01-25 08:15:03 -05:00
|
|
|
|
(:with-title-as-subject nil "title-subject" org-koma-letter-prefer-subject)
|
2015-03-19 07:10:30 -04:00
|
|
|
|
(:with-headline-opening nil nil org-koma-letter-headline-is-opening-maybe)
|
2014-01-16 18:57:51 -05:00
|
|
|
|
;; Special properties non-nil when a setting happened in buffer.
|
|
|
|
|
;; They are used to prioritize in-buffer settings over "lco"
|
|
|
|
|
;; files. See `org-koma-letter-template'.
|
2014-01-17 05:30:55 -05:00
|
|
|
|
(:inbuffer-author "AUTHOR" nil 'koma-letter:empty)
|
2016-03-29 11:20:08 -04:00
|
|
|
|
(:inbuffer-from "FROM" nil 'koma-letter:empty)
|
2014-01-17 05:30:55 -05:00
|
|
|
|
(:inbuffer-email "EMAIL" nil 'koma-letter:empty)
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(:inbuffer-phone-number "PHONE_NUMBER" nil 'koma-letter:empty)
|
2017-07-13 21:14:52 -04:00
|
|
|
|
(:inbuffer-url "URL" nil 'koma-letter:empty)
|
2018-04-28 00:15:34 -04:00
|
|
|
|
(:inbuffer-from-logo "FROM_LOGO" nil 'koma-letter:empty)
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(:inbuffer-place "PLACE" nil 'koma-letter:empty)
|
2016-01-27 13:18:38 -05:00
|
|
|
|
(:inbuffer-location "LOCATION" nil 'koma-letter:empty)
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(:inbuffer-signature "SIGNATURE" nil 'koma-letter:empty)
|
|
|
|
|
(:inbuffer-with-backaddress nil "backaddress" 'koma-letter:empty)
|
|
|
|
|
(:inbuffer-with-email nil "email" 'koma-letter:empty)
|
|
|
|
|
(:inbuffer-with-foldmarks nil "foldmarks" 'koma-letter:empty)
|
2015-09-10 08:21:49 -04:00
|
|
|
|
(:inbuffer-with-phone nil "phone" 'koma-letter:empty)
|
2017-07-13 21:14:52 -04:00
|
|
|
|
(:inbuffer-with-url nil "url" 'koma-letter:empty)
|
2018-04-28 00:15:34 -04:00
|
|
|
|
(:inbuffer-with-from-logo nil "from-logo" 'koma-letter:empty)
|
2016-04-05 09:28:12 -04:00
|
|
|
|
(:inbuffer-with-place nil "place" 'koma-letter:empty))
|
2013-03-19 11:26:30 -04:00
|
|
|
|
:translate-alist '((export-block . org-koma-letter-export-block)
|
2016-04-05 09:28:12 -04:00
|
|
|
|
(export-snippet . org-koma-letter-export-snippet)
|
|
|
|
|
(headline . org-koma-letter-headline)
|
|
|
|
|
(keyword . org-koma-letter-keyword)
|
|
|
|
|
(template . org-koma-letter-template))
|
2012-11-26 02:55:27 -05:00
|
|
|
|
:menu-entry
|
2013-03-19 11:26:30 -04:00
|
|
|
|
'(?k "Export with KOMA Scrlttr2"
|
2013-04-21 07:40:09 -04:00
|
|
|
|
((?L "As LaTeX buffer" org-koma-letter-export-as-latex)
|
|
|
|
|
(?l "As LaTeX file" org-koma-letter-export-to-latex)
|
2013-03-19 11:26:30 -04:00
|
|
|
|
(?p "As PDF file" org-koma-letter-export-to-pdf)
|
2013-04-21 07:40:09 -04:00
|
|
|
|
(?o "As PDF file and open"
|
2013-03-19 11:26:30 -04:00
|
|
|
|
(lambda (a s v b)
|
|
|
|
|
(if a (org-koma-letter-export-to-pdf t s v b)
|
|
|
|
|
(org-open-file (org-koma-letter-export-to-pdf nil s v b))))))))
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
2014-01-16 18:57:51 -05:00
|
|
|
|
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
2013-05-26 10:13:39 -04:00
|
|
|
|
;;; Helper functions
|
|
|
|
|
|
|
|
|
|
(defun org-koma-letter-email ()
|
2013-08-17 16:50:47 -04:00
|
|
|
|
"Return the current `user-mail-address'."
|
2013-05-26 10:13:39 -04:00
|
|
|
|
user-mail-address)
|
|
|
|
|
|
2013-05-26 10:14:51 -04:00
|
|
|
|
;; The following is taken from/inspired by ox-grof.el
|
|
|
|
|
;; Thanks, Luis!
|
|
|
|
|
|
2013-05-27 11:29:14 -04:00
|
|
|
|
(defun org-koma-letter--get-tagged-contents (key)
|
2013-08-17 16:50:47 -04:00
|
|
|
|
"Get contents from a headline tagged with KEY.
|
ox-koma-letter: Cleanup some docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-author,
org-koma-letter-email, org-koma-letter-place,
org-koma-letter-prefer-special-headings, org-koma-letter-signature,
org-koma-letter-subject-format, org-koma-letter-use-backaddress,
org-koma-letter-use-phone, org-koma-letter-use-email,
org-koma-letter-use-place,
org-koma-letter-headline-is-opening-maybe,
org-koma-letter--get-tagged-contents,
org-koma-letter--format-string-as-macro,
org-koma-letter--normalize-string): Cleanup docstrings.
2014-01-16 12:18:21 -05:00
|
|
|
|
The contents is stored in `org-koma-letter-special-contents'."
|
2016-03-31 15:38:54 -04:00
|
|
|
|
(let ((value (cdr (assoc-string (org-koma-letter--get-value key)
|
|
|
|
|
org-koma-letter-special-contents))))
|
|
|
|
|
(when value (org-string-nw-p (org-trim value)))))
|
2013-05-26 10:13:39 -04:00
|
|
|
|
|
2013-08-17 16:50:47 -04:00
|
|
|
|
(defun org-koma-letter--get-value (value)
|
ox-koma-letter: Cleanup some docstrings
* contrib/lisp/ox-koma-letter.el (org-koma-letter-author,
org-koma-letter-email, org-koma-letter-place,
org-koma-letter-prefer-special-headings, org-koma-letter-signature,
org-koma-letter-subject-format, org-koma-letter-use-backaddress,
org-koma-letter-use-phone, org-koma-letter-use-email,
org-koma-letter-use-place,
org-koma-letter-headline-is-opening-maybe,
org-koma-letter--get-tagged-contents,
org-koma-letter--format-string-as-macro,
org-koma-letter--normalize-string): Cleanup docstrings.
2014-01-16 12:18:21 -05:00
|
|
|
|
"Turn value into a string whenever possible.
|
|
|
|
|
Determines if VALUE is nil, a string, a function or a symbol and
|
|
|
|
|
return a string or nil."
|
2013-05-26 10:13:39 -04:00
|
|
|
|
(when value
|
|
|
|
|
(cond ((stringp value) value)
|
|
|
|
|
((functionp value) (funcall value))
|
2013-05-27 11:29:14 -04:00
|
|
|
|
((symbolp value) (symbol-name value))
|
|
|
|
|
(t value))))
|
2013-05-26 10:13:39 -04:00
|
|
|
|
|
2016-03-29 11:06:26 -04:00
|
|
|
|
(defun org-koma-letter--special-contents-inline (keywords info)
|
2015-06-18 09:31:09 -04:00
|
|
|
|
"Process KEYWORDS members of `org-koma-letter-special-contents'.
|
2014-01-17 06:49:24 -05:00
|
|
|
|
KEYWORDS is a list of symbols. Return them as a string to be
|
|
|
|
|
formatted.
|
2013-05-26 10:13:39 -04:00
|
|
|
|
|
2014-01-17 06:49:24 -05:00
|
|
|
|
The function is used for inserting content of special headings
|
2016-03-29 11:06:26 -04:00
|
|
|
|
such as the one tagged with PS.
|
|
|
|
|
"
|
2014-01-17 06:49:24 -05:00
|
|
|
|
(mapconcat
|
2015-06-18 09:31:09 -04:00
|
|
|
|
(lambda (keyword)
|
|
|
|
|
(let* ((name (org-koma-letter--get-value keyword))
|
2016-03-29 11:06:26 -04:00
|
|
|
|
(value (org-koma-letter--get-tagged-contents name))
|
|
|
|
|
(macrop (memq keyword (plist-get info :special-tags-as-macro))))
|
2015-06-18 09:31:09 -04:00
|
|
|
|
(cond ((not value) nil)
|
2016-03-29 11:06:26 -04:00
|
|
|
|
(macrop (format "\\%s{%s}\n" name value))
|
|
|
|
|
(t value))))
|
2014-01-17 06:49:24 -05:00
|
|
|
|
keywords
|
2016-03-29 11:20:08 -04:00
|
|
|
|
"\n"))
|
2013-05-27 11:29:14 -04:00
|
|
|
|
|
2013-08-17 16:50:47 -04:00
|
|
|
|
|
2016-03-29 11:20:08 -04:00
|
|
|
|
(defun org-koma-letter--add-latex-newlines (string)
|
|
|
|
|
"Replace regular newlines with LaTeX newlines (i.e. `\\\\')"
|
|
|
|
|
(let ((str (org-trim string)))
|
|
|
|
|
(when (org-string-nw-p str)
|
|
|
|
|
(replace-regexp-in-string "\n" "\\\\\\\\\n" str))))
|
2014-01-17 06:49:24 -05:00
|
|
|
|
|
2013-06-01 13:52:36 -04:00
|
|
|
|
|
2014-01-17 06:49:24 -05:00
|
|
|
|
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;;; Transcode Functions
|
|
|
|
|
|
2014-09-08 05:57:27 -04:00
|
|
|
|
;;;; Export Block
|
|
|
|
|
|
|
|
|
|
(defun org-koma-letter-export-block (export-block contents info)
|
|
|
|
|
"Transcode an EXPORT-BLOCK element into KOMA Scrlttr2 code.
|
|
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
|
|
channel."
|
|
|
|
|
(when (member (org-element-property :type export-block) '("KOMA-LETTER" "LATEX"))
|
|
|
|
|
(org-remove-indentation (org-element-property :value export-block))))
|
|
|
|
|
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;;;; Export Snippet
|
|
|
|
|
|
|
|
|
|
(defun org-koma-letter-export-snippet (export-snippet contents info)
|
|
|
|
|
"Transcode an EXPORT-SNIPPET object into KOMA Scrlttr2 code.
|
|
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
|
|
channel."
|
2013-02-08 17:07:36 -05:00
|
|
|
|
(when (memq (org-export-snippet-backend export-snippet) '(latex koma-letter))
|
2012-11-26 02:55:27 -05:00
|
|
|
|
(org-element-property :value export-snippet)))
|
|
|
|
|
|
|
|
|
|
;;;; Keyword
|
|
|
|
|
|
|
|
|
|
(defun org-koma-letter-keyword (keyword contents info)
|
|
|
|
|
"Transcode a KEYWORD element into KOMA Scrlttr2 code.
|
|
|
|
|
CONTENTS is nil. INFO is a plist used as a communication
|
|
|
|
|
channel."
|
|
|
|
|
(let ((key (org-element-property :key keyword))
|
2013-06-01 13:52:36 -04:00
|
|
|
|
(value (org-element-property :value keyword)))
|
2014-01-17 16:30:39 -05:00
|
|
|
|
;; Handle specifically KOMA-LETTER keywords. Otherwise, fallback
|
|
|
|
|
;; to `latex' back-end.
|
2012-11-26 02:55:27 -05:00
|
|
|
|
(if (equal key "KOMA-LETTER") value
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(org-export-with-backend 'latex keyword contents info))))
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
2013-05-26 10:14:51 -04:00
|
|
|
|
;; Headline
|
|
|
|
|
|
|
|
|
|
(defun org-koma-letter-headline (headline contents info)
|
|
|
|
|
"Transcode a HEADLINE element from Org to LaTeX.
|
|
|
|
|
CONTENTS holds the contents of the headline. INFO is a plist
|
|
|
|
|
holding contextual information.
|
|
|
|
|
|
|
|
|
|
Note that if a headline is tagged with a tag from
|
|
|
|
|
`org-koma-letter-special-tags' it will not be exported, but
|
|
|
|
|
stored in `org-koma-letter-special-contents' and included at the
|
|
|
|
|
appropriate place."
|
2015-03-19 07:10:30 -04:00
|
|
|
|
(let ((special-tag (org-koma-letter--special-tag headline info)))
|
|
|
|
|
(if (not special-tag)
|
|
|
|
|
contents
|
|
|
|
|
(push (cons special-tag contents) org-koma-letter-special-contents)
|
|
|
|
|
"")))
|
|
|
|
|
|
|
|
|
|
(defun org-koma-letter--special-tag (headline info)
|
|
|
|
|
"Non-nil if HEADLINE is a special headline.
|
|
|
|
|
INFO is a plist holding contextual information. Return first
|
|
|
|
|
special tag headline."
|
2016-03-29 11:06:26 -04:00
|
|
|
|
(let ((special-tags (append
|
|
|
|
|
(plist-get info :special-tags-in-letter)
|
|
|
|
|
(plist-get info :special-tags-after-closing)
|
|
|
|
|
(plist-get info :special-tags-after-letter))))
|
2015-03-19 07:10:30 -04:00
|
|
|
|
(catch 'exit
|
|
|
|
|
(dolist (tag (org-export-get-tags headline info))
|
|
|
|
|
(let ((tag (assoc-string tag special-tags)))
|
|
|
|
|
(when tag (throw 'exit tag)))))))
|
2013-05-26 10:14:51 -04:00
|
|
|
|
|
2015-08-29 08:02:42 -04:00
|
|
|
|
(defun org-koma-letter--keyword-or-headline (plist-key pred info)
|
|
|
|
|
"Return the correct version of opening or closing.
|
|
|
|
|
PLIST-KEY should be a key in info, typically :opening
|
|
|
|
|
or :closing. PRED is a predicate run on headline to determine
|
|
|
|
|
which title to use which takes two arguments, a headline element
|
|
|
|
|
and an info plist. INFO is a plist holding contextual
|
|
|
|
|
information. Return the preferred candidate for the exported of
|
|
|
|
|
PLIST-KEY."
|
|
|
|
|
(let* ((keyword-candidate (plist-get info plist-key))
|
|
|
|
|
(headline-candidate (when (and (plist-get info :with-headline-opening)
|
|
|
|
|
(or (plist-get info :special-headings)
|
|
|
|
|
(not keyword-candidate)))
|
|
|
|
|
(org-element-map (plist-get info :parse-tree)
|
|
|
|
|
'headline
|
|
|
|
|
(lambda (head)
|
|
|
|
|
(when (funcall pred head info)
|
|
|
|
|
(org-element-property :title head)))
|
|
|
|
|
info t))))
|
|
|
|
|
(org-export-data (or headline-candidate keyword-candidate "") info)))
|
|
|
|
|
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;;;; Template
|
|
|
|
|
|
|
|
|
|
(defun org-koma-letter-template (contents info)
|
|
|
|
|
"Return complete document string after KOMA Scrlttr2 conversion.
|
|
|
|
|
CONTENTS is the transcoded contents string. INFO is a plist
|
|
|
|
|
holding export options."
|
|
|
|
|
(concat
|
|
|
|
|
;; Time-stamp.
|
|
|
|
|
(and (plist-get info :time-stamp-file)
|
|
|
|
|
(format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
|
2015-10-03 14:18:38 -04:00
|
|
|
|
;; LaTeX compiler
|
|
|
|
|
(org-latex--insert-compiler info)
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;; Document class and packages.
|
2017-01-21 05:31:25 -05:00
|
|
|
|
(org-latex-make-preamble info)
|
2014-01-17 04:39:05 -05:00
|
|
|
|
;; Settings. They can come from three locations, in increasing
|
|
|
|
|
;; order of precedence: global variables, LCO files and in-buffer
|
|
|
|
|
;; settings. Thus, we first insert settings coming from global
|
|
|
|
|
;; variables, then we insert LCO files, and, eventually, we insert
|
|
|
|
|
;; settings coming from buffer keywords.
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(org-koma-letter--build-settings 'global info)
|
2017-09-07 08:34:25 -04:00
|
|
|
|
(mapconcat (lambda (file) (format "\\LoadLetterOption{%s}\n" file))
|
|
|
|
|
(split-string (or (plist-get info :lco) ""))
|
2014-01-16 18:57:51 -05:00
|
|
|
|
"")
|
|
|
|
|
(org-koma-letter--build-settings 'buffer info)
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;; Date.
|
2013-04-02 18:02:15 -04:00
|
|
|
|
(format "\\date{%s}\n" (org-export-data (org-export-get-date info) info))
|
2015-03-27 08:46:08 -04:00
|
|
|
|
;; Hyperref, document start, and subject and title.
|
2015-06-11 16:44:39 -04:00
|
|
|
|
(let* ((with-subject (plist-get info :with-subject))
|
2015-06-15 12:49:24 -04:00
|
|
|
|
(with-title (plist-get info :with-title))
|
2015-06-11 16:44:39 -04:00
|
|
|
|
(title-as-subject (and with-subject
|
|
|
|
|
(plist-get info :with-title-as-subject)))
|
|
|
|
|
(subject* (org-string-nw-p
|
|
|
|
|
(org-export-data (plist-get info :subject) info)))
|
2015-06-15 12:49:24 -04:00
|
|
|
|
(title* (and with-title
|
2015-06-11 16:44:39 -04:00
|
|
|
|
(org-string-nw-p
|
|
|
|
|
(org-export-data (plist-get info :title) info))))
|
|
|
|
|
(subject (cond ((not with-subject) nil)
|
|
|
|
|
(title-as-subject (or subject* title*))
|
|
|
|
|
(t subject*)))
|
|
|
|
|
(title (cond ((not with-title) nil)
|
|
|
|
|
(title-as-subject (and subject* title*))
|
|
|
|
|
(t title*)))
|
|
|
|
|
(hyperref-template (plist-get info :latex-hyperref-template))
|
|
|
|
|
(spec (append (list (cons ?t (or title subject "")))
|
|
|
|
|
(org-latex--format-spec info))))
|
|
|
|
|
(concat
|
|
|
|
|
(when (and with-subject (not (eq with-subject t)))
|
|
|
|
|
(format "\\KOMAoption{subject}{%s}\n"
|
|
|
|
|
(if (symbolp with-subject) with-subject
|
|
|
|
|
(mapconcat #'symbol-name with-subject ","))))
|
|
|
|
|
;; Hyperref.
|
|
|
|
|
(format-spec hyperref-template spec)
|
|
|
|
|
;; Document start.
|
|
|
|
|
"\\begin{document}\n\n"
|
|
|
|
|
;; Subject and title.
|
|
|
|
|
(when subject (format "\\setkomavar{subject}{%s}\n" subject))
|
|
|
|
|
(when title (format "\\setkomavar{title}{%s}\n" title))
|
|
|
|
|
(when (or (org-string-nw-p title) (org-string-nw-p subject)) "\n")))
|
2014-01-16 18:57:51 -05:00
|
|
|
|
;; Letter start.
|
2016-03-29 11:20:08 -04:00
|
|
|
|
(let ((keyword-val (plist-get info :to-address))
|
|
|
|
|
(heading-val (org-koma-letter--get-tagged-contents 'to)))
|
|
|
|
|
(format "\\begin{letter}{%%\n%s}\n\n"
|
|
|
|
|
(org-koma-letter--add-latex-newlines
|
|
|
|
|
(or (if (plist-get info :special-headings)
|
|
|
|
|
(or heading-val keyword-val)
|
|
|
|
|
(or keyword-val heading-val))
|
2017-10-14 05:03:41 -04:00
|
|
|
|
"\\mbox{}"))))
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;; Opening.
|
2015-03-19 07:10:30 -04:00
|
|
|
|
(format "\\opening{%s}\n\n"
|
2015-08-29 08:02:42 -04:00
|
|
|
|
(org-koma-letter--keyword-or-headline
|
|
|
|
|
:opening (lambda (h i) (not (org-koma-letter--special-tag h i)))
|
2015-03-19 07:10:30 -04:00
|
|
|
|
info))
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;; Letter body.
|
|
|
|
|
contents
|
|
|
|
|
;; Closing.
|
2015-08-29 08:02:42 -04:00
|
|
|
|
(format "\\closing{%s}\n"
|
|
|
|
|
(org-koma-letter--keyword-or-headline
|
|
|
|
|
:closing (lambda (h i) (eq (org-koma-letter--special-tag h i)
|
2017-10-14 05:03:41 -04:00
|
|
|
|
'closing))
|
2015-07-15 18:38:06 -04:00
|
|
|
|
info))
|
2016-03-29 11:06:26 -04:00
|
|
|
|
(org-koma-letter--special-contents-inline
|
|
|
|
|
(plist-get info :special-tags-after-closing) info)
|
2012-11-26 02:55:27 -05:00
|
|
|
|
;; Letter end.
|
2013-05-26 10:14:51 -04:00
|
|
|
|
"\n\\end{letter}\n"
|
2016-03-29 11:06:26 -04:00
|
|
|
|
(org-koma-letter--special-contents-inline
|
|
|
|
|
(plist-get info :special-tags-after-letter) info)
|
2013-05-26 10:14:51 -04:00
|
|
|
|
;; Document end.
|
2014-01-16 18:57:51 -05:00
|
|
|
|
"\n\\end{document}"))
|
|
|
|
|
|
2014-01-17 04:39:05 -05:00
|
|
|
|
(defun org-koma-letter--build-settings (scope info)
|
2014-01-16 18:57:51 -05:00
|
|
|
|
"Build settings string according to type.
|
2014-01-17 04:39:05 -05:00
|
|
|
|
SCOPE is either `global' or `buffer'. INFO is a plist used as
|
2014-01-16 18:57:51 -05:00
|
|
|
|
a communication channel."
|
2016-03-29 11:20:08 -04:00
|
|
|
|
(let* ((check-scope
|
|
|
|
|
(function
|
|
|
|
|
;; Non-nil value when SETTING was defined in SCOPE.
|
|
|
|
|
(lambda (setting)
|
|
|
|
|
(let ((property (intern (format ":inbuffer-%s" setting))))
|
|
|
|
|
(if (eq scope 'global)
|
|
|
|
|
(eq (plist-get info property) 'koma-letter:empty)
|
|
|
|
|
(not (eq (plist-get info property) 'koma-letter:empty)))))))
|
|
|
|
|
(heading-or-key-value
|
|
|
|
|
(function
|
|
|
|
|
(lambda (heading key &optional scoped)
|
|
|
|
|
(let* ((heading-val
|
|
|
|
|
(org-koma-letter--get-tagged-contents heading))
|
|
|
|
|
(key-val (org-string-nw-p (plist-get info key)))
|
|
|
|
|
(scopedp (funcall check-scope (or scoped heading))))
|
|
|
|
|
(and (or (and key-val scopedp) heading-val)
|
|
|
|
|
(not (and (eq scope 'global) heading-val))
|
|
|
|
|
(if scopedp key-val heading-val)))))))
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(concat
|
2014-01-17 04:39:05 -05:00
|
|
|
|
;; Name.
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(let ((author (plist-get info :author)))
|
|
|
|
|
(and author
|
2014-01-17 04:39:05 -05:00
|
|
|
|
(funcall check-scope 'author)
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(format "\\setkomavar{fromname}{%s}\n"
|
|
|
|
|
(org-export-data author info))))
|
2016-03-29 11:20:08 -04:00
|
|
|
|
;; From.
|
|
|
|
|
(let ((from (funcall heading-or-key-value 'from :from-address)))
|
|
|
|
|
(and from
|
|
|
|
|
(format "\\setkomavar{fromaddress}{%s}\n"
|
|
|
|
|
(org-koma-letter--add-latex-newlines from))))
|
2014-01-17 04:39:05 -05:00
|
|
|
|
;; Email.
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(let ((email (plist-get info :email)))
|
|
|
|
|
(and email
|
2014-01-17 04:39:05 -05:00
|
|
|
|
(funcall check-scope 'email)
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(format "\\setkomavar{fromemail}{%s}\n" email)))
|
2014-01-17 04:39:05 -05:00
|
|
|
|
(and (funcall check-scope 'with-email)
|
|
|
|
|
(format "\\KOMAoption{fromemail}{%s}\n"
|
|
|
|
|
(if (plist-get info :with-email) "true" "false")))
|
|
|
|
|
;; Phone number.
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(let ((phone-number (plist-get info :phone-number)))
|
|
|
|
|
(and (org-string-nw-p phone-number)
|
2014-01-17 04:39:05 -05:00
|
|
|
|
(funcall check-scope 'phone-number)
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(format "\\setkomavar{fromphone}{%s}\n" phone-number)))
|
2014-01-17 04:39:05 -05:00
|
|
|
|
(and (funcall check-scope 'with-phone)
|
|
|
|
|
(format "\\KOMAoption{fromphone}{%s}\n"
|
|
|
|
|
(if (plist-get info :with-phone) "true" "false")))
|
2017-07-13 21:14:52 -04:00
|
|
|
|
;; URL
|
|
|
|
|
(let ((url (plist-get info :url)))
|
|
|
|
|
(and (org-string-nw-p url)
|
|
|
|
|
(funcall check-scope 'url)
|
|
|
|
|
(format "\\setkomavar{fromurl}{%s}\n" url)))
|
|
|
|
|
(and (funcall check-scope 'with-url)
|
|
|
|
|
(format "\\KOMAoption{fromurl}{%s}\n"
|
|
|
|
|
(if (plist-get info :with-url) "true" "false")))
|
2018-04-28 00:15:34 -04:00
|
|
|
|
;; From Logo
|
|
|
|
|
(let ((from-logo (plist-get info :from-logo)))
|
|
|
|
|
(and (org-string-nw-p from-logo)
|
|
|
|
|
(funcall check-scope 'from-logo)
|
|
|
|
|
(format "\\setkomavar{fromlogo}{%s}\n" from-logo)))
|
|
|
|
|
(and (funcall check-scope 'with-from-logo)
|
|
|
|
|
(format "\\KOMAoption{fromlogo}{%s}\n"
|
|
|
|
|
(if (plist-get info :with-from-logo) "true" "false")))
|
2014-01-17 04:39:05 -05:00
|
|
|
|
;; Signature.
|
2016-04-05 09:28:12 -04:00
|
|
|
|
(let* ((heading-val
|
|
|
|
|
(and (plist-get info :with-headline-opening)
|
|
|
|
|
(org-string-nw-p
|
|
|
|
|
(org-trim
|
|
|
|
|
(org-export-data
|
|
|
|
|
(org-koma-letter--get-tagged-contents 'closing)
|
|
|
|
|
info)))))
|
|
|
|
|
(signature (org-string-nw-p (plist-get info :signature)))
|
|
|
|
|
(signature-scope (funcall check-scope 'signature)))
|
|
|
|
|
(and (or (and signature signature-scope)
|
|
|
|
|
heading-val)
|
|
|
|
|
(not (and (eq scope 'global) heading-val))
|
|
|
|
|
(format "\\setkomavar{signature}{%s}\n"
|
|
|
|
|
(if signature-scope signature heading-val))))
|
2014-01-17 04:39:05 -05:00
|
|
|
|
;; Back address.
|
|
|
|
|
(and (funcall check-scope 'with-backaddress)
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(format "\\KOMAoption{backaddress}{%s}\n"
|
|
|
|
|
(if (plist-get info :with-backaddress) "true" "false")))
|
2014-01-17 04:39:05 -05:00
|
|
|
|
;; Place.
|
2016-04-05 09:28:12 -04:00
|
|
|
|
(let ((with-place-set (funcall check-scope 'with-place))
|
2015-09-10 08:21:49 -04:00
|
|
|
|
(place-set (funcall check-scope 'place)))
|
2016-04-05 09:28:12 -04:00
|
|
|
|
(and (or (and with-place-set place-set)
|
|
|
|
|
(and (eq scope 'buffer) (or with-place-set place-set)))
|
|
|
|
|
(format "\\setkomavar{place}{%s}\n"
|
|
|
|
|
(if (plist-get info :with-place) (plist-get info :place)
|
|
|
|
|
""))))
|
2016-01-27 13:18:38 -05:00
|
|
|
|
;; Location.
|
2016-04-05 09:28:12 -04:00
|
|
|
|
(let ((location (funcall heading-or-key-value 'location :location)))
|
|
|
|
|
(and location
|
|
|
|
|
(format "\\setkomavar{location}{%s}\n" location)))
|
2014-01-17 04:39:05 -05:00
|
|
|
|
;; Folding marks.
|
|
|
|
|
(and (funcall check-scope 'with-foldmarks)
|
2014-01-16 18:57:51 -05:00
|
|
|
|
(let ((foldmarks (plist-get info :with-foldmarks)))
|
2014-01-17 05:01:15 -05:00
|
|
|
|
(cond ((consp foldmarks)
|
|
|
|
|
(format "\\KOMAoptions{foldmarks=true,foldmarks=%s}\n"
|
|
|
|
|
(mapconcat #'symbol-name foldmarks "")))
|
|
|
|
|
(foldmarks "\\KOMAoptions{foldmarks=true}\n")
|
|
|
|
|
(t "\\KOMAoptions{foldmarks=false}\n")))))))
|
2014-01-16 18:57:51 -05:00
|
|
|
|
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Commands
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
|
(defun org-koma-letter-export-as-latex
|
2012-12-14 10:55:17 -05:00
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2012-11-26 02:55:27 -05:00
|
|
|
|
"Export current buffer as a KOMA Scrlttr2 letter.
|
|
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
2012-12-14 10:55:17 -05: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-11-26 02:55:27 -05: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{letter}\" and \"\\end{letter}\".
|
|
|
|
|
|
2013-05-26 10:14:51 -04:00
|
|
|
|
EXT-PLIST, when provided, is a proeprty list with external
|
2012-11-26 02:55:27 -05:00
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
|
file-local settings.
|
|
|
|
|
|
|
|
|
|
Export is done in a buffer named \"*Org KOMA-LETTER Export*\". It
|
|
|
|
|
will be displayed if `org-export-show-temporary-export-buffer' is
|
|
|
|
|
non-nil."
|
|
|
|
|
(interactive)
|
2013-05-26 10:14:51 -04:00
|
|
|
|
(let (org-koma-letter-special-contents)
|
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 04:35:42 -04:00
|
|
|
|
(org-export-to-buffer 'koma-letter "*Org KOMA-LETTER Export*"
|
|
|
|
|
async subtreep visible-only body-only ext-plist
|
|
|
|
|
(lambda () (LaTeX-mode)))))
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
|
(defun org-koma-letter-export-to-latex
|
2012-12-14 10:55:17 -05:00
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2012-11-26 02:55:27 -05:00
|
|
|
|
"Export current buffer as a KOMA Scrlttr2 letter (tex).
|
|
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
2012-12-14 10:55:17 -05: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-11-26 02:55:27 -05: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{letter}\" and \"\\end{letter}\".
|
|
|
|
|
|
|
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
|
file-local settings.
|
|
|
|
|
|
|
|
|
|
When optional argument PUB-DIR is set, use it as the publishing
|
|
|
|
|
directory.
|
|
|
|
|
|
|
|
|
|
Return output file's name."
|
|
|
|
|
(interactive)
|
2013-05-27 11:29:14 -04:00
|
|
|
|
(let ((outfile (org-export-output-file-name ".tex" subtreep))
|
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 04:35:42 -04:00
|
|
|
|
(org-koma-letter-special-contents))
|
|
|
|
|
(org-export-to-file 'koma-letter outfile
|
|
|
|
|
async subtreep visible-only body-only ext-plist)))
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
|
(defun org-koma-letter-export-to-pdf
|
2012-12-14 10:55:17 -05:00
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2012-11-26 02:55:27 -05:00
|
|
|
|
"Export current buffer as a KOMA Scrlttr2 letter (pdf).
|
|
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
2012-12-14 10:55:17 -05: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-11-26 02:55:27 -05: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{letter}\" and \"\\end{letter}\".
|
|
|
|
|
|
|
|
|
|
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 04:35:42 -04:00
|
|
|
|
(let ((file (org-export-output-file-name ".tex" subtreep))
|
|
|
|
|
(org-koma-letter-special-contents))
|
|
|
|
|
(org-export-to-file 'koma-letter file
|
|
|
|
|
async subtreep visible-only body-only ext-plist
|
|
|
|
|
(lambda (file) (org-latex-compile file)))))
|
2012-12-14 10:55:17 -05:00
|
|
|
|
|
2012-11-26 02:55:27 -05:00
|
|
|
|
|
2013-01-27 17:11:34 -05:00
|
|
|
|
(provide 'ox-koma-letter)
|
|
|
|
|
;;; ox-koma-letter.el ends here
|