From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: export (as latex) a large number of org files in a directory Date: Sun, 30 Aug 2009 11:04:06 -0400 Message-ID: <31875.1251644646@gamaville.dokosmarshall.org> References: <894242.15667.qm@web39706.mail.mud.yahoo.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mhlyk-00013B-Ex for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 11:06:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mhlye-00012F-LE for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 11:06:00 -0400 Received: from [199.232.76.173] (port=59068 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mhlye-00012C-GF for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 11:05:56 -0400 Received: from vms173005pub.verizon.net ([206.46.173.5]:56421) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mhlyd-0007v4-Bv for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 11:05:56 -0400 Received: from gamaville.dokosmarshall.org ([98.110.172.159]) by vms173005.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KP70067Y36O0051@vms173005.mailsrvcs.net> for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 10:04:06 -0500 (CDT) In-reply-to: Message from Stephen Tucker of "Sun, 30 Aug 2009 07:11:06 PDT." <894242.15667.qm@web39706.mail.mud.yahoo.com> 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: Stephen Tucker Cc: emacs-orgmode@gnu.org Stephen Tucker wrote: > 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). > Did you escape the newlines? If you cut-n-pasted from the org-export-as-latex-batch help, you fell into the trap :-) Maybe the documentation of the function could be changed to add the backslashes? The following script (I call it org-to-latex) works fine on linux: --8<---------------cut here---------------start------------->8--- #! /bin/bash orglib=$HOME/elisp/org-mode/lisp emacs --batch \ --load=$orglib/org.elc \ --eval "(setq org-export-headline-levels 2)" \ --visit=$1 --funcall org-export-as-latex-batch --8<---------------cut here---------------end--------------->8--- You can add a loop in it too - or do the loop by hand: --8<---------------cut here---------------start------------->8--- for x in *.org do org-to-latex $x done --8<---------------cut here---------------end--------------->8--- HTH, Nick