emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* export (as latex) a large number of org files in a directory
@ 2009-08-30 14:11 Stephen Tucker
  2009-08-30 15:04 ` Nick Dokos
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Tucker @ 2009-08-30 14:11 UTC (permalink / raw)
  To: emacs-orgmode

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



      

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-02 15:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-30 14:11 export (as latex) a large number of org files in a directory Stephen Tucker
2009-08-30 15:04 ` Nick Dokos
2009-08-30 19:11   ` Stephen Tucker
2009-08-31  2:27     ` Nick Dokos
2009-08-31  4:38       ` Nick Dokos
2009-08-31  5:58         ` Stephen Tucker
2009-09-02 15:21   ` Sébastien Vauban

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).