From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: [ANN] ox-extras (was: BEGIN_LATEX_HEADER [cont]) Date: Sat, 21 Jun 2014 22:00:39 -0400 Message-ID: <87mwd5bt4o.fsf@gmail.com> References: <87wqccbgvj.fsf@gmail.com> <864mzghvcl.fsf@somewhere.org> <87ppi4t15s.fsf@nicolasgoaziou.fr> <87simzu6f4.fsf@nicolasgoaziou.fr> <87mwd624xg.fsf@gmail.com> <87simyk796.fsf@nicolasgoaziou.fr> <87tx7dbwqo.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WyX5P-0000hx-0g for emacs-orgmode@gnu.org; Sat, 21 Jun 2014 22:01:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WyX5G-00053y-0U for emacs-orgmode@gnu.org; Sat, 21 Jun 2014 22:00:50 -0400 Received: from mail-qg0-x235.google.com ([2607:f8b0:400d:c04::235]:62450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WyX5F-00053m-Qw for emacs-orgmode@gnu.org; Sat, 21 Jun 2014 22:00:41 -0400 Received: by mail-qg0-f53.google.com with SMTP id i50so4790518qgf.12 for ; Sat, 21 Jun 2014 19:00:41 -0700 (PDT) In-Reply-To: <87tx7dbwqo.fsf@gmail.com> 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: Nicolas Goaziou , Ken Mankoff Cc: emacs-orgmode@gnu.org 2014ko ekainak 21an, Aaron Ecay-ek idatzi zuen: [...] >> Eventually, if you insist on writing your full preamble within the >> document, you can start to write it in a LaTeX-mode buffer, copy it in >> your Org document and add "#+LATEX_HEADER: " in front of each line. >> This last step is done easily with `string-rectangle' (C-x r t). >=20 > This is basically making the user do (something like) org-edit-special > manually. It can probably be automated somewhat =E2=80=93 I=E2=80=99ll w= ork on a > patch. This is now implemented in a new library in contrib, ox-extras. This is intended as a semi-official, semi-curated repository for helpful pieces of org export hooks and customizations. Differently than worg, the aim is to make it easy for users to load the snippets through the ox-extras-activate function. Even so, I hope this will be an =E2=80=9Cexecutable wiki=E2=80= =9D where anyone (who has commit access to the org repo) is free to contribute new hook functions and improve existing ones. In the present case, if you execute (ox-extras-activate '(latex-header-blocks)) you will be able to use blocks of the following form: #+header: :header yes #+begin_latex \foo{} \bar{} #+end_latex These will be transformed so that the begin/end wrapper is removed and each line is prepended with #+latex_header: on export. They can be edited as latex code with the usual org-edit-special function (C-c '). The #+header: :header yes line is a bit confusing. The first #+header: is part of org syntax that allows us to tag blocks (and other elements) with plists. The :header yes in the plist indicates that this block should be treated as a latex_header, and not a normal type of latex block. Thanks, --=20 Aaron Ecay