emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Richard Lawrence <richard.lawrence@berkeley.edu>
To: emacs-orgmode@gnu.org
Cc: Alan Schmitt <alan.schmitt@polytechnique.org>
Subject: Re: Better way to specify the latex documentclass of an exported file without changing my configuration?
Date: Wed, 26 Mar 2014 16:26:16 -0700	[thread overview]
Message-ID: <874n2ktucn.fsf@berkeley.edu> (raw)
In-Reply-To: m2siq52kl5.fsf@polytechnique.org

Hi Alan,

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

> Feng Shu <tumashu@gmail.com> writes:
>
>> Alan Schmitt <alan.schmitt@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	other threads:[~2014-03-26 23:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-26  8:37 Better way to specify the latex documentclass of an exported file without changing my configuration? Alan Schmitt
2014-03-26  9:24 ` Feng Shu
2014-03-26 12:38   ` Fabrice Niessen
2014-03-26 12:53     ` Alan Schmitt
2014-03-26 18:46       ` Thomas S. Dye
2014-03-26 22:03         ` Alan Schmitt
2014-03-26 12:47   ` Alan Schmitt
2014-03-26 23:26     ` Richard Lawrence [this message]
2014-03-26 13:21 ` Nicolas Goaziou
2014-03-26 13:54   ` Alan Schmitt
2014-03-26 14:10     ` Nicolas Goaziou
2014-03-26 14:57       ` Alan Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874n2ktucn.fsf@berkeley.edu \
    --to=richard.lawrence@berkeley.edu \
    --cc=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).