emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Stephen Tucker <brown_emu@yahoo.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: export (as latex) a large number of org files in a directory
Date: Sun, 30 Aug 2009 11:04:06 -0400	[thread overview]
Message-ID: <31875.1251644646@gamaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Stephen Tucker <brown_emu@yahoo.com> of "Sun, 30 Aug 2009 07:11:06 PDT." <894242.15667.qm@web39706.mail.mud.yahoo.com>

Stephen Tucker <brown_emu@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

  reply	other threads:[~2009-08-30 15:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=31875.1251644646@gamaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=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).