From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Lawrence Subject: Re: ePub and Org mode Date: Sun, 20 Feb 2011 17:34:40 -0800 Message-ID: <87ei725fwv.fsf@berkeley.edu> References: <20110219202502.decc3e3e.alantyree@gmail.com> <4D603A1A.9020601@christianmoe.com> <87aahrxhu4.fsf@Rainer.invalid> <877hcv83fe.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=42465 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrKce-0007cl-32 for emacs-orgmode@gnu.org; Sun, 20 Feb 2011 20:33:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrKbM-0001xP-Ss for emacs-orgmode@gnu.org; Sun, 20 Feb 2011 20:30:15 -0500 Received: from lo.gmane.org ([80.91.229.12]:36967) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrKbM-0001x1-JS for emacs-orgmode@gnu.org; Sun, 20 Feb 2011 20:30:12 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PrKbK-0006ee-AF for emacs-orgmode@gnu.org; Mon, 21 Feb 2011 02:30:10 +0100 Received: from c-67-164-33-170.hsd1.ca.comcast.net ([67.164.33.170]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 Feb 2011 02:30:10 +0100 Received: from richard.lawrence by c-67-164-33-170.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 Feb 2011 02:30:10 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org "Eric Schulte" writes: >> The only thing missing is a function to export all (not excluded) >> subtrees one by one and honor the properties slapped onto each subtree. >> > > `org-map-entries' should satisfy this need. -- Eric I have been doing something similar with LaTeX export. Here is my (pretty hacky) code; it should be easy to adapt to HTML export. It does the following: 1) export each subtree of the current tree as a separate PDF (there's some validation here, to make sure each of these trees has properties that I need to produce the output I want) 2) concatenates the resulting PDFs into a single PDF for printing (this requires the pdftk package) Good luck! Richard ;;;; (defun org-export-individual-pdfs-and-concat () (interactive) (setq export-files nil pdf-files nil ; point must be in main tree to be exported (not a subtree) concat-pdf-name (get-property-or-fail (point) "CONCATENATED_PDF_NAME")) (progn (org-map-entries (lambda () (setq org-map-continue-from (outline-next-heading)) (org-mark-subtree) ; org-map-entries positions point at the beginning of each subtree (let ((org-trust-scanner-tags t)) (push (get-property-or-fail (point) "EXPORT_FILE_NAME") export-files)) (org-export-as-pdf nil)) nil 'tree) (concat-pdfs (nreverse (mapcar 'tex-name-to-pdf-name export-files)) concat-pdf-name))) (defun get-property-or-fail (pom property) (or ; probably some opportunity for optimization here...see function ; documentation for org-map-entries (org-entry-get pom property) (error (format "Entry at %s does not define property %s" (org-heading-components) property)))) (defun tex-name-to-pdf-name (filename) (concat (file-name-sans-extension filename) ".pdf")) (defun concat-pdfs (in-files out-file) (shell-command (format "pdftk %s cat output %s" (mapconcat (lambda (s) s) in-files " ") ; join pdf names with spaces out-file)))