From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell Adams Subject: Re: How to invoke org-export externally from outside Emacs Date: Thu, 25 Sep 2014 04:01:24 -0500 Message-ID: <20140925090124.GB4563@cardamom.adamsinfoserv.com> References: <20140925105626.14caee18@patti> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XX5Rg-0000WA-VB for emacs-orgmode@gnu.org; Thu, 25 Sep 2014 05:34:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XX5Rb-00018F-D0 for emacs-orgmode@gnu.org; Thu, 25 Sep 2014 05:34:40 -0400 Received: from [65.99.237.198] (port=62585 helo=kefka.asmallorange.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XX5Rb-00017B-8D for emacs-orgmode@gnu.org; Thu, 25 Sep 2014 05:34:35 -0400 Received: from mail.99x.no ([88.87.45.3]:60006 helo=localhost) by kefka.asmallorange.com with esmtpsa (UNKNOWN:DHE-RSA-AES128-SHA:128) (Exim 4.82) (envelope-from ) id 1XX4vW-00060x-PB for emacs-orgmode@gnu.org; Thu, 25 Sep 2014 05:01:27 -0400 Content-Disposition: inline In-Reply-To: <20140925105626.14caee18@patti> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On Thu, Sep 25, 2014 at 10:56:26AM +0200, Miguel Telleria de Esteban wrote: > Dear list, > > I am using org-mode more and more everyday, congrats to the community for > such a great program!! > > I would like to automate the generation of PDF/HTML/ODT... thorough a > command line with a makefile. Something like: > > file.pdf: file.org > > > Is there a way to externally launch, let's say org-latex-export-to-pdf from > outside Emacs?. Maybe through a script. > > Probably this is more an Emacs-list question than an org-mode one but any > suggestion here will be welcome. > > Cheers and thanks in advance for any suggestion. > > Miguel I use a Makefile to export to latex, then I use pdflatex to compile the final version. Org does the same thing if you ask it to go straight to PDF, but this lets me include my revision number. This also launches my pdf viewer (xpdf), and works for every .org file in the directory. Makefile: ---------------------------------------------------------------------- .PHONY: all clean OBJS := $(patsubst %.org, %.pdf, $(wildcard *.org)) CRAP := $(patsubst %.org, %.pdf, $(wildcard *.org)) CRAP += $(patsubst %.org, %.aux, $(wildcard *.org)) CRAP += $(patsubst %.org, %.log, $(wildcard *.org)) CRAP += $(patsubst %.org, %.out, $(wildcard *.org)) CRAP += $(patsubst %.org, %.toc, $(wildcard *.org)) all: $(OBJS) clean: rm -f $(CRAP) %.tex: %.org emacs -batch \ -load ~/.emacs \ --eval '(setq enable-local-variables :all)' \ --visit=$< \ -f org-export-as-latex \ %.pdf: %.tex pdflatex "\\def\\Revision {`bzr version-info --custom --template=\"{revno}\" $<`}" "\\input{$<}" pdflatex "\\def\\Revision {`bzr version-info --custom --template=\"{revno}\" $<`}" "\\input{$<}" xpdf $@ ---------------------------------------------------------------------- ------------------------------------------------------------------ Russell Adams RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3