3

I wonder if it is possible to write a bash oneline to export org-files to pdf. Something like this

emacs -q --eval 'org-latex-export-to-pdf manual.org'

I'm aware of the pandoc project. I would like to do it with emacs, as I also want to add some style options for the export.

I have a document where I will occasionally work with others. To make it easy for them I would like to add a Makefile to generate the pdf.

EDIT

Solution from the comments

emacs --batch -q --eval '(progn (find-file "manual.org") (org-latex-export-to-pdf))'
8
  • github.com/fniessen/orgmk
    – mankoff
    May 1, 2015 at 19:51
  • 1
    emacs --batch -q --eval '(progn (find-file "manual.org") (org-latex-export-to-pdf))' should do the trick. (untested). AFAIK you need to use elisp syntax for eval.
    – Tobias
    May 1, 2015 at 20:32
  • What does latex have to do with this??
    – Tobias
    May 1, 2015 at 20:37
  • @Tobias I think your comment is an answer :) Maybe use with-current-buffer instead of progn though.
    – Qudit
    May 2, 2015 at 0:18
  • @Qudit Maybe with-current-buffer makes the intention more clear. I agree whith this. Nevertheless, find-file makes the buffer corresponding to the argument current. So, with-current-buffer does not change the functionality in any way.
    – Tobias
    May 2, 2015 at 6:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.