From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Tucker Subject: Re: export (as latex) a large number of org files in a directory Date: Sun, 30 Aug 2009 12:11:54 -0700 (PDT) Message-ID: <813754.54567.qm@web39708.mail.mud.yahoo.com> References: <894242.15667.qm@web39706.mail.mud.yahoo.com> <31875.1251644646@gamaville.dokosmarshall.org> 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 1Mhpon-0006cK-MY for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 15:12:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mhpoi-0006c7-IU for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 15:12:00 -0400 Received: from [199.232.76.173] (port=51441 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mhpoi-0006c4-Cm for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 15:11:56 -0400 Received: from web39708.mail.mud.yahoo.com ([209.191.106.54]:28241) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Mhpoh-0002Cl-Ul for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 15:11:56 -0400 In-Reply-To: <31875.1251644646@gamaville.dokosmarshall.org> 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: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org Hi Nick, thanks for the response! Actually in the code that I had pasted, the emacs --batch call is all on one line (so no need to escape newlines there). I tried your code with both orglib=/Applications/Emacs.app/Contents/Resources/lisp/org and orglib=$HOME/elisp/org-mode/lisp but got Cannot open load file: org-macs in both cases I also added a line, --eval "(load \"/Applications/Emacs.app/Contents/Resources/lisp/org/org.elc\")" \ to replace the --load option but same deal. I do in fact have org-macs in my 'orglib' directories so I tried loading them explicitly (with multiple --load specifications), but it still doesn't work (Still "Cannot open load file" pointing to some org file or subst-ksc, depending on how many or in what order org .el files are loaded). Any more ideas? Thanks...! Stephen ----- Original Message ---- From: Nick Dokos To: Stephen Tucker Cc: emacs-orgmode@gnu.org; nicholas.dokos@hp.com Sent: Sunday, August 30, 2009 8:04:06 AM Subject: Re: [Orgmode] export (as latex) a large number of org files in a directory 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