How do I format the postamble in HTML-export with Org-mode?

六月ゝ 毕业季﹏ 提交于 2019-12-03 06:44:57
Jonathan Leech-Pepin

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.

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.
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!