Hi Alan,

Alan Schmitt <alan.schm...@polytechnique.org> writes:

> Feng Shu <tuma...@gmail.com> writes:
>
>> Alan Schmitt <alan.schm...@polytechnique.org> writes:
>>
>>> Hello,
>>>
>>> I'm collaborating on a paper with some colleagues, and I convinced them
>>> to use org-mode. I'm trying to make sure the paper is as self-contained
>>> as possible (I don't want them to have to change their emacs
>>> configuration file).To change the documentclass name of the exported
>>
>> Maybe you can write a Makefile to change their emacs configure...
>
> I don't want to push my luck ;-)

I wouldn't have a Makefile change their .emacs, but this does seem like
a good application for a Makefile or similar.

You can put code that configures Emacs/Org in the way you need for
compiling your document in a separate file in the repository, then load
that file using Emacs' --load flag in the command that runs the
export/compilation.

For example, here's a snippet of the Makefile I use for my
dissertation.  This compiles the bibliography from my Org-based reading
list:

#+BEGIN_EXAMPLE
BATCH_EMACS=$(EMACS) --batch -Q 

bib: tasks.org lib/el/bib-export.el
        $(BATCH_EMACS) --load lib/el/bib-export.el --file tasks.org --funcall 
reading-list-to-bibtex
#+END_EXAMPLE

(The code that lives in bib-export.el takes care of walking over the
reading entries in tasks.org and exporting them to Bibtex.  It is where
reading-list-to-bibtex is defined.  I'm happy to share if you want to
see it.)

This allows me to just type `make bib' to get a fresh copy of my .bib file.

Another nice thing about this approach is that you can use the -Q flag,
as I've done here, to make sure that Emacs' configuration is clean
before the export begins, which should make compilation more reliable.

-- 
Best,
Richard



Reply via email to