问题
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.
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/9742836/how-do-i-format-the-postamble-in-html-export-with-org-mode