8

I am creating a website with org-mode and would like to format the postamble so it just shows the date created and the creator at the bottom of the page, in the center, and is horizontal.

In my .emacs I have

(setq org-export-html-postamble-format "Last Updated %d. Created by %c")

and at the top of my index.org (and all other pages) I have

# -*- org-export-html-postamble:t; -*-

The postamble is formatted like this currently:

Date: 16 March 2012

Org version 7.8.03 with Emacs version 24

Validate XHTML 1.0

arrayed vertically, which I don't very much like.

2
  • Can you write/add an explicit example how you hacked the postamble?
    – Dror
    Oct 22, 2012 at 10:38
  • (setq org-export-html-postamble-format '(("en" "Last Updated %d. Created by Org-Mode in Emacs. May the Force be with you.")))
    – Zach
    Dec 21, 2012 at 18:37

2 Answers 2

11

The reason it isn't accepting your own postamble is because you have to use #+BIND: syntax for the variable so that it is used on export. (See Export Options)

After changing that setting I also had to adjust your format slightly to fit the required syntax. The default value for org-export-html-postamble-format is:

(("en" "<p class=\"author\">Author: %a (%e)</p>
<p class=\"date\">Date: %d</p>
<p class=\"creator\">Generated by %c</p>
<p class=\"xhtml-validation\">%v</p>
"))

So you'd have to do the following to have it included (matching as closely as possible to that format):

(setq org-export-html-postamble-format 
      '(("en" "<p class=\"postamble\">Last Updated %d. Created by %c</p>")))

This however will not center your text, it exports as follows:

<div id="postamble">
<p class="postamble">Last Updated 2012-03-16 16:22:03 Eastern Daylight Time. Created by Org version 7.8.03 with Emacs version 24
</div>

I believe you'd have to set up a custom stylesheet with p.postamble { text-align: center; } to get the centering to work.

5
  • Figured it out around the same time you replied. Exactly what I did though. Thanks!
    – Zach
    Mar 16, 2012 at 21:27
  • 1
    Can you add an explicit code for the BIND part? Some reference? Thanks
    – Dror
    Oct 19, 2012 at 13:11
  • The variable seems to be renamed to org-html-postamble-format these days. Jan 5, 2016 at 13:44
  • 2
    Now org-html-postamble-format won't work. It becomes org-html-postamble.
    – Jordan He
    Mar 2, 2021 at 0:29
  • 1
    Thanks @JordanHe - The answer I think should be updated accordingly for this Jul 23, 2021 at 20:10
5

The simplest configuration you need is:

(setq org-html-postamble "Your postamble here")

This sets the postable directly.

To see what options you have for your postamble, type:

C-h v org-html-postamble-format

You'll see it lists:

%t stands for the title.
%a stands for the author's name.
%e stands for the author's email.
%d stands for the date.
%c will be replaced by `org-html-creator-string'.
%v will be replaced by `org-html-validation-link'.
%T will be replaced by the export time.
%C will be replaced by the last modification time.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.