emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] ox-latex: Add scrartcl LaTeX class


From: Thomas S . Dye
Subject: Re: [O] [PATCH] ox-latex: Add scrartcl LaTeX class
Date: Wed, 23 Sep 2015 07:56:43 -1000

Aloha Sebastian,

Sebastian Boehm <address@hidden> writes:

> Hi Nicolas,
>
> On 21 September 2015 at 21:46, Nicolas Goaziou <address@hidden> 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 "&#0257" "a" "a" 
"ā"))
  (add-to-list 'org-entities-user '("emacron" "\\={e}" nil "&#0275" "e" "e" 
"ē"))
  (add-to-list 'org-entities-user '("imacron" "\\={\\i}" nil "&#0299" "i" "i" 
"ī"))
  (add-to-list 'org-entities-user '("omacron" "\\={o}" nil "&#0333" "o" "o" 
"ō"))
  (add-to-list 'org-entities-user '("umacron" "\\={u}" nil "&#0363" "u" "u" 
"ū"))
  (add-to-list 'org-entities-user '("Amacron" "\\={A}" nil "&#0256" "A" "A" 
"Ā"))
  (add-to-list 'org-entities-user '("Emacron" "\\={E}" nil "&#0274" "E" "E" 
"Ē"))
  (add-to-list 'org-entities-user '("Imacron" "\\={I}" nil "&#0298" "I" "I" 
"Ī"))
  (add-to-list 'org-entities-user '("Omacron" "\\={O}" nil "&#0332" "O" "O" 
"Ō"))
  (add-to-list 'org-entities-user '("Umacron" "\\={U}" nil "&#0362" "U" "U" 
"Ū"))
#+end_src

Let me know if you have questions.

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]