emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Replace EMAIL keyword by some LaTeX command


From: Xavier Garrido
Subject: Re: [O] Replace EMAIL keyword by some LaTeX command
Date: Tue, 15 Oct 2013 08:08:12 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

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:  address@hidden
#+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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]