Stephen Tucker <brown_...@yahoo.com> 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 _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode