From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xavier Garrido Subject: Re: Replace EMAIL keyword by some LaTeX command Date: Tue, 15 Oct 2013 08:08:12 +0200 Message-ID: <525CDBCC.2070608@gmail.com> References: <525BA939.8060804@gmail.com> <87hacj2y0m.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVxnh-0003I9-FE for emacs-orgmode@gnu.org; Tue, 15 Oct 2013 02:08:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVxnb-00088v-Kx for emacs-orgmode@gnu.org; Tue, 15 Oct 2013 02:08:13 -0400 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:58403) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVxnb-00088m-Cv for emacs-orgmode@gnu.org; Tue, 15 Oct 2013 02:08:07 -0400 Received: by mail-wi0-f171.google.com with SMTP id h11so191761wiv.4 for ; Mon, 14 Oct 2013 23:08:06 -0700 (PDT) In-Reply-To: <87hacj2y0m.fsf@gmx.us> 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: Rasmus , emacs-orgmode@gnu.org Hi Rasmus, It works like a charm ! Thanks a lot for the trick and for your help. Xavier Le 15/10/2013 02:11, Rasmus a écrit : > > #+BEGIN_SRC Org > #+TITLE: LaTeX test > #+AUTHOR: toto > #+EMAIL: toto@toto.org > #+LATEX_HEADER: \usepackage{nopkg} > #+OPTIONS: with-email: t > Note that > 1. email is inserted after other =latex_headers= > 2. with-email is ignored and only the presence of email matters. > - You could add a check to =(plist-get options :with-email)= in > the =(and ...)= statement below and remove the =\thanks{.}= in > a final output filter. > > #+begin_src emacs-lisp > (defun rasmus/force-insert-email (options backend) > "Insert EMAIL as \email{EMAIL} in the latex backend when EMAIL is present." > (when (and (org-export-derived-backend-p backend 'latex) > (plist-get options :email)) > (plist-put options :latex-header > (mapconcat 'identity > (remove nil > (list > (plist-get options :latex-header) > (format "\\email{%s}" > (plist-get options :email)))) > "\n")) > ;; don't insert email in \thanks{.} > (plist-put options :with-email nil)) > options) > > (add-to-list 'org-export-filter-options-functions 'rasmus/force-insert-email) > #+end_src > #+END_SRC > >