emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Robert Klein
Subject: Re: [O] org-mode command in a bash script?
Date: Fri, 3 Jun 2016 08:25:44 +0200

Hi,

On Fri, 03 Jun 2016 06:36:12 +0100
Sharon Kimble <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]