From: Stephen Tucker <brown_emu@yahoo.com>
To: emacs-orgmode@gnu.org
Subject: export (as latex) a large number of org files in a directory
Date: Sun, 30 Aug 2009 07:11:06 -0700 (PDT) [thread overview]
Message-ID: <894242.15667.qm@web39706.mail.mud.yahoo.com> (raw)
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
next reply other threads:[~2009-08-30 14:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-30 14:11 Stephen Tucker [this message]
2009-08-30 15:04 ` export (as latex) a large number of org files in a directory 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=894242.15667.qm@web39706.mail.mud.yahoo.com \
--to=brown_emu@yahoo.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).