From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: customizing preamble for org-preview-latex-fragment Date: Sun, 15 Sep 2013 17:56:42 -0400 Message-ID: <87vc21iw9x.fsf@gmail.com> References: <87txhmuqxa.fsf@free.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]:54705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLKJX-00018S-9w for emacs-orgmode@gnu.org; Sun, 15 Sep 2013 17:57:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLKJQ-0004dx-0C for emacs-orgmode@gnu.org; Sun, 15 Sep 2013 17:57:07 -0400 Received: from plane.gmane.org ([80.91.229.3]:33839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLKJP-0004dt-Pq for emacs-orgmode@gnu.org; Sun, 15 Sep 2013 17:56:59 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VLKJN-0000Nf-1E for emacs-orgmode@gnu.org; Sun, 15 Sep 2013 23:56:57 +0200 Received: from pool-108-7-96-134.bstnma.fios.verizon.net ([108.7.96.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 15 Sep 2013 23:56:57 +0200 Received: from ndokos by pool-108-7-96-134.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 15 Sep 2013 23:56:57 +0200 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 Julien Cubizolles writes: > How can I change the default packages used in the latex file generated > by org-preview-latex-fragment ? > They are produced by the function org-create-formula--latex-header, which uses the variables org-latex-default-packages-alist org-latex-packages-alist to construct the header of the latex file. These two have the same format: they are both lists of three-element sublists, where each sublist is of the form: ("options" "package" snippet-flag) Note the snippet-flag. See the docstrings of the variables for more details. If the package you want to include is missing completely from these two lists, then add it to the second variable above with a snippet-flag setting of ``t'': --8<---------------cut here---------------start------------->8--- (add-to-list 'org-latex-packages-alist '("options" "package" t)) --8<---------------cut here---------------end--------------->8--- If the package is included in one of them (probably the default list) but has been banned from being included in a snippet (by setting its snippet-flag to nil), then unban it by setting the flag to ``t''. It's probably best to do that through the customize interface. Untested, but I can't imagine anything going wrong - famous last words :-) ... -- Nick