[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] export (as latex) a large number of org files in a directory

From: Stephen Tucker
Subject: [Orgmode] export (as latex) a large number of org files in a directory
Date: Sun, 30 Aug 2009 07:11:06 -0700 (PDT)

Hi, I am trying to export a bunch of .org files stored in a directory as latex 
files. I have tried two methods:

At the bash prompt (I am using OS X):

bash$ emacs --batch
--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).


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)
      (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


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!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]