From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: [PATCH] ox-latex: Add scrartcl LaTeX class Date: Thu, 24 Sep 2015 11:04:28 +0100 Message-ID: <87k2rg9lqr.fsf@delle7240.chemeng.ucl.ac.uk> References: <87zj0fd07u.fsf@nicolasgoaziou.fr> <87vbb1ngqc.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf3Wt-0001WM-Bl for emacs-orgmode@gnu.org; Thu, 24 Sep 2015 06:13:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zf3Wo-0007dK-CV for emacs-orgmode@gnu.org; Thu, 24 Sep 2015 06:13:31 -0400 Received: from mail-am1on0141.outbound.protection.outlook.com ([157.56.112.141]:12000 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf3Wo-0007d9-4Z for emacs-orgmode@gnu.org; Thu, 24 Sep 2015 06:13:26 -0400 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: Ista Zahn Cc: emacs-orgmode Mailinglist , Sebastian Boehm On Wednesday, 23 Sep 2015 at 14:27, Ista Zahn wrote: > On Wed, Sep 23, 2015 at 2:16 PM, Eric S Fraga wrote: [...] >> One solution, but not an ideal one, is to use file local variables to >> define org-latex-classes (and any other variables) as appropriate for >> the document. It's not ideal because unfortunately most of org's >> variables (as well as many of emacs's own) are "global" and hence affect >> the functionality of org visiting other buffers. I find myself having >> separate emacs instances for some org files for this reason. > > Doesn't "setq-local" solve this problem? Seems to! Thanks. I have done the following: #+begin_src org ,#+title: Testing setq-loccal ,#+latex_class: esftest ,* settings :noexport: ,#+name: startup ,#+begin_src emacs-lisp :results none (setq-local org-latex-classes '(("esftest" "\\documentclass{scrartcl}" ("\\section*{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))) ,#+end_src # Local Variables: # eval: (esf/execute-startup-block) # End: #+end_src where esf/execute-startup-block executes the src block named "startup". The issue is complicated by the fact that exporters generate a new buffer which has its own variables (hence the use of #+bind:) so some variables should be set using bind but others potentially using setq-local. Thanks again, eric -- : Eric S Fraga (0xFFFCF67D), Emacs 24.5.1, Org release_8.3.1-203-g4ca3d3