Re: [O] org-mode command in a bash script?

2016-06-03 Thread Robert Klein
Hi,

On Fri, 03 Jun 2016 06:36:12 +0100
Sharon Kimble  wrote:

> 
> How can I run an org-mode command in a bash script please?
> 
> Specifically 'org-latex-export-to-latex'?
> 
> I'm developing my own modular script to choose between, at present, 3
> tex files which have been pre-exported from org-mode. I'm now
> wondering if its possible to export from the org-mode file as part of
> another module in the script.
> 
> Can it be done, and if so, how please?


I'm using this shell function for exporting certain documents to pdf:


orgexp()
{
emacs  --batch -l ~/.emacs --eval \
   "(progn
 (setq org-latex-image-default-width \".4cm\"
   org-export-allow-bind-keywords t
   org-confirm-babel-evaluate nil)
 (find-file \"$1\")
 (org-latex-export-to-pdf))"
}


You probably don't want to set the variables, so for export to latex
this might work (i.e. I didn't test it):


org2latex()
{
emacs  --batch -l ~/.emacs --eval \
   "(progn
 (find-file \"$1\")
 (org-latex-export-to-latex))"
}


If you put this in your .bashrc you can just use
org2latex myfile.org
to export myfile.org to latex.

Best regards
Robert



[O] org-mode command in a bash script?

2016-06-02 Thread Sharon Kimble

How can I run an org-mode command in a bash script please?

Specifically 'org-latex-export-to-latex'?

I'm developing my own modular script to choose between, at present, 3
tex files which have been pre-exported from org-mode. I'm now wondering
if its possible to export from the org-mode file as part of another
module in the script.

Can it be done, and if so, how please?

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.4, fluxbox 1.3.7, emacs 25.0.94


signature.asc
Description: PGP signature