Wikipedia:Advanced footnote formatting: Difference between revisions

Content deleted Content added
Indenting and line-splitting: re-split examples of {cite book} & ref-tag to fit smaller screens
narrow examples & auto-scroll the long example text to fit smaller handheld devices, by: <div style="width:auto; overflow:scroll">
Line 75:
A very long footnote can be indented and line-split, as in the following example that uses [[Template:Cite_book]], showing a long URL for a webpage from [[Google Books]]:
 
<div style="width:auto; overflow:scroll">
<source lang="xml+jinja">
In [[digital imaging]], a '''pixel'''<ref>{{Cite book
| author=Rudolf Graf | date=1999
| title=Modern Dictionary of Electronics
| publisher=Newnes | ___location=Oxford
| isbn=0-7506-43315 | page= 569
| url=http://books.google.com/books?<!--
-->?id=o2I1JWPpdusCo2I1JWPdusC&pg=PA569&dq=pixel<!--
-->+intitle:%22Modern+Dictionary<!--
-->+of+Electronics%22+inauthor:graf&<!--
-->lr=&as_brr=0&ei=5ygASM3qHoSgiwH455ygASM3qHoSgwH45-<!--
-->GIDA&sig=7tg-LuGdu6Njypaawi2bbkeq8pw }}</ref>
(or picture element) is the smallest part of an image.
</source></div>
Note the above line-splitting of the 6-line URL (for the webpage in Google Books) uses the [[HTML]] comment tokens "&lt;!--" and "-->". Each part of the footnote coding is placed on a separate line, thereby allowing each part to be indented from the lefthand side. There must be no spaces added to the URL (which is a single string of characters where spaces are coded "%20"). Do not add spaces before "&lt;!--" or after "-->" within the URL. However, when splitting an ''italicized phrase'' or long wikilink ("<nowiki>[[xx xx xx]]</nowiki>"), consider putting a space after "-->" on the 2nd line.
 
Line 98 ⟶ 99:
Because of a Wikipedia formatting quirk, the first footnote on a page might be treated as a quotebox when indented (as during May 2009). However, the indentation can be simulated, by line-splitting with HTML comments, between all lines within &lt;ref>....&lt;/ref>:
 
<source lang="xml" style="text-size:70;">
In [[digital imaging]], a pixel<ref><!--
-->RudolfR. Graf, ''Modern Dictionary of<!--
--> Electronics'', 1999, Newnes.<!--
-->page 569, ISBN 0-7506-43315.<!--
-->Google Books (''see:'' References).</ref>
(or picture element) is the smallest part of an image.
</source>
 
The above line-splitting of the entire footnote text, into 34 lines, allows it to be coded as the first footnote of a page. Note that the first footnote might be in an infobox, appearing at the top of a page.
 
==Page numbers==