Questions answered by this recipe
Is there a way to automatically number footnotes and to have them all automatically displayed at the bottom of the page?
Add the following line to local/config.php
Wherever you want a footnote in your text, simply use the
[^footnote text^] markup.
When you want to display all the footnotes you have so far, below a short blue horizontal rule, use the markup
[^#^] (on a line by itself; it won't break the recipe to do otherwise, but it might look funky).
If you do not want the short blue horizontal rule, but just a listing of all the footnotes defined so far, use the markup
[^@^] (on a line by itself, too).
You may have multiple occurrences of the listing markups; each one will display only the footnotes created in the text since the last listing markup. (So you can have footnotes at the end of each section of your text, for example.)
The original version of this recipe was extracted from MarkupExtensions for those of us who just want footnote capability without all the other extensions provided by that recipe.
You can put in the group footer the markup to display the footnotes, so authors don't have to remember to add it.
A newer version makes two improvements:
[^#^]is used, the blue line will only appear when footnotes actually exist on the page.
- Unlike the original version, it's compatible with PHP 5.5+.
To use the newer version, download footnote2.phpΔ instead of footnote.phpΔ, and put in your configuration file
include_once("cookbook/footnote2.php"); instead of
The new version is compatible with PmWiki 2.2.58 and newer, and has no requirements for PHP version. The original version is compatible with PmWiki 2.0 and higher, but requires PHP 5.4 or older.
- New version that works in PHP 5.5+, and prevents gratuitous blue lines: footnote2.phpΔ
- Slightly modified variant of original recipe to prevent gratuitous blue lines (<PHP 5.5): footnoteifany.phpΔ
- FootnotesExtended (an extension that makes separating the footnote text from the footnote reference possible; better for large footnote texts and if references to the same text reoccur)
- Cookbook:AddFootnote - creates a GUI edit button to transform selected text into a footnote
- jr (the MarkupExtensions recipe)
- RandyB - modified to omit gratuitous blue lines and to work with PHP 5.5
See discussion at Footnotes-Talk