Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

Footnotes

Summary: Simple footnote markup
Version: 1.0.0
Prerequisites: pmwiki 2.0 and above
Status: Stable
Maintainer: TonyColley
Categories: Markup

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?

Usage

Download footnote.phpΔ and place it in your cookbook directory.

Add the following line to local/config.php

include_once("cookbook/footnote.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.)

Notes

This recipe was extracted from MarkupExtensions for those of us who just want footnote capability without all the other extensions provided by that recipe.

Release Notes

Comments

Does not work with the Confluence script : http://pmwiki.org/wiki/Test/Confluence Profiles.SH - 6 Aug 2007

Just an observation that embedding a link inside the Footnote text works normally in the Simple Footnote, but is not processed by the Extended Footnote and simply appears in full as text, complete with its double square brackets. Des October 07, 2007, at 05:30 PM

The code of the footnote script dosen't allow PmWiki to work with CSS pseudo selector: ":target". To highlight some text the text must be betwixt the opening and the closing tags of anchor. I change the lines:

     $r = "<sup><a  class='footnote' href='#fn$fnid'>$fncount</a></sup>".
          "<a name='fnr$fnid' id='fnr$fnid'></a>";
     $foottext = stripslashes( $foottext );
     $fntext .= "<p class='footnote'><a name='fn$fnid' id='fn$fnid'></a>";
     $fntext .= "<sup>$fncount</sup> $foottext <a href='#fnr$fnid'>&uArr;</a></p>";

to:

     $r = "<sup id='fnr$fnid'><a  class='footnote' href='#fn$fnid'>[$fncount]</a></sup>";
     $foottext = stripslashes( $foottext );
     $fntext .= "<p id='fn$fnid' class='footnote'>";
     $fntext .= "<sup>$fncount</sup> <a href='#fnr$fnid'>&uArr;</a> $foottext</p>";

'Tis working only with [^@^] markup. You can add this CSS style for pseudo selector target:

:target {
    -webkit-animation: highlight 6s 0.1s 1;
    -moz-animation: highlight 6s 0.1s 1;
	-ms-animation: highlight 6s 0.1s 1;
	-o-animation: highlight 6s 0.1s 1;
	animation: highlight 6s 0.1s 1;
}

@-webkit-keyframes highlight {
    0% { background-color: red; }
    100% { background-color: white; }
}
@-moz-keyframes highlight {
    0% { background-color: red; }
    100% { background-color: white; }
}
@-ms-keyframes highlight {
    0% { background-color: red; }
    100% { background-color: white; }
}
@-o-keyframes highlight {
    0% { background-color: red; }
    100% { background-color: white; }
}
@keyframes highlight {
    0% { background-color: red; }
    100% { background-color: white; }
}

Jl Alice - 16 May 2013

See Also

  • MarkupExtensions
  • 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)

Contributors

User notes +2: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

Edit - History - Print - Recent Changes - Search
Page last modified on May 20, 2013, at 03:57 AM