User:MinorProphet/The joy of sfn

Ongoing test page, with various mistakes to be sorted.

Intro edit

This essay/how-to deals with the referencing technique of inline help:shortened footnotes combined with a bibliography at the end. There are are several other ways of reffing: all have their pros and cons.

The techniques described here use {{template}}s, which in turn use Wikipedia's own CS1|2 software. This has been developed over the years by editors on English WP to display eg bibliographical information in a specific way. It is pretty much unique to WP, and using the templates results in what I call the 'Wikipedia style'. It takes modified elements of Chicago and AMA referencing, but you tend to only find it on WP. Many other WP language projects use CS1|2 as well, either 'as is' or in a modified form.

The term 'Harvard referencing' is heavily and widely misused on Wikipedia. The {{Harv}} template uses Harvard referencing, which anyway is relatively fluid and open to interpretation, unlike Chicago referencing or AMA referencing etc. I even think that inline parenthetical referencing may now be discouraged.

TTD

Need to find out how to make two columns, one with code, one with result. Check out Help pages (argh)...

NB There are now so many errors resulting from various changes to the underlying templates, CS1/2 software etc., that most of this page doesn't make much sense any more, and won't unless I completely revise it. MinorProphet (talk) 11:55, 12 April 2021 (UTC)

I think the best solution is probably to Blow it up and start over. MinorProphet (talk) 21:41, 11 May 2021 (UTC)

Latest finks edit

  1. Click on Special:preferences → Gadgets and disable 'Navigation popups' and enable 'Reference Tooltips'. This allows you to hover the mouse over an {{sfn}}, which pops up the short footnote in the {{reflist}}; hovering over this pops up the {{cite}} in the bibliography. Clicking on either of these takes you straight to the ref or cite, and you will have to click 'back'. This has recently been made the default.
  2. Copy and paste importScript('User:Svick/HarvErrors.js'); // Backlink: [[User:Svick/HarvErrors.js]] to your common.js page. This shows up various errors and warnings to do with {{sfn}}s, {{harv}}s and {{cite}}s. Very useful in debugging.

This extreme example (lol) demonstrates the relationship between various templates.

  • The full list of authors etc. in a {{cite}} can be used for metadata purposes.
  • {{sfn}} displays up to three authors etc., all of whom must appear in the {sfn}.
  • For exactly four authors, {{sfn}} displays |author1-last 'et al.'
  • If there are more than four authors, the {{sfn}} should contain only the first four.
  • More than four authors can be used in an {sfn}, but it generates a preview warning and displays |author1-last 'et al.' anyway.
  • If |display-authors= etc. is used, the {{cite}}and the {{sfn}} only ever display that number of authors: but the {{sfn}} must use all the authors, up to four.
  • |ref={{harvid|any text|date}} overrides the CITEREF, allowing complete freedom, but the {{sfn}} must use it.
Some thoughts on small footnotes (sfn)

Intro edit

The {{sfn}} (short footnote) template uses the {{harv}} Harvard cataloguing system in conjunction with the {{cite}} template to automatically create inline references and to combine references to the same book and page.

It effectively replaces the <ref name=Whatever_0134> system as it creates its own ref name which you don't need to know or worry about. (Unless it all goes wrong...)

Why standard Footnotes don't work edit

Example of an ordinary ref name:

Some text with an inline reference.<ref name=Smith_2009> Smith, Tim (2009). ''The Big Book of Interesting Stuff''. Huge Book Co. Houston, TX, p. 67.</ref>, resulting in:
"Some text with an inline reference.[1]

Then you later refer to it with:

Some more text using the same source and page.<ref name=Smith_2009 /> , resulting in:
"Some more text using the same source and page."[1]

But then it gets a bit difficult if you want to refer to a different page:

Even more text referring to another page.<ref>Smith (2009), p. 42</ref>, which gives you
"Even more text referring to another page."[2]

But the link to the original ref name with its page is broken. I think there are various ways of getting around the problem, but I feel that the {{sfn}} system is simpler and more consistent.

References

  1. ^ a b Smith, Tim (2009). The Big Book of Interesting Stuff. Huge Book Co. Houston, TX., p. 67
  2. ^ Smith (2009), p. 42

The sfn way edit

