From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Lawrence 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 Message-ID: <874n2ktucn.fsf@berkeley.edu> References: <87ob0tjorv.fsf@news.tumashu-localhost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSxEy-0005X4-Ku for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 19:28:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSxEt-0001zy-7v for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 19:28:12 -0400 Received: from plane.gmane.org ([80.91.229.3]:46019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSxEt-0001zs-0Q for emacs-orgmode@gnu.org; Wed, 26 Mar 2014 19:28:07 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WSxEp-0005zt-CE for emacs-orgmode@gnu.org; Thu, 27 Mar 2014 00:28:03 +0100 Received: from c-67-164-45-159.hsd1.ca.comcast.net ([67.164.45.159]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Mar 2014 00:28:03 +0100 Received: from richard.lawrence by c-67-164-45-159.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Mar 2014 00:28:03 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Alan Schmitt Hi Alan, Alan Schmitt writes: > Feng Shu writes: > >> Alan Schmitt 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