Referencing to a Common Reference Page

By JSVJSV

Description

This addresses these problems:

  1. The [[footnote]] tag creates a list only for the current page, rather than for a list common to all (or some) pages.
  2. Use of the ^^superscript^^ mark-up causes the baseline to be moved, making the text look ugly.
  3. The underlining of references disrupts the text.

A CSS solution, and a non-CSS solution is offered here.

  1. The CSS solution uses a [[span]] tag of class ref, and benefits from the automatic inclusion of [ and ] symbols either side (which widen the focus target). Unfortunately, IE6 does not render the :before and :after elements of the style, so you may adapt this to omit the :before and :after, and put them into the referring block as escaped literals.
  2. The non-CSS version packs the same information into a style attribute for a [[span]] tag, but does not change the text decoration of the link.

Attribution

Based on code found here.

Code

CSS version

Referring code (in your page)

[[span class="ref"]][[[references|3]]][[/span]]

CSS code (in your custom CSS Theme)

.ref {
    position:relative;
    font-size:85%;
    top:-0.9ex;
    margin-left:0.2em;
    margin-right:0.1em;
}
.ref a {
    text-decoration: none;
    border-bottom: solid 1px black;
}
.ref a:before {
    content: "["
}
.ref a:after {
    content: "]"
}

Non-CSS version (using style)

[[span style="position:relative; font-size:85%; top:-0.9ex; margin-left:0.2em; margin-right:0.1em;"]]@@[@@[[[references|3]]]@@]@@[[/span]]

In action

Standard footnote (illustrating the problem)

Superscripting normally disrupts the spacing in your text lines (the rest of this sentence has been put here as padding, to provide sufficient text to show that the line spacing is disrupted in this example). Here is an example of a standard footnote1. You'll see that the line spacing is disrupted (the rest of this sentence has been put here as padding, to provide sufficient text to show that the line spacing is disrupted in this example).

Suggested reference format (CSS example)

See this page for the CSS example.

Suggested reference format (non-CSS, inline example)

Superscripting normally disrupts the spacing in your text lines (the rest of this sentence has been put here as padding, to provide sufficient text to show that the line spacing is preserved in this example). This line contains a reference[3] to another page, using the non-CSS method. You'll notice that the line spacing is not disrupted by the superscripted reference (the rest of this sentence has been put here as padding, to provide sufficient text to show that the line spacing is preserved in this example).


Thanks to tsangk for this great snippet: conditional-blocks


text above inserted with:

[[include :snippets:if START |unique=1|type=equal|var1=%%name%%|var2=conditional-blocks]]
**##red|Thanks to tsangk for this great snippet:##** [[[code:conditional-blocks]]]
[[include :snippets:if END]]



Other snippets posted by JSV

Page Collections and Sequence Boxes - 16 Feb 2012 01:28
Easy Table Title Footers - 15 Feb 2012 00:49


Rate this solution

If you think this solution is useful — rate it up!

rating: +6+x
Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License