(Alas, WP can't cope with multiple {cite books} defined on the same page so multiple targets (3×) errors abound...)

Instead, do this:

  1. Create a 'Sources' sub-section under References.
  2. For each book you use, create a {{cite book}} in the Sources section. It only takes a few minutes with practice, but there are various mistakes to be made. The Wikipedia enhanced editor bar includes a Cite book button, but I prefer doing it manually.
  3. Always use the |ref=harv parameter, or the {{sfn}} will show as a blue link, but will not open up in the 'Sources' section. Fixed, {cite book} now automatically creates a CITEREF which {sfn} can link to.
  4. Now, just use {sfn}s int the main text instead of ref names,{{sfn|Smith|2009|p=26}} resulting in [1].
  5. You can also use {sfn}s with {{cite journal}} as long you have provided an |last=, |first= and |date= for any {{cite}} to work with {sfn}s. |date= can include YYYY, MMYYYY or DDMMYY etc. To distinguish books etc. published in the same year, you can use |date=2018a, |date=2018b, etc.
  6. For re-usable cites for newspapers I tend use to use {{cite news}} with a ref name. Many newspaper articles don't have an author (thus no good with {{harv}}), and even long articles only up take one or two pages.
  7. All parameter names use lower-case only, ie |title= and not |Title= .
  8. I use a hidden comment within {cite book} for the actual {Sfn} itself so I don't have to remember the details, I just scroll down to the 'Sources' section, and there it is. See 'Sources' sction below.

All the references to the same page(s) will now be automatically grouped together in the {{reflist}}, like this.{{sfn|Smith|2009|p=26}} and you don't have to remember the instantly forgettable name you gave it three weeks ago.[1].

I tend to open the whole page for editing, rather than just a single section, because you need to have the 'Sources' section available all the time to add a new cite when you find it.[2] NB Compare with <ref>Smith (2009), p. 42</ref> which results in this.[3]


References

  1. ^ a b Smith 2009, p. 26. sfn error: multiple targets (3×): CITEREFSmith2009 (help)
  2. ^ Smith 2009, p. 42. sfn error: multiple targets (3×): CITEREFSmith2009 (help)
  3. ^ Smith (2009), p. 42
Sources
  • Smith, Tim (2009). The Big Book of Interesting Stuff. Houston, TX: Huge Book Co. {{cite book}}: Unknown parameter |duplicate-ref= ignored (help)


  • {{cite book

 |duplicate-ref=none
|ref=harv
<!--{{sfn|Smith|2009|p=}} -->
 |last=Smith
 |first=Tim
 |title=The Big Book of Interesting Stuff
 |publisher=Huge Book Co.
 |place=Houston, TX
 |year=2009
 |url=http://waaark.com/error404}} - Fix this!

Example using ref names edit

According to Jones something dull happened,<ref name=Jones_2009>Jones, Gary (2009). ''The Small Book of Dull Stuff''. London: Tiny Editions, p. 253.</ref> but Smith says it was interesting.<ref name=Smith_2009> Smith, Tim (2009). ''The Big Book of Interesting Stuff''. Huge Book Co. Houston, TX, p. 67.</ref>
"According to Jones something dull happened,[1] but Smith says it was interesting.[2]
Smith says other interesting things on the same page,<ref name=Smith_2009 /> and Jones drones on and on as usual <ref name=Jones_2009 />, but they both reach the same conclusion on another page.<ref>Smith (2009), p. 367.</ref><ref>Jones (2005), p. 458.</ref>
"Smith says other interesting things on the same page,[2] and Jones drones on and on as usual [1], but they both reach the same conclusion on another page."[3][4]


References

  1. ^ a b Jones, Gary (2009). The Small Book of Dull Stuff. London: Tiny Editions, p. 253.
  2. ^ a b Smith, Tim (2009). The Big Book of Interesting Stuff. Huge Book Co. Houston, TX, p. 67.
  3. ^ Smith (2009), p. 367.
  4. ^ Jones (2005), p. 458.

Example using {{sfn}} edit

According to Jones,{{sfn|Jones|2005|p=253}} something dull happened, but Smith says it was interesting.{{sfn|Smith|2009|p=67}}
"According to Jones something dull happened,[1] but Smith says it was interesting.[2]
Smith says other interesting things on the same page,{{sfn|Smith|2009|p=67}} and Jones drones on and on as usual:{{sfn|Jones|2005|p=253}} but they both reach the same conclusion on another page."{{sfn|Smith|2009|p=367}}{{sfn|Jones|2005|p=458}}
"Smith says other interesting things on the same page,[2] and Jones drones on and on as usual:[1] but they both reach the same conclusion on another page."[3][4]

References

  1. ^ a b Jones 2005, p. 253. sfn error: multiple targets (2×): CITEREFJones2005 (help)
  2. ^ a b Smith 2009, p. 67. sfn error: multiple targets (3×): CITEREFSmith2009 (help)
  3. ^ Smith 2009, p. 367. sfn error: multiple targets (3×): CITEREFSmith2009 (help)
  4. ^ Jones 2005, p. 458. sfn error: multiple targets (2×): CITEREFJones2005 (help)
Sources

Other Stuff edit

Big hint

You can't use an {sfn} within a normal inline ref, such as <ref>A little footnote with an {{sfn|Smith|2005|p=13}}.</ref> This gives you an error:

A little footnote with an {sfn} follows.[1]

The {{refn}} template allows you to use standard {{sfn}}s within a standard ref, eg

The following refn makes it easy to use {sfn}s in references.{{refn|This is a ref with an {sfn}.{{sfn|Jones|2005|p=57}} }} ← Don't forget to close the brackets for the refn.
The following refn makes it easy to use {sfn}s in references.[3]

...and {{efn}} similarly allows you to make notes containing other referencing types, such as Footnotes and {{sfn}}s:

{{efn|{efn} will make a lettered note by default, and you can put an {sfn} inside it.{{sfn|Jones|2005|p=73}} }}, ← Don't forget to close the brackets for the efn... resulting in:[a]

Using {{harv}} (with brackets) or {{harvnb}} (without brackets) allows you to put references to {{cite}}ed books within <ref></ref> .

"According to Jones (Jones 2005, p. 253) harv error: multiple targets (2×): CITEREFJones2005 (help), something happened, but Smith says (Smith 2009, p. 76) harv error: multiple targets (3×): CITEREFSmith2009 (help), it didn't."

Notes

  1. ^ {efn} will make a lettered note by default, and you can put an {sfn} inside it.[4]

References

  1. ^ This is a little footnote with an {sfn}.
  2. ^ Jones 2005, p. 57. sfn error: multiple targets (2×): CITEREFJones2005 (help)
  3. ^ This is a ref with an {sfn}.[2]
  4. ^ Jones 2005, p. 73. sfn error: multiple targets (2×): CITEREFJones2005 (help)
Cite error: A list-defined reference named "FOOTNOTESmith200913" is not used in the content (see the help page).

References for Intro edit

Sources


  • {{cite book

|ref=harv <!--{{sfn|Smith|2009|p=}} -->
 |last=Smith
 |first=Tim
 |title=The Big Book of Interesting Stuff
 |publisher=Huge Book Co.
 |place=Houston, TX
 |year=2009
 |url=http://waaark.com/error404}}

  • {{cite book

|ref=harv <!-- {{sfn|Jones|2005|p=}} -->
 |last=Jones
 |first=Gary
 |title=The Small Book of Dull Stuff
 |publisher=Tiny Editions
 |place=London
 |year=2005
 |url=http://www.lego.com/404notfound}}

More info edit

How to avoid <ref name=> as much as possible, although other users are quite happy with it.

  1. Harvard refs (including {{cite book}} must have at least one author (|last= or |last1=, or |editor-last1= if no author named, plus a year or date with |date=.
  2. In the bibliography section: {{Cite book |ref=harv |last=Holmes |first=Darrell E. |title=West Virginia Blue Book 2012 |year=2012 |url=http://www.legis.state.wv.us/legisdocs/2012/bluebook/bluebook2012.pdf |publisher=West Virginia Senate}}, resulting in [1]
  3. If any of the info for the required parameters is missing, or if it yields an unwieldy result, or if you simply have a different preference, use e.g.: {{cite book |ref={{harvid|Unknown|n.d.|}} |title= etc...}} to override all other parameters in {{cite book}}, resulting in [2]
  4. For multiple authors, use {{cite book|last1=Holmes|last2=Watson|title=Reichenbach Revisited|year=1900| etc...}} and {{sfn|Holmes|Watson|1900|p=123}} in the text, thus.[3]
  5. If you forget the |ref=harv parameter, it will create a blue link which doesn't work, eg {{sfn|Silly|Old|Me|1897|p=1023}}[4]
  6. For everyone's convenience, in the Bibliography section use {{cite book |ref=harv<!-- {{sfn|Holmes|2014}} -->|title= etc...}} so you won't lose track of those pesky ref names, and other editors know where to find them.
  7. Both |ref=harv and |ref={{harvid|title|date}} create a CITEREF which is the equivalent of <ref name=>. (BTW, ref name= must have no spaces, but then you will almost certainly never need this horrendously tiresome and unwieldy method again.)
  8. Then you can use {{sfn|Constitution of West Virginia|1863|p=123}}[5] or {{harvnb|Holmes|2012}} Holmes 2012 or {{harv|Holmes|2012}} (Holmes 2012) or <ref>Ref with a cite {{harv|Constitution of West Virginia|1863|p=123}}</ref>[6] inline.
  9. If you have multiple references to the same page number, CITEREF will concatenate them into a single ref within the {{reflist}}, thus:[3]
  10. You cannot use {{sfn}}s within a <ref></ref>, but you *can* use {{harv}}; or even better use {{refn}}, which allows{{refn|group=n|Some text <ref>A normal reference</ref> etc}}[n 1]
  11. {{efn}} in conjunction with {{notelist}} automatically letters or (numbers) each ref.[a]
  12. You must have an actual |year= parameter in your cite book entry. If you only use the date= parameter, as in |date=1 January 2015, this will appear next to the author's name in the output, eg Smith, John (1 January 2015). John Smith's Book etc.,{{sfn|Smith|2015|p=123)) but it sems to me that the {{harv}} functions can't extract the year and use it in {{sfn}} or {{harvid}} etc. So the cite book in the Sources section needs both |date= and |year= entry for sfns etc. to work. I find I rarely use the |date= parameter with {{cite book}}. This seems to have been fixed, |date= will take any of YYYY, MMYYYY and DDMMYYYY, and I think even |date=Summer 1980 CHECK!
  13. If there is no author, or if you want to refer to the source by a customised name rather than [9] create a custom name to be used within the ref, which points back to the main {{cite book}}, eg {{cite book |ref={{harvid|Custom name|year|}} |last=Smith |etc... and refer to it with {{sfn|Custom name|1902|p=81}}
  14. You must use the pages defined in |p= and |pp= consistently. If you use both |p=47 and |pp=47 by mistake in different {sfn}s, it will generate an error.
More info

See Number Theory bibliography (mea culpa) for cite book examples.

Still under construction edit

Typical error messages edit

  1. Cite error: A list-defined reference named "FOOTNOTExxxxxx" is not used in the content (see the help page). where xxxxxx is the name and year of the harv ref.
This means you are trying to use {{sfn}} in a [10], which cannot refer to itself. Use <ref> Some text {{tl|harv|}} or {{tl|harvnb}}</ref> instead.[11] or [12]
Sources
  • Smith, John (2012). A Book Title. {{cite book}}: Invalid |ref=harv (help)
  • Smith; Jones; Robinson (ed.). A very long with many eds and/or a complicated title which needs abbreviating. {{cite book}}: |last3= has generic name (help)


Section text edit

Some things happened, and some other things didn't.[13] Time passed, and the same things occurred again and again,[14] despite other things happening.[14] In the end, everyone was satisfied and everyone went home.[15]

Refs, again edit

{efn}s
  1. ^ This is an {efn} and needs a {{notelist}} to work.
{refn}s
  1. ^ The use of refn allows you almost complete freedom to cite anywhere.[7].[8] See what I mean?
Cites
  1. ^ Holmes 2012, p. 123.
  2. ^ Unknown n.d., p. 123.
  3. ^ a b Holmes & Watson 1900, p. 123.
  4. ^ Silly, Old & Me 1897, p. 1023.
  5. ^ Constitution of West Virginia 1863, p. 123.
  6. ^ Ref with a cite (Constitution of West Virginia 1863, p. 123)
  7. ^ A normal reference within a ref.
  8. ^ This even allows nested references if your name is Mandelbrot!Cite error: A <ref> tag is missing the closing </ref> (see the help page).</nowiki> within a {{refn}}, btw</ref>
  9. ^ author & date.
  10. ^ footnote
  11. ^ Smith 2012.
  12. ^ Smith et al. 1900.
  13. ^ Smith 2009, p. 15. sfn error: multiple targets (3×): CITEREFSmith2009 (help)
  14. ^ a b Smith 2009, p. 39. sfn error: multiple targets (3×): CITEREFSmith2009 (help)
  15. ^ Smith 2009, p. 46. sfn error: multiple targets (3×): CITEREFSmith2009 (help)
Sources
  • Smith, John (1 January 2015). John Smith's Book. No |year= parameter results in.
  • Constitution of West Virginia. West Virginia Legislature. 1863. OCLC 767921701. Retrieved May 28, 2015. {{cite book}}: Cite has empty unknown parameter: |1= (help)
  • Holmes, Darrell E. (2012). West Virginia Blue Book 2012 (PDF). West Virginia Senate.
  • Silly, Adalbert; Old, Bartholomew; Me, Qiang Kai (1895). Heavens to Betsy! A collection of egregious euphemisms. Schlaraffenland: Catweazle and Mountjoy, Government Printing Office.