ox-koma-letter.el 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. ;;; ox-koma-letter.el --- KOMA Scrlttr2 Back-End for Org Export Engine
  2. ;; Copyright (C) 2007-2012 Free Software Foundation, Inc.
  3. ;; Author: Nicolas Goaziou <n.goaziou AT gmail DOT com>
  4. ;; Alan Schmitt <alan.schmitt AT polytechnique DOT org>
  5. ;; Keywords: org, wp, tex
  6. ;; This program is free software: you can redistribute it and/or modify
  7. ;; it under the terms of the GNU General Public License as published by
  8. ;; the Free Software Foundation, either version 3 of the License, or
  9. ;; (at your option) any later version.
  10. ;; This program is distributed in the hope that it will be useful,
  11. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ;; GNU General Public License for more details.
  14. ;; You should have received a copy of the GNU General Public License
  15. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  16. ;;; Commentary:
  17. ;;
  18. ;; This library implements a KOMA Scrlttr2 back-end, derived from the
  19. ;; LaTeX one.
  20. ;;
  21. ;; Depending on the desired output format, three commands are provided
  22. ;; for export: `org-koma-letter-export-as-latex' (temporary buffer),
  23. ;; `org-koma-letter-export-to-latex' ("tex" file) and
  24. ;; `org-koma-letter-export-to-pdf' ("pdf" file).
  25. ;;
  26. ;; On top of buffer keywords supported by `latex' back-end (see
  27. ;; `org-latex-options-alist'), this back-end introduces the following
  28. ;; keywords: "CLOSING" (see `org-koma-letter-closing'), "FROM_ADDRESS"
  29. ;; (see `org-koma-letter-from-address'), "LCO" (see
  30. ;; `org-koma-letter-class-option-file'), "OPENING" (see
  31. ;; `org-koma-letter-opening'), "PHONE_NUMBER" (see
  32. ;; `org-koma-letter-phone-number'), "SIGNATURE" (see
  33. ;; `org-koma-letter-signature') and "TO_ADDRESS".
  34. ;;
  35. ;; You will need to add an appropriate association in
  36. ;; `org-latex-classes' in order to use the KOMA Scrlttr2 class. For
  37. ;; example, you can use the following code:
  38. ;;
  39. ;; (add-to-list 'org-latex-classes
  40. ;; '("my-letter"
  41. ;; "\\documentclass\[%
  42. ;; DIV=14,
  43. ;; fontsize=12pt,
  44. ;; parskip=half,
  45. ;; subject=titled,
  46. ;; backaddress=false,
  47. ;; fromalign=left,
  48. ;; fromemail=true,
  49. ;; fromphone=true\]\{scrlttr2\}
  50. ;; \[DEFAULT-PACKAGES]
  51. ;; \[PACKAGES]
  52. ;; \[EXTRA]"))
  53. ;;
  54. ;; Then, in your Org document, be sure to require the proper class
  55. ;; with :
  56. ;;
  57. ;; #+LATEX_CLASS: my-letter
  58. ;;; Code:
  59. (require 'ox-latex)
  60. ;;; User-Configurable Variables
  61. (defgroup org-export-koma-letter nil
  62. "Options for exporting to KOMA scrlttr2 class in LaTeX export."
  63. :tag "Org Koma-Letter"
  64. :group 'org-export)
  65. (defcustom org-koma-letter-class-option-file "NF"
  66. "Letter Class Option File."
  67. :group 'org-export-koma-letter
  68. :type 'string)
  69. (defcustom org-koma-letter-author 'user-full-name
  70. "The sender's name.
  71. This variable defaults to calling the function `user-full-name'
  72. which just returns the current `user-full-name'. Alternatively a
  73. string, nil or a function may be given. Functions must return a
  74. string."
  75. :group 'org-export-koma-letter
  76. :type '(radio (function-item user-full-name)
  77. (string)
  78. (function)
  79. (const nil)))
  80. (defcustom org-koma-letter-email 'org-koma-letter-email
  81. "The sender's email address.
  82. This variable defaults to the value `org-koma-letter-email' which
  83. returns `user-mail-address'. Alternatively a string, nil or a
  84. function may be given. Functions must return a string."
  85. :group 'org-export-koma-letter
  86. :type '(radio (function-item org-koma-letter-email)
  87. (string)
  88. (function)
  89. (const nil)))
  90. (defcustom org-koma-letter-from-address nil
  91. "Sender's address, as a string."
  92. :group 'org-export-koma-letter
  93. :type 'string)
  94. (defcustom org-koma-letter-phone-number nil
  95. "Sender's phone number, as a string."
  96. :group 'org-export-koma-letter
  97. :type 'string)
  98. (defcustom org-koma-letter-place nil
  99. "Place from which the letter is sent."
  100. :group 'org-export-koma-letter
  101. :type 'string)
  102. (defcustom org-koma-letter-opening nil
  103. "Letter's opening, as a string."
  104. :group 'org-export-koma-letter
  105. :type 'string)
  106. (defcustom org-koma-letter-closing nil
  107. "Koma-Letter's closing, as a string."
  108. :group 'org-export-koma-letter
  109. :type 'string)
  110. (defcustom org-koma-letter-signature "\\usekomavar{fromname}"
  111. "String used as the signature."
  112. :group 'org-export-koma-letter
  113. :type 'string)
  114. (defcustom org-koma-letter-use-subject "untitled"
  115. "Use the title as the letter's subject."
  116. :group 'org-export-koma-letter
  117. :type 'string)
  118. (defcustom org-koma-letter-use-backaddress t
  119. "Print return address in small line above to address."
  120. :group 'org-export-koma-letter
  121. :type 'boolean)
  122. (defcustom org-koma-letter-use-foldmarks "true"
  123. "Configure appearence of fold marks.
  124. Accepts any valid value for the KOMA-Script `foldmarks' option.
  125. Use `foldmarks:true' to activate default fold marks or
  126. `foldmarks:nil' to deactivate fold marks."
  127. :group 'org-export-koma-letter
  128. :type 'string)
  129. (defcustom org-koma-letter-use-phone t
  130. "Print sender's phone number."
  131. :group 'org-export-koma-letter
  132. :type 'boolean)
  133. (defcustom org-koma-letter-use-email t
  134. "Print sender's email address."
  135. :group 'org-export-koma-letter
  136. :type 'boolean)
  137. (defcustom org-koma-letter-use-place t
  138. "Print the letter's place next to the date."
  139. :group 'org-export-koma-letter
  140. :type 'boolean)
  141. (defconst org-koma-letter-special-tags-after-closing
  142. '("ps" "encl" "cc")
  143. "Header tags to be inserted after closing")
  144. (defconst org-koma-letter-special-tags-after-letter '("after_letter")
  145. "Header tags to be inserted after closing")
  146. (defvar org-koma-letter-special-contents nil "holds special
  147. content temporarily.")
  148. ;;; Define Back-End
  149. (org-export-define-derived-backend 'koma-letter 'latex
  150. :options-alist
  151. '((:lco "LCO" nil org-koma-letter-class-option-file)
  152. (:author "AUTHOR" nil (org-koma-letter--get-custom org-koma-letter-author) t)
  153. (:from-address "FROM_ADDRESS" nil org-koma-letter-from-address newline)
  154. (:phone-number "PHONE_NUMBER" nil org-koma-letter-phone-number)
  155. (:email "EMAIL" nil (org-koma-letter--get-custom org-koma-letter-email) t)
  156. (:to-address "TO_ADDRESS" nil nil newline)
  157. (:place "PLACE" nil org-koma-letter-place)
  158. (:opening "OPENING" nil org-koma-letter-opening)
  159. (:closing "CLOSING" nil org-koma-letter-closing)
  160. (:signature "SIGNATURE" nil org-koma-letter-signature newline)
  161. (:special-tags nil nil
  162. (append org-koma-letter-special-tags-after-closing
  163. org-koma-letter-special-tags-after-letter))
  164. (:with-after-closing nil "after-closing-order"
  165. org-koma-letter-special-tags-after-closing)
  166. (:with-after-letter nil "after-letter-order"
  167. org-koma-letter-special-tags-after-letter)
  168. (:with-backaddress nil "backaddress" org-koma-letter-use-backaddress)
  169. (:with-foldmarks nil "foldmarks" org-koma-letter-use-foldmarks)
  170. (:with-phone nil "phone" org-koma-letter-use-phone)
  171. (:with-email nil "email" org-koma-letter-use-email)
  172. (:with-place nil "place" org-koma-letter-use-place)
  173. (:with-subject nil "subject" org-koma-letter-use-subject))
  174. :translate-alist '((export-block . org-koma-letter-export-block)
  175. (export-snippet . org-koma-letter-export-snippet)
  176. (headline . org-koma-letter-headline)
  177. (keyword . org-koma-letter-keyword)
  178. (template . org-koma-letter-template))
  179. :menu-entry
  180. '(?k "Export with KOMA Scrlttr2"
  181. ((?L "As LaTeX buffer" org-koma-letter-export-as-latex)
  182. (?l "As LaTeX file" org-koma-letter-export-to-latex)
  183. (?p "As PDF file" org-koma-letter-export-to-pdf)
  184. (?o "As PDF file and open"
  185. (lambda (a s v b)
  186. (if a (org-koma-letter-export-to-pdf t s v b)
  187. (org-open-file (org-koma-letter-export-to-pdf nil s v b))))))))
  188. ;;; Helper functions
  189. (defun org-koma-letter-email ()
  190. "Return the current `user-mail-address'"
  191. user-mail-address)
  192. ;; The following is taken from/inspired by ox-grof.el
  193. ;; Thanks, Luis!
  194. (defun org-koma-letter--get-tagged-contents (tag)
  195. "Get tagged content from `org-koma-letter-special-contents'"
  196. (cdr (assoc tag org-koma-letter-special-contents)))
  197. (defun org-koma-letter--get-custom (value)
  198. "Determines whether a value is nil, a string or a
  199. function (a symobl). If it is a function it it evaluates it."
  200. (when value
  201. (cond ((stringp value) value)
  202. ((functionp value) (funcall value))
  203. ((symbolp value) (symbol-name value)))))
  204. (defun org-koma-letter--prepare-special-contents-as-macro (a-list &optional keep-newlines no-tag)
  205. "Finds all the components of `org-koma-letter-special-contents'
  206. corresponding to members of the `a-list' and return them as a
  207. string to be formatted. The function is used for inserting
  208. content of speciall headings such as PS.
  209. If keep-newlines is t newlines will not be removed. If no-tag is
  210. is t the content in `org-koma-letter-special-contents' will not
  211. be wrapped in a macro named whatever the members of a-list are called.
  212. "
  213. (let (output)
  214. (dolist (ac a-list output)
  215. (let
  216. ((x (org-koma-letter--get-tagged-contents ac))
  217. (regexp (if keep-newlines "" "\\`\n+\\|\n*\\'")))
  218. (when x
  219. (setq output
  220. (concat
  221. output "\n"
  222. ;; sometimes LaTeX complains about newlines
  223. ;; at the end or beginning of macros. Remove them.
  224. (org-koma-letter--format-string-as-macro
  225. (format "%s" (replace-regexp-in-string regexp "" x))
  226. (unless no-tag ac)))))))))
  227. (defun org-koma-letter--format-string-as-macro (string &optional macro)
  228. "If a macro is given format as string as \"\\macro{string}\" else as \"string\""
  229. (if macro
  230. (format "\\%s{%s}" macro string)
  231. (format "%s" string)))
  232. ;;; Transcode Functions
  233. ;;;; Export Block
  234. (defun org-koma-letter-export-block (export-block contents info)
  235. "Transcode an EXPORT-BLOCK element into KOMA Scrlttr2 code.
  236. CONTENTS is nil. INFO is a plist used as a communication
  237. channel."
  238. (when (member (org-element-property :type export-block) '("KOMA-LETTER" "LATEX"))
  239. (org-remove-indentation (org-element-property :value export-block))))
  240. ;;;; Export Snippet
  241. (defun org-koma-letter-export-snippet (export-snippet contents info)
  242. "Transcode an EXPORT-SNIPPET object into KOMA Scrlttr2 code.
  243. CONTENTS is nil. INFO is a plist used as a communication
  244. channel."
  245. (when (memq (org-export-snippet-backend export-snippet) '(latex koma-letter))
  246. (org-element-property :value export-snippet)))
  247. ;;;; Keyword
  248. (defun org-koma-letter-keyword (keyword contents info)
  249. "Transcode a KEYWORD element into KOMA Scrlttr2 code.
  250. CONTENTS is nil. INFO is a plist used as a communication
  251. channel."
  252. (let ((key (org-element-property :key keyword))
  253. (value (org-element-property :value keyword)))
  254. ;; Handle specifically BEAMER and TOC (headlines only) keywords.
  255. ;; Otherwise, fallback to `latex' back-end.
  256. (if (equal key "KOMA-LETTER") value
  257. (org-export-with-backend 'latex keyword contents info))))
  258. ;; Headline
  259. (defun org-koma-letter-headline (headline contents info)
  260. "Transcode a HEADLINE element from Org to LaTeX.
  261. CONTENTS holds the contents of the headline. INFO is a plist
  262. holding contextual information.
  263. Note that if a headline is tagged with a tag from
  264. `org-koma-letter-special-tags' it will not be exported, but
  265. stored in `org-koma-letter-special-contents' and included at the
  266. appropriate place."
  267. (let*
  268. ((tags (and (plist-get info :with-tags)
  269. (org-export-get-tags headline info)))
  270. (tag (downcase (car tags))))
  271. (if (member tag (plist-get info :special-tags))
  272. (progn
  273. (push (cons tag contents)
  274. org-koma-letter-special-contents)
  275. nil)
  276. contents)))
  277. ;;;; Template
  278. (defun org-koma-letter-template (contents info)
  279. "Return complete document string after KOMA Scrlttr2 conversion.
  280. CONTENTS is the transcoded contents string. INFO is a plist
  281. holding export options."
  282. ;; FIXME: instead of setq'ing org-koma-letter-special-contents and
  283. ;; callying varioues stuff it might be nice to put a big let* around the templace
  284. ;; as in org-groff...
  285. (concat
  286. ;; Time-stamp.
  287. (and (plist-get info :time-stamp-file)
  288. (format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
  289. ;; Document class and packages.
  290. (let ((class (plist-get info :latex-class))
  291. (class-options (plist-get info :latex-class-options)))
  292. (org-element-normalize-string
  293. (let* ((header (nth 1 (assoc class org-latex-classes)))
  294. (document-class-string
  295. (and (stringp header)
  296. (if (not class-options) header
  297. (replace-regexp-in-string
  298. "^[ \t]*\\\\documentclass\\(\\(\\[[^]]*\\]\\)?\\)"
  299. class-options header t nil 1)))))
  300. (if (not document-class-string)
  301. (user-error "Unknown LaTeX class `%s'")
  302. (org-latex-guess-babel-language
  303. (org-latex-guess-inputenc
  304. (org-splice-latex-header
  305. document-class-string
  306. org-latex-default-packages-alist ; defined in org.el
  307. org-latex-packages-alist nil ; defined in org.el
  308. (concat (plist-get info :latex-header)
  309. (plist-get info :latex-header-extra))))
  310. info)))))
  311. (let ((lco (plist-get info :lco))
  312. (author (plist-get info :author))
  313. (from-address (plist-get info :from-address))
  314. (phone-number (plist-get info :phone-number))
  315. (email (plist-get info :email))
  316. (signature (plist-get info :signature)))
  317. (concat
  318. ;; Letter Class Option File
  319. (when lco
  320. (let ((lco-files (split-string lco " "))
  321. (lco-def ""))
  322. (dolist (lco-file lco-files lco-def)
  323. (setq lco-def (format "%s\\LoadLetterOption{%s}\n" lco-def lco-file)))
  324. lco-def))
  325. ;; Define "From" data.
  326. (when author (format "\\setkomavar{fromname}{%s}\n"
  327. (org-export-data author info)))
  328. (when from-address (format "\\setkomavar{fromaddress}{%s}\n" from-address))
  329. (when phone-number (format "\\setkomavar{fromphone}{%s}\n" phone-number))
  330. (when email (format "\\setkomavar{fromemail}{%s}\n" email))
  331. (when signature (format "\\setkomavar{signature}{%s}\n" signature))))
  332. ;; Date.
  333. (format "\\date{%s}\n" (org-export-data (org-export-get-date info) info))
  334. ;; Place
  335. (let ((with-place (plist-get info :with-place))
  336. (place (plist-get info :place)))
  337. (when (or place (not with-place))
  338. (format "\\setkomavar{place}{%s}\n" (if with-place place ""))))
  339. ;; KOMA options
  340. (let ((with-backaddress (plist-get info :with-backaddress))
  341. (with-foldmarks (plist-get info :with-foldmarks))
  342. (with-phone (plist-get info :with-phone))
  343. (with-email (plist-get info :with-email)))
  344. (concat
  345. (format "\\KOMAoption{backaddress}{%s}\n" (if with-backaddress "true" "false"))
  346. (format "\\KOMAoption{foldmarks}{%s}\n" (if with-foldmarks with-foldmarks "false"))
  347. (format "\\KOMAoption{fromphone}{%s}\n" (if with-phone "true" "false"))
  348. (format "\\KOMAoption{fromemail}{%s}\n" (if with-email "true" "false"))))
  349. ;; Document start
  350. "\\begin{document}\n\n"
  351. ;; Subject
  352. (let ((with-subject (plist-get info :with-subject)))
  353. (when with-subject
  354. (concat
  355. (format "\\KOMAoption{subject}{%s}\n" with-subject)
  356. (format "\\setkomavar{subject}{%s}\n\n"
  357. (org-export-data (plist-get info :title) info)))))
  358. ;; Letter start
  359. (format "\\begin{letter}{%%\n%s}\n\n"
  360. (or (plist-get info :to-address) "no address given"))
  361. ;; Opening.
  362. (format "\\opening{%s}\n\n" (plist-get info :opening))
  363. ;; Letter body.
  364. contents
  365. ;; Closing.
  366. (format "\n\\closing{%s}\n" (plist-get info :closing))
  367. (org-koma-letter--prepare-special-contents-as-macro
  368. (plist-get info :with-after-closing))
  369. ;; Letter end.
  370. "\n\\end{letter}\n"
  371. (org-koma-letter--prepare-special-contents-as-macro
  372. (plist-get info :with-after-letter) t t)
  373. ;; Document end.
  374. "\n\\end{document}"
  375. ))
  376. ;;; Commands
  377. ;;;###autoload
  378. (defun org-koma-letter-export-as-latex
  379. (&optional async subtreep visible-only body-only ext-plist)
  380. "Export current buffer as a KOMA Scrlttr2 letter.
  381. If narrowing is active in the current buffer, only export its
  382. narrowed part.
  383. If a region is active, export that region.
  384. A non-nil optional argument ASYNC means the process should happen
  385. asynchronously. The resulting buffer should be accessible
  386. through the `org-export-stack' interface.
  387. When optional argument SUBTREEP is non-nil, export the sub-tree
  388. at point, extracting information from the headline properties
  389. first.
  390. When optional argument VISIBLE-ONLY is non-nil, don't export
  391. contents of hidden elements.
  392. When optional argument BODY-ONLY is non-nil, only write code
  393. between \"\\begin{letter}\" and \"\\end{letter}\".
  394. EXT-PLIST, when provided, is a proeprty list with external
  395. parameters overriding Org default settings, but still inferior to
  396. file-local settings.
  397. Export is done in a buffer named \"*Org KOMA-LETTER Export*\". It
  398. will be displayed if `org-export-show-temporary-export-buffer' is
  399. non-nil."
  400. (interactive)
  401. (let (org-koma-letter-special-contents)
  402. (if async
  403. (org-export-async-start
  404. (lambda (output)
  405. (with-current-buffer (get-buffer-create "*Org KOMA-LETTER Export*")
  406. (erase-buffer)
  407. (insert output)
  408. (goto-char (point-min))
  409. (LaTeX-mode)
  410. (org-export-add-to-stack (current-buffer) 'koma-letter)))
  411. `(org-export-as 'koma-letter ,subtreep ,visible-only ,body-only
  412. ',ext-plist))
  413. (let ((outbuf (org-export-to-buffer
  414. 'koma-letter "*Org KOMA-LETTER Export*"
  415. subtreep visible-only body-only ext-plist)))
  416. (with-current-buffer outbuf (LaTeX-mode))
  417. (when org-export-show-temporary-export-buffer
  418. (switch-to-buffer-other-window outbuf))))))
  419. ;;;###autoload
  420. (defun org-koma-letter-export-to-latex
  421. (&optional async subtreep visible-only body-only ext-plist)
  422. "Export current buffer as a KOMA Scrlttr2 letter (tex).
  423. If narrowing is active in the current buffer, only export its
  424. narrowed part.
  425. If a region is active, export that region.
  426. A non-nil optional argument ASYNC means the process should happen
  427. asynchronously. The resulting file should be accessible through
  428. the `org-export-stack' interface.
  429. When optional argument SUBTREEP is non-nil, export the sub-tree
  430. at point, extracting information from the headline properties
  431. first.
  432. When optional argument VISIBLE-ONLY is non-nil, don't export
  433. contents of hidden elements.
  434. When optional argument BODY-ONLY is non-nil, only write code
  435. between \"\\begin{letter}\" and \"\\end{letter}\".
  436. EXT-PLIST, when provided, is a property list with external
  437. parameters overriding Org default settings, but still inferior to
  438. file-local settings.
  439. When optional argument PUB-DIR is set, use it as the publishing
  440. directory.
  441. Return output file's name."
  442. (interactive)
  443. (let ((outfile (org-export-output-file-name ".tex" subtreep)))
  444. (if async
  445. (org-export-async-start
  446. (lambda (f) (org-export-add-to-stack f 'koma-letter))
  447. `(expand-file-name
  448. (org-export-to-file
  449. 'koma-letter ,outfile ,subtreep ,visible-only ,body-only
  450. ',ext-plist)))
  451. (org-export-to-file
  452. 'koma-letter outfile subtreep visible-only body-only ext-plist))))
  453. ;;;###autoload
  454. (defun org-koma-letter-export-to-pdf
  455. (&optional async subtreep visible-only body-only ext-plist)
  456. "Export current buffer as a KOMA Scrlttr2 letter (pdf).
  457. If narrowing is active in the current buffer, only export its
  458. narrowed part.
  459. If a region is active, export that region.
  460. A non-nil optional argument ASYNC means the process should happen
  461. asynchronously. The resulting file should be accessible through
  462. the `org-export-stack' interface.
  463. When optional argument SUBTREEP is non-nil, export the sub-tree
  464. at point, extracting information from the headline properties
  465. first.
  466. When optional argument VISIBLE-ONLY is non-nil, don't export
  467. contents of hidden elements.
  468. When optional argument BODY-ONLY is non-nil, only write code
  469. between \"\\begin{letter}\" and \"\\end{letter}\".
  470. EXT-PLIST, when provided, is a property list with external
  471. parameters overriding Org default settings, but still inferior to
  472. file-local settings.
  473. Return PDF file's name."
  474. (interactive)
  475. (if async
  476. (let ((outfile (org-export-output-file-name ".tex" subtreep)))
  477. (org-export-async-start
  478. (lambda (f) (org-export-add-to-stack f 'koma-letter))
  479. `(expand-file-name
  480. (org-latex-compile
  481. (org-export-to-file
  482. 'koma-letter ,outfile ,subtreep ,visible-only ,body-only
  483. ',ext-plist)))))
  484. (org-latex-compile
  485. (org-koma-letter-export-to-latex
  486. nil subtreep visible-only body-only ext-plist))))
  487. (provide 'ox-koma-letter)
  488. ;;; ox-koma-letter.el ends here