From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Replace EMAIL keyword by some LaTeX command Date: Tue, 15 Oct 2013 02:11:53 +0200 Message-ID: <87hacj2y0m.fsf@gmx.us> References: <525BA939.8060804@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVsCc-0000Yo-Un for emacs-orgmode@gnu.org; Mon, 14 Oct 2013 20:09:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVsCV-0005Uz-0r for emacs-orgmode@gnu.org; Mon, 14 Oct 2013 20:09:34 -0400 Received: from plane.gmane.org ([80.91.229.3]:41265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVsCU-0005Uq-QF for emacs-orgmode@gnu.org; Mon, 14 Oct 2013 20:09:26 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VVsCS-0005Pw-Ii for emacs-orgmode@gnu.org; Tue, 15 Oct 2013 02:09:24 +0200 Received: from dynamic-adsl-94-34-155-227.clienti.tiscali.it ([94.34.155.227]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Oct 2013 02:09:24 +0200 Received: from rasmus by dynamic-adsl-94-34-155-227.clienti.tiscali.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Oct 2013 02:09:24 +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 Hi Xavier, Xavier Garrido writes: But you have to be certain that this command is present. You could use etoolbox to test it. That brings in another dependency, tho. > The only point is that I do not know how to translate =#+EMAIL= org > keyword into =\email= LaTeX command. Can a export filter do it ? Of course. Should it? Up to you. . . Here's an example that you can work on. It's not well-tested and it has limitations and evident from the example. E.g. you disable it by setting #+EMAIL: . Hope it helps, Rasmus #+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 -- Enough with the bla bla!