emacs-orgmode
[Top][All Lists]
Advanced

[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:

(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



      




reply via email to

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