From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas S. Dye Subject: Re: [PATCH] ox-latex: Add scrartcl LaTeX class Date: Wed, 23 Sep 2015 07:56:43 -1000 Message-ID: References: <87zj0fd07u.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeoHw-0002oj-3Z for emacs-orgmode@gnu.org; Wed, 23 Sep 2015 13:57:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeoHr-0007Np-33 for emacs-orgmode@gnu.org; Wed, 23 Sep 2015 13:57:04 -0400 Received: from gproxy5-pub.mail.unifiedlayer.com ([67.222.38.55]:60930) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ZeoHq-0007MA-T5 for emacs-orgmode@gnu.org; Wed, 23 Sep 2015 13:56:59 -0400 In-reply-to: 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: Sebastian Boehm Cc: emacs-orgmode@gnu.org, Nicolas Goaziou Aloha Sebastian, Sebastian Boehm writes: > Hi Nicolas, > > On 21 September 2015 at 21:46, Nicolas Goaziou wrote: >> But can't users needing a non-default class customize their >> own `org-latex-classes? Or is there an entitling reason to offer it out >> of the box? > > you are of course right; users can always customise their own setup. > However, when sharing Org files with other people this kind of tight > coupling between the Org file and the user's Emacs configuration can > become quite problematic. > > Granted, this is not a problem if you only work alone on all of your > projects, but it effectively prevents users from using document > classes other than the ones provided by Org mode for shared documents > (especially when sharing documents with less experienced users). > > My intention was not to start a debate on "article" vs. "scrartcl", > but it would be great to see some more variety in the default document > classes or maybe even a way to specify the desired document class as > well as the desired sectioning style directly in an Org file without > having to rely on the document class definition being available in > another user's Emacs config. Sharing documents that are highly configured, but don't rely on the user's Emacs configuration, is one goal of "reproducible research" carried out with Org mode. In general, it is possible to move the configuration into the shared Org mode document and then use Local Variables to load the configuration when the document is opened, or when the user refreshes the setup. The first step is to put the configuration into one or more Babel source code blocks in the shared document and give each source code block a name. Then set up Local Variables to called the named source code block(s) using the org-sbe (formerly, sbe) function. Here is a fragment of the Local Variables section I'm using on a self-contained Org mode document. # Local Variables: # eval: (require 'ox-latex) # org-hide-macro-markers: t # org-entities-user: nil # eval: (and (fboundp 'org-sbe) (not (fboundp 'sbe)) (fset 'sbe 'org-sbe)) # eval: (sbe "user-entities") # End: Where the source code block named "user-entities" is: *** User Entities The following source code block sets up user entities that are used frequently in my work. I use the various =*macron= commands to typeset Hawaiian language words with what is known in Hawaiian as a /kahak\omacron{}/. #+name: user-entities #+begin_src emacs-lisp (add-to-list 'org-entities-user '("amacron" "\\={a}" nil "ā" "a" "a" "ā")) (add-to-list 'org-entities-user '("emacron" "\\={e}" nil "ē" "e" "e" "ē")) (add-to-list 'org-entities-user '("imacron" "\\={\\i}" nil "ī" "i" "i" "ī")) (add-to-list 'org-entities-user '("omacron" "\\={o}" nil "ō" "o" "o" "ō")) (add-to-list 'org-entities-user '("umacron" "\\={u}" nil "ū" "u" "u" "ū")) (add-to-list 'org-entities-user '("Amacron" "\\={A}" nil "Ā" "A" "A" "Ā")) (add-to-list 'org-entities-user '("Emacron" "\\={E}" nil "Ē" "E" "E" "Ē")) (add-to-list 'org-entities-user '("Imacron" "\\={I}" nil "Ī" "I" "I" "Ī")) (add-to-list 'org-entities-user '("Omacron" "\\={O}" nil "Ō" "O" "O" "Ō")) (add-to-list 'org-entities-user '("Umacron" "\\={U}" nil "Ū" "U" "U" "Ū")) #+end_src Let me know if you have questions. hth, Tom -- Thomas S. Dye http://www.tsdye.com