From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Conditionally formatting org-html-postamble-format Date: Tue, 26 Jan 2016 21:46:38 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1130ce2667d581052a439fe6 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOBRr-0008Qf-Rv for emacs-orgmode@gnu.org; Tue, 26 Jan 2016 16:46:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOBRq-00064c-JW for emacs-orgmode@gnu.org; Tue, 26 Jan 2016 16:46:51 -0500 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:38394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOBRq-00063w-8m for emacs-orgmode@gnu.org; Tue, 26 Jan 2016 16:46:50 -0500 Received: by mail-wm0-x22e.google.com with SMTP id p63so7260868wmp.1 for ; Tue, 26 Jan 2016 13:46:49 -0800 (PST) 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-org list --001a1130ce2667d581052a439fe6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I have the org-html-postamble-format set to the below: (setq org-html-postamble-format `(("en" ,(concat "Exported using " ;; "%c" is replaced with `org-html-creator-string' ;; Emacs (Org mode ) "
" "%c
" "by %a. =E2=80=94 " "
" "%d
")))) It works great except for the cases where I have set a document author to nothing using #+AUTHOR: What would be the best way to set the postamble so that the "by %a" portion does not get printed if the %a value is "". Right now, if the author is nil, the postamble gets exported as: Exported using Emacs 25.0.50.1 (Org mode 8.3.3) by . =E2=80=94 Jan 26 2016, Tue --001a1130ce2667d581052a439fe6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I have the org-html-postamble-forma= t set to the below:

(setq org-html-postamble-= format
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 `(("en"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0,(concat "Exported using "<= /div>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; "%c" is replaced wit= h `org-html-creator-string'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;= ; Emacs <VERSION> (Org mode <VERSION>)
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 "<div style=3D\"display: inline\" class= =3D\"creator\">"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 "%c</div> "
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &= quot;by %a. =E2=80=94 "
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "= ;<div style=3D\"display: inline\" class=3D\"date\"&g= t;"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "%d</div>"= ))))


It works great except fo= r the cases where I have set a document author to nothing using=C2=A0
=

#+AUTHOR:

What would be the be= st way to set the postamble so that the "by %a" portion does not = get printed if the %a value is "".

Right= now, if the author is nil, the postamble gets exported as:

<= /div>
Exported using=C2=A0
Emacs=C2=A025.0.50.1 (Org=C2=A0mode 8.3.3)
=C2=A0by . =E2=80=94=C2=A0
Jan 26 2016, Tue

--001a1130ce2667d581052a439fe6--