1

I want to write a Makefile that handles org-export with ox-bibtex, e.g.

%.pdf: %.org
        emacs $< --batch -l emacs-load.el -f org-latex-export-to-pdf --kill

%.html: %.org
        emacs $< --batch -l emacs-load.el -f org-html-export-to-html --kill

where emacs-load.el contains any elisp needed.

And here start my problems: I so far have

(add-to-list 'exec-path "./bibtex2html-1.98-linux/")
(add-to-list 'load-path "./elisp")
(require 'org)
(load "ox-bibtex.el")

and the ox-bibtex.el copied to elisp

With the above configuration, I get

Symbol's function definition is void: org-element-insert-before

If I provide a function definition (i.e. from org-element.el) org-link-types is void, and so on.

Apparently, I am missing something, but as it stands I do not know what to do in order to make ox-bibtex work.

I want the Makefile to be fully portable (i.e. not depend on a custom emacs configuration) for org-version >= 8.0. (But its OK to require some files in the same directory or a subdirectory.)

1

I'm pretty sure the reason that's happening is because the org contributed libraries are not in your load-path. Ensure that directory is in your load path, and it should work. See Installation - The Org Manual if you don't already have it installed.

If you already have it locally something like this should work:

(add-to-list 'load-path "~/path/to/orgdir/contrib/lisp" t)

My preferred method of installing using the emacs package system. Here's a link to the org package repository.

  • I've tried using both - package archive and git repro - nothing. Just to make it clear, export works fine from within my custom emacs. But I want to have a makefile non-emacs users can use without the need to do anything in emacs (but of cause request that they have it installed). I understand that I need to provide the necessary package files together with the project (and load them). – lccopper Jan 21 '17 at 17:10
1

The order of the emacs call seems to be the problem. Should be

    emacs --batch -l emacs-load.el $< -f org-latex-export-to-pdf --kill

Moreover, I needed to invoke the Makefile located in the org lisp directory hat I placed in my load-path.

It work as expected with the above modifications.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.