2008-03-13 Carsten Dominik <dominik@science.uva.nl>
+ * textmodes/org-publish.el: (org-publish-expand-components):
+ Remove null projects from the list of components.
+ (org-publish-attachment): Bugfix: handle the mandatory argument
+ pub-dir. Removed unused retrieval of the :publishing-directory
+ property.
+ (org-publish-file): Bugfix: when using a relative directory as the
+ publishing directory, convert it to a directory filename.
+ (org-publish-project): New alias.
+ (org-publish-get-files): Protect against empty p.
+ (org-publish-file): Send an error when file is not part of any
+ project.
+ (org-publish-file): Offer to refresh the list of files in known
+ project when the current file is not part of any project.
+ (org-publish-before-export-hook)
+ (org-publish-after-export-hook): New hooks.
+ (org-publish-org-to): Use new hooks and kill buffers.
+ (org-publish-file): Remove the code for killing buffers.
+ (org-publish-initialize-files-alist): Use interactive.
+ (org-publish-file): If the publishing function creates a new
+ buffer, kill it after publishing.
+ (org-publish-timestamp-filename): Protect ":" in file name path
+ under windows.
+
* textmodes/org-export-latex.el (org-export-as-latex): Revert the
change that killed the LaTeX buffer.
;;
;; Emacs Lisp Archive Entry
;; Filename: org-export-latex.el
-;; Version: 5.19
+;; Version: 5.23
;; Author: Bastien Guerry <bzg AT altern DOT org>
;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
;; Keywords: org, wp, tex
;; M-x `org-export-as-latex-to-buffer'
;; M-x `org-export-region-as-latex'
;; M-x `org-replace-region-by-latex'
-;;
+;;
;;; Code:
(eval-when-compile
;;;###autoload
(defun org-export-as-latex (arg &optional hidden ext-plist
- to-buffer body-only)
+ to-buffer body-only pub-dir)
"Export current buffer to a LaTeX file.
If there is an active region, export only the region. The prefix
ARG specifies how many levels of the outline should become
buffer behind but just return the resulting LaTeX as a string.
When BODY-ONLY is set, don't produce the file header and footer,
simply return the content of \begin{document}...\end{document},
-without even the \begin{document} and \end{document} commands."
+without even the \begin{document} and \end{document} commands.
+when PUB-DIR is set, use this as the publishing directory."
(interactive "P")
;; Make sure we have a file name when we need it.
(when (and (not (or to-buffer body-only))
(file-name-sans-extension
(file-name-nondirectory buffer-file-name))))
(filename (concat (file-name-as-directory
- (org-export-directory :LaTeX ext-plist))
+ (or pub-dir
+ (org-export-directory :LaTeX ext-plist)))
(file-name-sans-extension
(file-name-nondirectory ;sans-extension
buffer-file-name)) ".tex"))
(find-file-noselect filename)))
(odd org-odd-levels-only)
(header (org-export-latex-make-header title opt-plist))
- (skip (if subtree-p nil
+ (skip (cond (subtree-p nil)
+ (region-p t)
;; never skip first lines when exporting a subtree
- (plist-get opt-plist :skip-before-1st-heading)))
+ (t (plist-get opt-plist :skip-before-1st-heading))))
(text (plist-get opt-plist :text))
(first-lines (if skip "" (org-export-latex-first-lines)))
(coding-system (and (boundp 'buffer-file-coding-system)
(if (match-string 2) "" (match-string 1)))) t t))
;; Delete @<...> constructs
- (goto-char (point-min))
;; Thanks to Daniel Clemente for this regexp
+ (goto-char (point-min))
(while (re-search-forward "@<\\(?:[^\"\n]\\|\".*\"\\)*?>" nil t)
(replace-match ""))
(let ((end (save-excursion
(if (re-search-forward "^$\\|^#.*$\\|\\[[0-9]+\\]" nil t)
(match-beginning 0) (point-max)))))
- (setq footnote (concat (org-trim (buffer-substring (point) end))
+ (setq footnote (concat (org-trim (buffer-substring (point) end))
" ")) ; prevent last } being part of a link
(delete-region (point) end))
(goto-char foot-beg)