User:MinorProphet/The joy of sfn

Ongoing test page, with various mistakes to be sorted.

Intro
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 templates, 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.

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

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

 * 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 sfns, harvs and cites. 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
 * 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  anyway.
 * If display-authors etc. is used, the citeand the sfn only ever display that number of authors: but the sfn must use all the authors, up to four.
 * overrides the CITEREF, allowing complete freedom, but the sfn must use it.


 * Some thoughts on small footnotes (sfn)

Intro
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  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
Example of an ordinary ref name:
 * , resulting in:
 * "Some text with an inline reference.

Then you later refer to it with:
 * , resulting in:
 * "Some more text using the same source and page."

But then it gets a bit difficult if you want to refer to a different page:
 * , which gives you
 * "Even more text referring to another page."

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.

The sfn way
(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   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,  resulting in.
 * 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 ,  , 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   and not.
 * 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. and you don't have to remember the instantly forgettable name you gave it three weeks ago..

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. NB Compare with  which results in this.


 * Sources

Example using ref names

 * "According to Jones something dull happened, but Smith says it was interesting.
 * "Smith says other interesting things on the same page, and Jones drones on and on as usual, but they both reach the same conclusion on another page."
 * "Smith says other interesting things on the same page, and Jones drones on and on as usual, but they both reach the same conclusion on another page."
 * "Smith says other interesting things on the same page, and Jones drones on and on as usual, but they both reach the same conclusion on another page."

Example using sfn

 * "According to Jones something dull happened, but Smith says it was interesting.
 * "Smith says other interesting things on the same page, and Jones drones on and on as usual: but they both reach the same conclusion on another page."
 * "Smith says other interesting things on the same page, and Jones drones on and on as usual: but they both reach the same conclusion on another page."
 * "Smith says other interesting things on the same page, and Jones drones on and on as usual: but they both reach the same conclusion on another page."


 * Sources

Other Stuff
You can't use an {sfn} within a normal inline ref, such as  This gives you an error:
 * Big hint
 * A little footnote with an {sfn} follows.

The refn template allows you to use standard sfns within a standard ref, eg


 * ← Don't forget to close the brackets for the refn.
 * The following refn makes it easy to use {sfn}s in references.

...and efn similarly allows you to make notes containing other referencing types, such as Footnotes and sfns:
 * , ← Don't forget to close the brackets for the efn... resulting in:

Using harv (with brackets) or harvnb (without brackets) allows you to put references to citeed books within.


 * "According to Jones, something happened, but Smith says , it didn't."

References for Intro

 * Sources

More info
How to avoid as much as possible, although other users are quite happy with it.


 * 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.
 * In the bibliography section:, resulting in
 * 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.: to override all other parameters in , resulting in
 * For multiple authors, use and  in the text, thus.
 * If you forget the |ref=harv parameter, it will create a blue link which doesn't work, eg
 * For everyone's convenience, in the Bibliography section use so you won't lose track of those pesky ref names, and other editors know where to find them.
 * Both |ref=harv and |ref= create a CITEREF which is the equivalent of }} See ?}}
 * efn in conjunction with notelist automatically letters or (numbers) each ref.
 * You must have an actual |year= parameter in your cite book entry. If you only use the date= parameter, as in, 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 {{tl|harv}} functions can't extract the year and use it in {{tl|sfn}} or {{tl|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   CHECK!
 * If there is no author, or if you want to refer to the source by a customised name rather than {{sfn|author|date}} create a custom name to be used within the ref, which points back to the main {{tl|cite book}}, eg  and refer to it with
 * You must use the pages defined in  and   consistently. If you use both   and   by mistake in different {sfn}s, it will generate an error.

See Number Theory bibliography (mea culpa) for cite book examples.
 * More info:

Typical error messages

 * 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, which cannot refer to itself. Use instead. or


 * Sources



Section text
Some things happened, and some other things didn't. Time passed, and the same things occurred again and again, despite other things happening. In the end, everyone was satisfied and everyone went home.

Refs, again

 * {efn}s


 * {refn}s


 * Cites


 * Sources