* org-mode command in a bash script?
@ 2016-06-03 5:36 Sharon Kimble
2016-06-03 6:25 ` Robert Klein
0 siblings, 1 reply; 2+ messages in thread
From: Sharon Kimble @ 2016-06-03 5:36 UTC (permalink / raw)
To: org-mode-email
[-- Attachment #1: Type: text/plain, Size: 534 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: org-mode command in a bash script?
2016-06-03 5:36 org-mode command in a bash script? Sharon Kimble
@ 2016-06-03 6:25 ` Robert Klein
0 siblings, 0 replies; 2+ messages in thread
From: Robert Klein @ 2016-06-03 6:25 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Sharon Kimble
Hi,
On Fri, 03 Jun 2016 06:36:12 +0100
Sharon Kimble <boudiccas@skimble.plus.com> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-03 6:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-03 5:36 org-mode command in a bash script? Sharon Kimble
2016-06-03 6:25 ` Robert Klein
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).