From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Tucker Subject: export (as latex) a large number of org files in a directory Date: Sun, 30 Aug 2009 07:11:06 -0700 (PDT) Message-ID: <894242.15667.qm@web39706.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mhl7x-0007J4-6s for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 10:11:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mhl7q-0007H7-MW for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 10:11:28 -0400 Received: from [199.232.76.173] (port=54718 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mhl7q-0007Gz-D9 for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 10:11:22 -0400 Received: from web39706.mail.mud.yahoo.com ([209.191.106.52]:30960) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Mhl7p-0007fA-0x for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 10:11:22 -0400 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 Hi, I am trying to export a bunch of .org files stored in a directory as latex files. I have tried two methods: (1) ------------------------------------------------------------------------------------------- At the bash prompt (I am using OS X): bash$ emacs --batch --load=/Applications/Emacs.app/Contents/Resources/lisp/org/org.elc --visit=file.org --funcall org-export-as-latex-batch' and I get an error: "Cannot open load file: subst-ksc" If I can get this to work, then I can embed this system call in a shell script and call it iteratively on a list of .org files retrieved from, say, Python or Bash (changing 'file.org' appropriately each time). (2) ------------------------------------------------------------------------------------------- I created the following function which is intended to take a filename argument, load it into a temporary buffer, and export that buffer as a latex file. I thought to apply (map) this function to a list of file names generated by the directory-files() function. (defun orgexpastex (filenm) (let (buffer-file-name) (with-temp-buffer (setq buffer-file-name "test") (insert-file-contents filenm) (org-export-as-latex 3)) ;;or (org-export-as-latex-batch)) ) ) But, upon testing this function, (orgexpastex "file.org") I get [-] = =*Backtrace*-------------------------------------------------------------- Debugger entered--Lisp error: (wrong-type-argument stringp nil) re-search-forward(nil nil t) org-export-remove-headline-metadata((:for-LaTeX t :emph-multiline t :add-text nil :comments nil :skip-before-1st-heading nil :LaTeX-fragments nil :timestamps t :footnotes t)) org-export-preprocess-string("" :for-LaTeX t :emph-multiline t :add-text nil :comments nil :skip-before-1st-heading nil :LaTeX-fragments nil :timestamps t :footnotes t) org-export-latex-first-lines((:latex-image-options "width=10em" :exclude-tags ("noexport") :select-tags ("export") :auto-postamble t [...snip...] ------------------------------------------------------------------------------------------- I wonder if it is obvious to anyone what I am doing wrong, or if there is a better way to go about exporting a bunch of org files with a program. Thanks much! Stephen