emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* customizing preamble for org-preview-latex-fragment
@ 2013-09-15 13:59 Julien Cubizolles
  2013-09-15 21:56 ` Nick Dokos
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Cubizolles @ 2013-09-15 13:59 UTC (permalink / raw)
  To: emacs-orgmode

How can I change the default packages used in the latex file generated
by org-preview-latex-fragment ?

Julien.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: customizing preamble for org-preview-latex-fragment
  2013-09-15 13:59 customizing preamble for org-preview-latex-fragment Julien Cubizolles
@ 2013-09-15 21:56 ` Nick Dokos
  2013-09-16 10:49   ` Rasmus
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Dokos @ 2013-09-15 21:56 UTC (permalink / raw)
  To: emacs-orgmode

Julien Cubizolles <j.cubizolles@free.fr> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: customizing preamble for org-preview-latex-fragment
  2013-09-15 21:56 ` Nick Dokos
@ 2013-09-16 10:49   ` Rasmus
  2013-09-16 16:29     ` Julien Cubizolles
  0 siblings, 1 reply; 4+ messages in thread
From: Rasmus @ 2013-09-16 10:49 UTC (permalink / raw)
  To: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:

> Julien Cubizolles <j.cubizolles@free.fr> 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

and If you want to get real dirty look at `org-format-latex-header`.

Any package you load with #+LATEX_HEADER should also be part of the
preview tex document.

–Rasmus

-- 
. . . It begins of course with The Internet.  A Net of Peers.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: customizing preamble for org-preview-latex-fragment
  2013-09-16 10:49   ` Rasmus
@ 2013-09-16 16:29     ` Julien Cubizolles
  0 siblings, 0 replies; 4+ messages in thread
From: Julien Cubizolles @ 2013-09-16 16:29 UTC (permalink / raw)
  To: emacs-orgmode

Rasmus <rasmus@gmx.us> writes:

> Nick Dokos <ndokos@gmail.com> writes:
>
>> Julien Cubizolles <j.cubizolles@free.fr> 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
>
> and If you want to get real dirty look at `org-format-latex-header`.
>
> Any package you load with #+LATEX_HEADER should also be part of the
> preview tex document.

It's working, I think the best would be to make a custom tex including
all necessary packages and include it in this manner.

Julien C.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-16 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-15 13:59 customizing preamble for org-preview-latex-fragment Julien Cubizolles
2013-09-15 21:56 ` Nick Dokos
2013-09-16 10:49   ` Rasmus
2013-09-16 16:29     ` Julien Cubizolles

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).