Misplaced Pages

Template talk:Sfn

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

This is an old revision of this page, as edited by Redrose64 (talk | contribs) at 16:50, 16 April 2015 (Request TemplateData: what they?). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Revision as of 16:50, 16 April 2015 by Redrose64 (talk | contribs) (Request TemplateData: what they?)(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Template:Sfn is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.

Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases.


Archiving icon
Archives

/archive 1


Option to remove terminal full stop in short form

I've just discovered this template – really nice and much easier to use when one main textbook is cited repeatedly at different pages! However, I always use the {{Citation}} template if I possible can rather than the "Cite" family (I prefer the output and it's easier than deciding which one to use). By default this template does not place a full stop/period at the end of a citation. So when combined with the Citation template, the result is a mixture of styles (see Cactus#References). It would be good to have an option to suppress the full stop. Peter coxhead (talk) 18:35, 7 March 2012 (UTC)

I use sfn and citation but manually add a full stop at the end of the citation template. It looks good to me. Aa77zz (talk) 18:42, 7 March 2012 (UTC)
In {{citation}}, the preferred method for adding a full stop is to set |postscript=. --Redrose64 (talk) 18:50, 7 March 2012 (UTC)
The {{citation}} documentation states it ends with a period, but looking at the markup, there is no default terminator. ---— Gadget850 (Ed)  19:00, 7 March 2012 (UTC)
Er, it states "Omit or leave blank to remove the trailing full stop.", therefore the full stop is only present if explicitly specified by |postscript=. --Redrose64 (talk) 19:33, 7 March 2012 (UTC)
I usually put the full citations in a separate subsection, because a mixture of full and short citations is visually jarring, and because full citations are usually given in alphabetical order. Kanguole 19:15, 7 March 2012 (UTC)
As for example with NBR 224 and 420 Classes#Notes. --Redrose64 (talk) 19:33, 7 March 2012 (UTC)

In response to the comments above, I don't like a full stop at the end of citations: they aren't sentences and as per the spirit of MOS:CAPTION I prefer to reserve full stops for sentences and abbreviations. So I don't use |postscript=. unless this is already the article style. I don't agree that a mixture of full and short citations is visually jarring. Further, there's no point in a short citation which links to a single full citation; it just creates redundancy. Anyway, all this is irrelevant; WP:CITEVAR allows me to choose the citation style in an article I create or first add citations too. I asked here because I can't edit the template and didn't want to create yet another one. I hope that this won't be my only option. Peter coxhead (talk) 19:49, 7 March 2012 (UTC)

I have now created {{Sfn/ps}} which by default creates a shortened footnote without a terminal full stop/period, and added cross-references to the documentation. This allows more consistent use by the minority, who like me, prefer the {{Citation}} template. Peter coxhead (talk) 09:48, 11 March 2012 (UTC)

Urgh. CITEVAR is not license to endlessly fork the existing citation templates for the sake of utterly trivial aesthetic quibbles. The last thing anyone should be doing in 2012 is adding even more inconsistency to our citation system. Chris Cunningham (user:thumperward) (talk) 10:54, 11 March 2012 (UTC)
I'm not adding inconsistency; quite the reverse. It's inconsistent to mix {{Citation}} formats with {{Sfn}} formats in the same list. Thus a bot (forgotten the name just now) goes around adding "postscript=." to citations which don't have a terminal full stop in articles where most do. Greater consistency would have been achieved if by default {{Sfn}} did not add a full stop, only doing so with the use of |postscript=. This would make {{sfn|Smith|2000}} the same as <ref>{{Harvnb|Smith|2000}}<ref>, which it should be, but isn't. However, it's too late for this better solution now. Peter coxhead (talk) 11:27, 11 March 2012 (UTC)
Why is it "too late for this better solution now"? Was that actually established before the fork was created? Chris Cunningham (user:thumperward) (talk) 13:32, 11 March 2012 (UTC)
If this is a requested feature then why not add another parameter to the original template instead of making a new template? And while we are all here - could I request more feedback on centralizing citation discussions? See Help_talk:Citation_Style_1#Centralized_talk_page. Thanks. Blue Rasberry (talk) 15:35, 11 March 2012 (UTC)
We have three discussions going on here: A request to add a feature (which is only four days old), a discussion on a the creation of a new template that added that feature and a discussion on adding a similar feature to other templates. Could we please stick to one topic at a time? Or; at least split these up. ---— Gadget850 (Ed)  16:03, 11 March 2012 (UTC)
Actually I can only see one discussion. Originally I thought the solution was to add a parameter which caused the trailing full stop not to appear, e.g. something like |nostop=true. Then I realized that this was inconsistent with the way that "postscripts" work in other templates, e.g. {{Citation}}. The ideal solution would be if the original {{sfn}} template produced no "postscript", then |postscript=. would do what is needed in a "cite family" context, and e.g. |postscript=, some note would allow additional notes to be added to the short footnote as you can via <ref>{{Harvnb|Smith|2000}}, some note<ref>. This would be ideal because {{sfn|NAME|DATE|postscript=PS}} and <ref>{{Harvnb|NAME|DATE}}PS</ref> would display exactly the same short note. But changing {{sfn}} in this way would render most existing uses incorrect. So unless someone wants to go back and change all the articles which use the template, it's too late. Hence I created a new template to do what I think {{sfn}} should have done in the first place.
To reduce maintenance, the content of {{sfn}} can now be changed so that all it does is call {{sfn/ps}} with the addition of |postscript=. Peter coxhead (talk) 00:01, 12 March 2012 (UTC)
There is no need for a template fork, nor even a subtemplate. It can be done with a single additional parameter in {{sfn}}. Consider {{cite book}} - by default, this has a terminal period, but by specifying |postscript= with no value, the terminal period is suppressed. The necessary change to {{sfn}} to give similar behaviour is trivial, and concerns just one line - at present there is this:
 -->}}.<!--
which should become this:
 -->}}{{{postscript|.}}}<!--
Existing uses will not be affected. Those who wish to would then be able to use {{sfn|Doe|2012|p=123|postsript=}} to suppress the period. --Redrose64 (talk) 17:45, 12 March 2012 (UTC)
Well, I still think that the default should have been no full stop, but I agree that this solution will work. Because it's desirable that the sfn template is short when used in text (to avoid undue interruption to the flow) I would allow |ps= as an alternative, i.e. have
 -->}}{{{postscript|{{{ps|.}}}}}}<!--
So is someone with admin privileges going to make this change? Peter coxhead (talk) 09:40, 13 March 2012 (UTC)
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.

As no-one has objected to the last compromise suggestion made above, and it's been around for 6 days now, can some admin please make the change? I will then be happy to alter the documentation and fix {{sfn/ps}}. To be absolutely clear, the change requested is that the line which is currently

 -->}}.<!--

should become

 -->}}{{{postscript|{{{ps|.}}}}}}<!--

Thanks in advance. Peter coxhead (talk) 14:01, 19 March 2012 (UTC)

Done --Redrose64 (talk) 15:40, 19 March 2012 (UTC)
Thanks. I've updated the documentation, as best I can, but it's in a rather complex form, so it needs checking. The template I created temporarily, "sfn/ps" has been deleted. Peter coxhead (talk) 12:40, 20 March 2012 (UTC)

why are there errors in the template?

Big red e.g. "Harv error: link to #CITEREFSmithJonesJohnson2005 doesn't point to any citation. Harv error: link to #CITEREFJonesJohnsonSmith2004 doesn't point to any citation."

What's the deal? MathewTownsend (talk) 00:52, 19 March 2012 (UTC)

You're looking at template:sfn/doc, right? Those are examples of syntax and they don't actually point at things. You're only seeing them because you have the script installed. Alarbus (talk) 00:58, 19 March 2012 (UTC)
oh, thanks. I did just install a bunch of scripts! I was wondering why that was suddenly showing up and no one else (but me) seemed to see them. humm, maybe I should ditch that script. MathewTownsend (talk) 01:05, 19 March 2012 (UTC)
The script is very useful at spotting problems with article citations. You do a lot of reviewing and should keep the script to help with articles you're commenting on. If you want to see the article without the red, use a non-logged-in browser. I do think the red is a bit over the top and was thinking of taking a local copy to tone it down. Ucucha might be game for a tweak. Alarbus (talk) 01:34, 19 March 2012 (UTC)
yes, I should learn how to fix those citations. Agree its over the top. BIG RED. A little frightening. But I was wondering why I was the only one to see it. Now I know! Thanks. MathewTownsend (talk) 01:37, 19 March 2012 (UTC)
The script has doc: User:Ucucha/HarvErrors. If you encounter an article with one of these citation issues it should be fixed before passing any review. Note that there are two messages the script generates; the second, “Harv error: There is no link pointing to this citation”, may not be a problem (and it can be turned off; see doc). {{citation}} always uses ref=harv and not all articles use the sfn/harv system. In this case, the red is ignorable.
If you need help fixing any of these, let me know; I do this all the time. Alarbus (talk) 01:53, 19 March 2012 (UTC)

If you see this error, you should take one second and tag it with {{citation not found}}. This points to specific instructions for local editors, and categorizes the article in a maintenance category. (I wish the script could add this automatically, but I'm told that's impossible with current technology.) ---- CharlesGillingham (talk) 18:35, 19 March 2012 (UTC)

(I fixed the two errors in {{harvard citation documentation}}. ---- CharlesGillingham (talk) 19:01, 19 March 2012 (UTC)
ok, I'll use the {{citation not found}}. Thanks, MathewTownsend (talk) 19:08, 19 March 2012 (UTC)

what about this article?

DragonFly BSD - here there do seem to be named references - but it shows harv errors when the article doesn't use them. MathewTownsend (talk) 20:54, 19 March 2012 (UTC)

That's another set of false positives. I'll deploy a fixed version of the script soon that should get rid of most false positives. Ucucha (talk) 21:03, 19 March 2012 (UTC)
I've disabled the script meanwhile. MathewTownsend (talk) 21:13, 19 March 2012 (UTC)
What about this article: Gray wolf? It comes up with many harv errors. MathewTownsend (talk) 21:19, 20 March 2012 (UTC)
  1. 24: There is no Mech1974 in the Bibliography
  2. 201: There is no Coppinger2001, it is CoppingerCoppinger2001 in the Bibliography because of the two authors; see #258 which is correct
Bekoff, Marc (1977): nothing in Notes links to this
Further reading: These are all false positives; using |ref=harv here enables anchors that are unused.
---— Gadget850 (Ed)  21:39, 20 March 2012 (UTC)
I have fixed this one for you, since it was clear that the omission of the second Coppinger was an oversight. I can't fix the Mech one, because not only are there several candidates: there's a distinct possibility that 1974 is correct and the book simply hasn't been listed at the bottom. --Redrose64 (talk) 21:57, 20 March 2012 (UTC)
ok, thanks! I'm trying to learn this. So you're saying the error messages are correct in this case? Just wanted to check before I go muddling in. MathewTownsend (talk) 22:10, 20 March 2012 (UTC)
The ones in the Notes section are/were correct: I fixed one, and the other should still be fixed. The one under Bibliography may indicate an inadvertent omission of an inline reference (i.e. a {{sfn}}), or it may indicate a source which was not in fact used (if this is the case it may be moved to the Further reading section). Those under Further reading may be ignored. --Redrose64 (talk) 22:25, 20 March 2012 (UTC)
ok, thanks! (I'm thinking that this is a little over my head.) MathewTownsend (talk) 22:43, 20 March 2012 (UTC)

I discovered that if I add {{isbn}}, all the following references get the error messages. MathewTownsend (talk) 19:28, 21 March 2012 (UTC)

I presume you mean |isbn=. This should have nothing to do with the anchors. Example please? ---— Gadget850 (Ed)  19:39, 21 March 2012 (UTC)
I can't find it because I didn't save the article, once I saw what was happening.
On another article, what about Nullah which doesn't use harv? MathewTownsend (talk) 18:22, 22 March 2012 (UTC)
It uses {{1911}}, which does. Kanguole 18:28, 22 March 2012 (UTC)
To be exact, it uses {{1911}} which passes |ref=harv into {{Cite EB1911}} which in turn uses {{cite encyclopedia}}. --Redrose64 (talk) 20:01, 22 March 2012 (UTC)
hummm, ok. MathewTownsend (talk) 20:12, 22 March 2012 (UTC)

ok, if you add {{isbn}} to Vocabulary development under the "References" section, errors come up for every entry. (I didn't save it because I don't want to screw up the article.) MathewTownsend (talk) 23:04, 22 March 2012 (UTC)

You keep typing {{isbn}}, but have you actually clicked on it? I fixed three entries in the bibliography that did not have |ref=harv. I fixed two that used |coauthors=: if you use that parameter, the anchor will not match the link. If you edit the Bibliography as a section, every entry will show an error because the References section is not being rendered. If you have a live article where |isbn= causes a Harv error, please let me know. ---— Gadget850 (Ed)  10:20, 23 March 2012 (UTC)
So if an article uses {{1911}}, it's going to throw a Harv error? As in Cliff dwelling? MathewTownsend (talk) 20:27, 25 March 2012 (UTC)
Yes, but the ordinary user won't see that message. There is no harm in a web page containing link anchors with no incoming links. --Redrose64 (talk) 20:50, 25 March 2012 (UTC)

Sfnp

As we add features here, we need to remember to update the variants: {{sfnp}} and {{sfnm}}. I added |paren= to sandbox to add parenthesis for the year:

Markup Renders as
{{sfn/sandbox|Smith|2005|p=25}}
{{sfn/sandbox|Smith|2006|p=25|paren=y}}
{{reflist}}
{{refbegin}}
* {{cite book |last=Smith |title=Book |year=2005 |ref=harv}}
* {{cite book |last=Smith |title=Book |year=2006 |ref=harv}}
{{refend}}

  1. Smith 2005, p. 25. sfn error: no target: CITEREFSmith2005 (help)
  2. Smith 2006, p. 25. sfn error: no target: CITEREFSmith2006 (help)

What we really need to do is create {{sfn/core}} with named parameters so we can keep all of the variants in sync. ---— Gadget850 (Ed)  07:51, 20 March 2012 (UTC)

Obsoleted by #Core. ---— Gadget850 (Ed)  09:10, 3 April 2012 (UTC)

Core

I created {{Harvard citation/core}} and sandboxed each template to use core. This ensures consistency and eases changes across the series. See {{sfn/sandbox}} for a sample of the simplified markup. ---— Gadget850 (Ed)  15:53, 21 March 2012 (UTC)

Current
Markup Renders as
{{Harvard citation no brackets |Smith |2015 |p=25}}

Smith 2015, p. 25 harvnb error: no target: CITEREFSmith2015 (help)

{{Harvard citation |Smith |2015 |p=25}}

(Smith 2015, p. 25) harv error: no target: CITEREFSmith2015 (help)

{{Harvard citation text |Smith |2015 |p=25}}

Smith (2015, p. 25) harvtxt error: no target: CITEREFSmith2015 (help)

{{Harvcolnb |Smith |2015 |p=25}}

Smith 2015:25 harvcolnb error: no target: CITEREFSmith2015 (help)

{{Harvcol |Smith |2015 |p=25}}

(Smith 2015:25) harvcol error: no target: CITEREFSmith2015 (help)

{{Harvcoltxt |Smith |2015 |p=25}}

Smith (2015:25) harvcoltxt error: no target: CITEREFSmith2015 (help)

{{sfn |Smith |2015 |p=25}}

{{sfnp |Smith |2020 |p=25}}

{{sfnm |1a1=Smith |1a2=Jones |1a3=Johnson |1y=2005 |1p=15 |2a1=Jones |2a2=Johnson |2a3=Smith |2y=2004 |2p=50}}

{{Harvard citation no brackets |Smith |p=25 |ref=smithref}}

Smith, p. 25 harvnb error: no target: smithref (help)

Harvard citation/core
Markup Renders as
{{Harvard citation no brackets/sandbox |Smith |2015 |p=25}}

Smith 2015, p. 25 harvnb error: no target: CITEREFSmith2015 (help)

{{Harvard citation/sandbox |Smith |2015 |p=25}}

(Smith 2015, p. 25) harv error: no target: CITEREFSmith2015 (help)

{{Harvard citation text/sandbox |Smith |2015 |p=25}}

Smith (2015, p. 25) harvtxt error: no target: CITEREFSmith2015 (help)

{{Harvcolnb/sandbox |Smith |2015 |p=25}}

Smith 2015:25 harv error: no target: CITEREFSmith2015 (help)

{{Harvcol/sandbox |Smith |2015 |p=25}}

(Smith 2015:25) harv error: no target: CITEREFSmith2015 (help)

{{Harvcoltxt/sandbox |Smith |2015 |p=25}}

Smith (2015:25) harv error: no target: CITEREFSmith2015 (help)

{{sfn/sandbox |Smith |2015 |p=25}}

{{sfnp/sandbox |Smith |2020 |p=25}}

{{sfnm/sandbox |1a1=Smith |1a2=Jones |1a3=Johnson |1y=2005 |1p=15 |2a1=Jones |2a2=Johnson |2a3=Smith |2y=2004 |2p=50}}

{{Harvard citation no brackets/sandbox |Smith |p=25 |ref=smithref}}

Smith, p. 25 harvnb error: no target: smithref (help)

  1. ^ Smith 2015, p. 25. sfn error: no target: CITEREFSmith2015 (help)
  2. ^ Smith (2020), p. 25. sfnp error: no target: CITEREFSmith2020 (help) Cite error: The named reference "FOOTNOTESmith202025" was defined multiple times with different content (see the help page).
  3. ^ Smith, Jones & Johnson 2005, p. 15 sfnm error: no target: CITEREFSmithJonesJohnson2005 (help); Jones, Johnson & Smith 2004, p. 50 sfnm error: no target: CITEREFJonesJohnsonSmith2004 (help). Cite error: The named reference "FOOTNOTESmithJonesJohnson200515JonesJohnsonSmith200450" was defined multiple times with different content (see the help page).
Markup Renders as
{{refbegin}}
* {{cite book |title=Book |last=Smith |year=2015 |ref=harv}}
* {{cite book |title=Book |last=Smith |year=2020 |ref=harv}}
* {{cite book |title=Book |last=Smith |ref=smithref}}
* {{cite book |last1=Jones |first1=John |last2=Johnson |first2=John |last3=Smith |first3=John |year=2004 |title=Our First Book |ref=harv}}
* {{cite book |last1=Smith |first1=John |last2=Jones |first2=John |last3=Johnson |first3=John |year=2005 |title=Our Second Book |ref=harv}}
{{refend}}
  • Smith (2015). Book. {{cite book}}: Invalid |ref=harv (help)
  • Smith (2020). Book. {{cite book}}: Invalid |ref=harv (help)
  • Smith. Book.
  • Jones, John; Johnson, John; Smith, John (2004). Our First Book. {{cite book}}: Invalid |ref=harv (help)
  • Smith, John; Jones, John; Johnson, John (2005). Our Second Book. {{cite book}}: Invalid |ref=harv (help)

I love it when a plan comes together
I've not looked at the code yet, but *yes* — this is goodness. Alarbus (talk) 16:01, 21 March 2012 (UTC)

Title-Date with wiki markup in link

Moved from User talk:Redrose64 § Wikicite/doc – --Redrose64 (talk) 13:29, 25 March 2012 (UTC)

Hi. I'm fine with the tweaks for {{wikicite/doc}}. But in a recent FA, I recall nikkimaria calling for consistency between sfn'd footnotes and the full cite, so .27.27 went in. You wouldn't know a way to do this without having to encode the apostrophes in the {{sfnRef}} would you? (fyi, the example is off Woodes Rogers.) Alarbus (talk) 01:04, 25 March 2012 (UTC)

The above was posted on my talk page. It's follow-up to this edit of mine.
It doesn't link when normal double-apostrophe italicisation is used, this is true:
  1. A Book 2001, p. 12. sfn error: no target: CITEREFA_Book2001 (help)
  • A Book. 2001.
but when you put non-intuitive encoded markup into {{sfnref}}, like this:
  1. Another Book 2002, p. 34. sfn error: no target: CITEREFAnother_Book2002 (help)
  • Another Book. 2002.
it does work, but at the expense of puzzling non-techie editors. I think that it would surely be better to amend either {{sfnref}} or {{sfn}} so that their behaviour is mutually consistent. That is, if it is felt that the italicisation of titles in Title-Date Shortened footnotes is a Good Thing. What do others think? --Redrose64 (talk) 13:29, 25 March 2012 (UTC) clarified Redrose64 (talk) 08:34, 26 March 2012 (UTC)
The simplest technical fix would be to add |title= to both templates. ---— Gadget850 (Ed)  13:48, 25 March 2012 (UTC)
How about geting anchorencode fixed to encode apostrophes in {sfnRef}? |title= in both rather gets away from the idea of short footnotes. I do agree that the .27.27 is awkward. Alarbus (talk) 16:50, 25 March 2012 (UTC)
I think it would be better to fix this in anchorendcode, if that's possible. It's better if the user doesn't have to think about this issue. ---- CharlesGillingham (talk) 20:58, 25 March 2012 (UTC)
Let me rephrase that. A few ideas:
  • Add |ref=ititle to core so it uses title-date instead of author-editor-date and includes the italic markup in the anchor.
  • Add |ref= to {{sfn}} like the other Harv templates to create a custom link.
  • Add |ititle= to {{sfn}} for an title that is formatted in italics but does not include the italics markup in the link.
  • Add |ititle= to {{sfnref}}
I suppose there is the potential for the title in quotes. ---— Gadget850 (Ed)  21:47, 25 March 2012 (UTC)
Is this actually fixed, now? V1.19? Redrose64's examples seem to work, albeit with the script still highlighting one. Will have to have a test somewhere. See Template talk:Citation#A new solution needs to be found for the "2001a" problem for examples of this in a fistful of articles. As I've used this, it is frequently the case that it is only a portion of the footnote that is in italics. I believe I've seen a few uses of quotes in {sfn}, too. Alarbus (talk) 23:44, 25 March 2012 (UTC)

It worked because the title is enclosed in .27.27:

Markup Renders as
{{sfn|''A Book''|2003}}
{{sfn|''Second Book''|2003}}
{{reflist|close}}
*{{cite book |title=A Book |year=2003 |ref={{sfnref|''A Book''|2003}} }}
*{{cite book |title=Second Book |year=2003 |ref={{sfnref|.27.27Second Book.27.27|2003}} }}

  1. A Book 2003. sfn error: no target: CITEREFA_Book2003 (help)
  2. Second Book 2003. sfn error: no target: CITEREFSecond_Book2003 (help)
  • A Book. 2003.
  • Second Book. 2003.

---— Gadget850 (Ed)  00:16, 26 March 2012 (UTC)

Thanks. I tried it in an article preview and it still needed the .27.27. I think this needs mentioning somewhere on mw: (but I don't really know where). Alarbus (talk) 01:54, 26 March 2012 (UTC)
Looking a bit deeper: {{sfn}} creates a link without using any encoding, but {{sfnref}} encodes the anchor using anchorencode:. Using {{sfn|{{anchorencode:''Second Book''}}|2005}} works, but the italic formatting is lost and spaces are converted to underscores. We could add anchorencode: to {{sfn}}, but I would not be surprised if it breaks some existing uses. ---— Gadget850 (Ed)  10:40, 26 March 2012 (UTC)
Are you thinking that adding anchorencode to {sfn} would allow normal use of apostrophes in both? If so, that would be ideal. We certainly don't want to have to use .27.27 in both. FWIW, I've seen encoded commas, quotes, and explicit underscores as well as a fair number of forced ref=CITEREF… but not much else. Alarbus (talk) 21:20, 26 March 2012 (UTC)
Again, I think anchorencode is the right way to go. What is most important is that {{sfn}} and {{sfnRef}} do exactly the same thing. Note also that {{citation/core}} also uses anchorencide. This is what is most simple and this is what users will expect. I feel strongly that this is an issue users should not have to think about.
Gadget: I don't think breakage will be an issue; there might be one or two articles where someone has built an ugly workaround for this problem, using CITEREF or god knows what. We just have to find them and fix them. ---- CharlesGillingham (talk) 08:17, 27 March 2012 (UTC)

Inconsistency with Template:sfnp

{{Sfnp}} had become inconsistent with this template because recent edits had not been applied. I think I've fixed it now, but there needs to be a better solution, e.g. creating {{sfn/core}} which is then called by other templates in the "sfn family" as is done for taxobox templates. Peter coxhead (talk) 11:09, 31 March 2012 (UTC)

Already in sandbox; see #Core above. ---— Gadget850 (Ed)  11:36, 31 March 2012 (UTC)
Ah, right, I'd seen the earlier discussion but missed the fact that you'd actually created it. Ok, so what's needed is for the templates you have in the sandboxes to be made live... Peter coxhead (talk) 11:39, 1 April 2012 (UTC)

Centralized talk page

Propose centralizing these talk pages here, as this is the most active talk page.

See WP:TALKCENT for details on the process. ---— Gadget850 (Ed)  09:39, 3 April 2012 (UTC)

  • Oppose. Not a good idea. If talk activity is to be the criterion of where to move a discussion then why not merge with Misplaced Pages:Editor assistance/Requests? Better that discussions be organized by topic. While there might be some justification for pulling Sfnm and Sfnp here, and while this topic (Sfn) links with the various aspects of Harv, it is different enough to not warrant sucking in all the other less related topics into one confusing tar ball. ~ J. Johnson (JJ) (talk) 19:22, 4 April 2012 (UTC)
The only difference between {{sfn}} and {{harvnb}} is that the former is wrapped in a <ref>...</ref> tag. Indeed, I proposed a #Core for the nine templates. ---— Gadget850 (Ed)  23:30, 4 April 2012 (UTC)
Indeed. But this is like saying nine kinds of bolts may – but note: need not – be put into a plastic bag. That doesn't make "plastic bag" the preferred reference term for "bolts" generally. Sfn mixes two different kinds of tools (should discussion of <ref> also be merged here?); that does not subordinate those tools, or their discussion, to this tool. And while Sfn uses Harv, it is not itself any form of Harv. Blurring these concepts would lead to more of the confusion of concept has made citation on Misplaced Pages unnecessarily difficult. We don't need to compound that. ~ J. Johnson (JJ) (talk) 23:16, 5 April 2012 (UTC)
{{sfn}} doesn't mix <ref>...</ref> with {{harv}} - it encloses {{harvnb}} in <ref>...</ref>. The construct <ref name=id>{{harvnb|author|year|p=n}}</ref> is a common one, and {{sfn|author|year|p=n}} does the same job in at least 21 fewer characters. This makes the wikicode significantly shorter, with the added benefit of ensuring the uniqueness of id. --Redrose64 (talk) 09:55, 6 April 2012 (UTC)
These templates are very similar in both use and in markup. Enough that changes to one template should be discussed and applied to all, and enough that queries about use of one applies to all. ---— Gadget850 (Ed)  11:26, 6 April 2012 (UTC)
But sfn is an outlier in naming, at least. It would make more sense to me to centralize on one with a more central name, like {{harv}}. —David Eppstein (talk) 16:13, 6 April 2012 (UTC)

 Request withdrawn ---— Gadget850 (Ed)  16:25, 6 April 2012 (UTC)

Strong Support (although I'm sorry it's belated). These templates are nearly identical. If there is an issue with one of them, chances are the issue applies to all of them. If a change is made to one of them, the change should be made to all of them. Gadget: why the rush to withdraw? ---- CharlesGillingham (talk) 07:27, 7 April 2012 (UTC)
Pretty obvious there is no consensus to do this nor where, so there is no sense in trying to bag these bolts. Will re-propose in six months. ---— Gadget850 (Ed)  12:12, 7 April 2012 (UTC)
Also obvious that the inner working of these templates is not understood. So, even though they use a common doc page, we will just have to do some education before going to a central talk page. ---— Gadget850 (Ed)  17:20, 8 April 2012 (UTC)
I suspect there would be no objection to merging the Sfn* talk pages. But dissimilarity between Sfn* and Harv* is not something that is likely to change with simply the passage of time. ~ J. Johnson (JJ) (talk) 19:52, 8 April 2012 (UTC)

Harvard citations

Was {{Harvard citations}} a deliberate omission or an oversight? It would seem to be a more natural choice of where to centralize than this one to me, as being in some sense the most general of the lot rather than the most specific. —David Eppstein (talk) 15:22, 3 April 2012 (UTC)
I am pondering that one. It is very different from the listed templates and does not have the potential to update to a common core. ---— Gadget850 (Ed)  15:34, 3 April 2012 (UTC)
{{Harvard citations}} should not be included. It is structured very differently than the other templates, and there is unlikely to be an overlap of issues. ---- CharlesGillingham (talk) 07:27, 7 April 2012 (UTC)

question on Harvb error in All Saints' Church, Shuart

I can't figure out why ref 38 in All Saints' Church, Shuart throws an error: "Harv error: link to #CITEREFLewis1732 doesn't point to any citation." Thanks, MathewTownsend (talk) 18:06, 4 April 2012 (UTC)

It was the wrong year, but the problem has already been fixed. Ucucha (talk) 20:18, 4 April 2012 (UTC)
Thanks! (I thought I checked for that - guess not.) MathewTownsend (talk) 20:23, 4 April 2012 (UTC)

Core update

Given the commonality in markup for the following templates, I have developed a meta-template at {{Harvard citation/core}}. A version using this core is in each sandbox.

Note that {{Harvard citations}} is very different in implementation, thus is not supported by the meta-template.

In-text templates
Templates Aliases Sandbox
{{Harvard citation no brackets}} {{harvnb}} {{Harvard citation no brackets/sandbox}}
{{Harvard citation}} {{harv}} {{Harvard citation/sandbox}}
{{Harvard citation text}} {{harvtxt}} {{Harvard citation text/sandbox}}
{{Harvcoltxt}} {{Harvcoltxt/sandbox}}
{{Harvcol}} {{Harvcol/sandbox}}
{{Harvcolnb}} {{Harvcolnb/sandbox}}
{{sfn}} {{sfn/sandbox}}
{{Sfnp}} {{Sfnp/sandbox}}
{{Sfnm}} {{Sfnm/sandbox}}

Here are samples of the current implementations:

Current
Markup Renders as
{{Harvard citation no brackets |Smith |2015 |p=25}}

Smith 2015, p. 25 harvnb error: no target: CITEREFSmith2015 (help)

{{Harvard citation |Smith |2015 |p=25}}

(Smith 2015, p. 25) harv error: no target: CITEREFSmith2015 (help)

{{Harvard citation text |Smith |2015 |p=25}}

Smith (2015, p. 25) harvtxt error: no target: CITEREFSmith2015 (help)

{{Harvcolnb |Smith |2015 |p=25}}

Smith 2015:25 harvcolnb error: no target: CITEREFSmith2015 (help)

{{Harvcol |Smith |2015 |p=25}}

(Smith 2015:25) harvcol error: no target: CITEREFSmith2015 (help)

{{Harvcoltxt |Smith |2015 |p=25}}

Smith (2015:25) harvcoltxt error: no target: CITEREFSmith2015 (help)

{{sfn |Smith |2015 |p=25}}

{{sfnp |Smith |2020 |p=25}}

{{sfnm |1a1=Smith |1a2=Jones |1a3=Johnson |1y=2005 |1p=15 |2a1=Jones |2a2=Johnson |2a3=Smith |2y=2004 |2p=50}}

{{Harvard citation no brackets |Smith |p=25 |ref=smithref}}

Smith, p. 25 harvnb error: no target: smithref (help)

And samples using the new core:

Harvard citation/core
Markup Renders as
{{Harvard citation no brackets/sandbox |Smith |2015 |p=25}}

Smith 2015, p. 25 harvnb error: no target: CITEREFSmith2015 (help)

{{Harvard citation/sandbox |Smith |2015 |p=25}}

(Smith 2015, p. 25) harv error: no target: CITEREFSmith2015 (help)

{{Harvard citation text/sandbox |Smith |2015 |p=25}}

Smith (2015, p. 25) harvtxt error: no target: CITEREFSmith2015 (help)

{{Harvcolnb/sandbox |Smith |2015 |p=25}}

Smith 2015:25 harv error: no target: CITEREFSmith2015 (help)

{{Harvcol/sandbox |Smith |2015 |p=25}}

(Smith 2015:25) harv error: no target: CITEREFSmith2015 (help)

{{Harvcoltxt/sandbox |Smith |2015 |p=25}}

Smith (2015:25) harv error: no target: CITEREFSmith2015 (help)

{{sfn/sandbox |Smith |2015 |p=25}}

{{sfnp/sandbox |Smith |2020 |p=25}}

{{sfnm/sandbox |1a1=Smith |1a2=Jones |1a3=Johnson |1y=2005 |1p=15 |2a1=Jones |2a2=Johnson |2a3=Smith |2y=2004 |2p=50}}

{{Harvard citation no brackets/sandbox |Smith |p=25 |ref=smithref}}

Smith, p. 25 harvnb error: no target: smithref (help)

  1. ^ Smith 2015, p. 25. sfn error: no target: CITEREFSmith2015 (help)
  2. ^ Smith (2020), p. 25. sfnp error: no target: CITEREFSmith2020 (help) Cite error: The named reference "FOOTNOTESmith202025" was defined multiple times with different content (see the help page).
  3. ^ Smith, Jones & Johnson 2005, p. 15 sfnm error: no target: CITEREFSmithJonesJohnson2005 (help); Jones, Johnson & Smith 2004, p. 50 sfnm error: no target: CITEREFJonesJohnsonSmith2004 (help). Cite error: The named reference "FOOTNOTESmithJonesJohnson200515JonesJohnsonSmith200450" was defined multiple times with different content (see the help page).
  • Smith (2015). Book. {{cite book}}: Invalid |ref=harv (help)
  • Smith (2020). Book. {{cite book}}: Invalid |ref=harv (help)
  • Smith. Book.
  • Jones, John; Johnson, John; Smith, John (2004). Our First Book. {{cite book}}: Invalid |ref=harv (help)
  • Smith, John; Jones, John; Johnson, John (2005). Our Second Book. {{cite book}}: Invalid |ref=harv (help)

I propose updating to this core, as it would keep the related templates synchronized, thus simplifying upkeep. ---— Gadget850 (Ed)  01:32, 9 April 2012 (UTC)

  • Strongly support this update being made. It will make no difference to users of these templates, but will make maintenance much easier. As an example, last month changes to allow both a page number/range and a location to be displayed were made to one of the "sfn*" templates, but not to the others. This kind of inconsistency can be removed entirely by having a central core template which is used by all the others but which is never directly used in articles. The approach works very well elsewhere (e.g. in the templates which create the taxoboxes visible in almost all articles about animals, plants and other organisms). Peter coxhead (talk) 08:05, 9 April 2012 (UTC)
Looks reasonable enough. ~ J. Johnson (JJ) (talk) 22:22, 9 April 2012 (UTC)
Done except for {{sfnm}}. Need to dig into that some more to figure out what is wrong. ---— Gadget850 (Ed)  16:09, 28 April 2012 (UTC)

Can this be used with comic books?

I'm trying to upgrade some comic related articles and I've used this template a lot with film articles, but Template:Cite comic does not use a separate surname parameter and multiple issues of a comic can be released in a single year so I'm not clear how SFN differentiates between which I'm referencing. For example if I cite two comics in the same series by a single writer in a single year. Darkwarriorblake (talk) 14:35, 17 July 2012 (UTC)

{{Cite comic}} does not support an anchor, see Template:Sfn#Citation format does not support anchors: .7B.7Bwikicite.7D.7D. See Template:Sfn#More than one work in a year. ---— Gadget850 (Ed)  15:14, 17 July 2012 (UTC)
I added |ref= to {{cite comic/sandbox}}. Review and discuss at Template talk:Cite comic#Anchor. ---— Gadget850 (Ed)  15:16, 17 July 2012 (UTC)
Thanks for the input and change Gadget850, should prove useful. Darkwarriorblake (talk) 16:51, 17 July 2012 (UTC)
 Done ---— Gadget850 (Ed)  12:55, 31 July 2012 (UTC)

Template documentation

The template documentation should include a simple list or table for the available parameters.
For instance, I am attempting to cite a not-so-unusual source: a book with different authors for each chapter. Since the book itself only has editors, and not an author, per se, I was wondering if 'editors' (plural) was a viable parameter, and if 'chapter' had a parameter, and if there was some means of including a 'chapter title'. Ideally, there would be a 'chapter author' for multiple citations. Unfortunately, the examples given did not provide anything appropriate to this situation. My point is: a parameter list would provide guidance for essentially any situation. ~Eric F 74.60.29.141 (talk) 15:07, 27 October 2012 (UTC)

I found it here:Template:Cite_book -- perhaps a link "For usage information..." at the top of the page? ~E 74.60.29.141 (talk) 15:19, 27 October 2012 (UTC)

Can I have a little help?

On the article Throffer, the template is struggling to link one of my sources (Steiner 1974-75) to its entry in the bibliography. I assume this is because the citation has two years. Is there a way around this? J Milburn (talk) 17:28, 23 February 2013 (UTC)

No, it was that you were using |author= and a wikilink instead of |first=, |last= and |authorlink=. Kanguole 17:53, 23 February 2013 (UTC)
Thanks, it's appreciated. J Milburn (talk) 21:02, 23 February 2013 (UTC)

Lua version is broken

Tracked in Phabricator
Task T48815

Using {{sfn}}: One. Two. Three. Four.

  1. ^ Smith 2010, p. 12. sfn error: no target: CITEREFSmith2010 (help)
  2. ^ Smith 2010, pp. 34–56. sfn error: no target: CITEREFSmith2010 (help)

Using {{sfn/sandbox}}: One. Two. Three. Four.

  1. ^ Smith 2010, p. 12. sfn error: no target: CITEREFSmith2010 (help)
  2. ^ Smith 2010, pp. 34–56. sfn error: no target: CITEREFSmith2010 (help)

As shown above, the Lua version omits the small-letter backlinks which were present before. This is a bug. --Redrose64 (talk) 22:41, 2 April 2013 (UTC)

Filed as bugzilla:46815. Dragons flight (talk) 23:24, 2 April 2013 (UTC)
I'm now seeing some strange behavior on Adriaen van der Donck. Namely, number 15 (O'Donnell 1968 xxxviii.) is using the small letter backlinks, whereas other multiple citations aren't, but it's rendering it as O'Donnell & 1968 xxxviii, which is breaking the link to the full reference. Laura Scudder | talk 21:13, 3 April 2013 (UTC)
Two problems there. One is the {{sfn}} bug that I described above; the other is that the article contained {{sfn|O'Donnell|1968|xxxviii}} which is misuse of the third positional parameter - it should have been a named parameter as in {{sfn|O'Donnell|1968|p=xxxviii}}.
Since bugzilla:46815 doesn't yet have a solution, I've reverted {{sfn}} to the last working version (this means that Module:Footnotes is not used). I've also put the version of {{sfn}} that had been live into {{sfn/sandbox}} so that the above demo continues to exhibit a difference. --Redrose64 (talk) 16:13, 4 April 2013 (UTC)
The next update for Lua should include the frame:extensionTag function which is a functional work-around for this issue. I was told about 2 weeks ago that the relevant incremental release for Mediawiki would probably be this week, so we may have a solution soon, but I don't know for sure. Dragons flight (talk) 16:37, 4 April 2013 (UTC)
I've restored the Lua version. The underlying ref bug is not actually fixed, but the recent update to Mediawiki provided a work-around so that I could make the Lua module work anyway. Dragons flight (talk) 23:37, 8 April 2013 (UTC)

Proposed addition of a 'url' parameter

For me the sfn template is an elegant approach to citing an article. Unfortunately, the use of a separate reference appears to limit the use of links to individual online book web pages. Since the sfn template carries the page information for the reference, I decided I would like to be able to add a 'url' to a specific online book page. Currently it appears possible to do this by passing the link directly in the page field. However, I would like to propose making this a separate parameter, such as 'url='. Here's an example:

Referencing this statement.

Notes:

  1. Ryan 2003, pp. 51–54. sfn error: no target: CITEREFRyan2003 (help)

References:

  • example sfn entry: {{sfn|Ryan|2003|pp=}}
  • proposed sfn entry: {{sfn|Ryan|2003|pp=51–54|url=http://books.google.com/books?id=1QS38bu9iTwC&pg=PA51}}

Does this seem reasonable? Praemonitus (talk) 18:53, 20 April 2013 (UTC)

Agreed. --SlothMcCarty (talk) 23:28, 10 January 2014 (UTC)

Multiple Volume in same year

How do you differentiated volume 1 of a work form volume 2 of another work with the same title, same author, and same publication year.--KAVEBEAR (talk) 09:14, 5 June 2013 (UTC)

When the same author/authors have more than one publication in a year the usual practice (not just on Misplaced Pages) is to add a lowercase letter to the year - eg 1997a, 1997b etc. (both in the cite/citation template and in the sfn template) Aa77zz (talk) 09:48, 5 June 2013 (UTC)
Template:Sfn#More than one work in a year --  Gadget850 10:28, 5 June 2013 (UTC)

Two authors and no year

I occasionally come across a web page where there is no easily definable year, see for instance . Since there is no year, the reference ({{sfn|Lane|Singh}}) correctly produces #CITEREFLaneSingh but displays as Lane & Singh harvnb error: no target: CITEREFLaneSingh (help) not Lane & Singh. Is there any way to force the correct display whilst keeping the automatic linking from text through citation to bibliography? Martin of Sheffield (talk) 22:43, 7 July 2013 (UTC)

The last value is being parsed as the year, not the author, thus the lack of the ampersand. I don't see any current way to fix this. The best way would be to add |year=none to the module to explicitly suppress the year. --  Gadget850 18:22, 22 July 2013 (UTC)
Thanks for the suggestion. I've used year=unknown for Lane & Singh on the Richard Watts page. Martin of Sheffield (talk) 22:18, 22 July 2013 (UTC)
Having no year of publication seems so gravely deficient I wonder if it ought to be considered an error condition. But on the assumption that there are some cases where we have to finesse not having a year: couldn't Harvid be used for this? ~ J. Johnson (JJ) (talk) 22:32, 22 July 2013 (UTC)
The problem is not in the references, template:citation generates them quite correctly. The problem lies with how the inline reference is displayed. The inline reference correctly links using CITEREF, but incorecctly displays the last author as if the author were a year. I can't see that template:harvid would help this, but if you know better please explain. The only alternative I know to using year=unknown is to use <ref>{{harv|Lane & Singh}}</ref> which of course does not link through. As regards the lack of a year, please have a look at . The provenance is excellent, the sponsors being the charity themselves, and some conclusions are noteworthy but I have not been able to find a year. Should I include apparently good information or reject it due to a fault in the web site? Martin of Sheffield (talk) 23:06, 22 July 2013 (UTC)
Using the wget utility on the the above link to retrieve the raw HTML, and then using the MS-DOS dir command on the retrieved file shows me
16/04/2013  11:45             9,164 richardwatts1.html
- that's BST, therefore the true datestamp is 10:45, 16 April 2013 (UTC) --Redrose64 (talk) 14:30, 23 July 2013 (UTC)
Excellent lateral thinking. I know for a fact that the page is significantly older than that (accessdate = 21 June 2012) but is the best alternative there is. I checked to make sure that MS wasn't "doing its own thing" and confirmed it using ls -l
-rw-r--r-- 1 jmr users 9164 Apr 16 11:45 richardwatts1.html
I even grep'ed for the string "20", but could only see the visible "middle of the 20th Century".
More generally though, there needs to be a way of dealing with multiple authors without a date. wget and checking the date is probably a bit geeky for many editors. Martin of Sheffield (talk) 17:47, 23 July 2013 (UTC)

Yes! I thought I had done something like this before. Try this:

*]

Which with something like this:

*{{citation
 |ref={{harvid|Smith|Jones}}
 |year= ''undated'' 
 |last1= Smith |first1= A.
 |last2= Jones |first2= B.
 |title= Some source with no date
}}.

gives us "Smith & Jones" linking to:

  • Smith, A.; Jones, B. (undated), Some source with no date {{citation}}: Check date values in: |year= (help)CS1 maint: ref duplicates default (link) CS1 maint: year (link).

Which implies a harv link can be made to display any way we want it. ~ J. Johnson (JJ) (talk) 20:08, 24 July 2013 (UTC)

I altered the |ref= to pull in {{harvid|Smith|Jones}} - an exact match of the one used inside the <ref>...</ref>. If they match, somebody who arrives later on will have a better idea of the method (CITEREF... is somewhat obscure) --Redrose64 (talk) 21:42, 24 July 2013 (UTC)
Thanks to both of you. I've altered Richard Watts to use
<ref>]</ref>
in the text. As J. Johnson suggested, this generates the correctly formatted entry in the {{references}} section and the appropriate CITEREFLaneSingh. I simply removed the "year=unknown" parameter from the citation in the bibliography, there is no need for an explicit ref parameter, the default is correct. Harvid is indeed flexible, see template:NHLE for an example of hijacking the year. I'll have a go at including this work around in the documentation for sfn. Once again, thanks. Martin of Sheffield (talk) 22:00, 24 July 2013 (UTC)
I have generally preferred using the explicit CITEREF as I know exactly what I'm getting. But perhaps using parallel harv templates is more straightforward? I wouldn't mind if we could determine a preferred practice here. ~ J. Johnson (JJ) (talk) 22:01, 24 July 2013 (UTC)

SFN link

Resolved

Can someone help me get the Coplans link to the references section working at Whaam!.--TonyTheTiger (T/C/BIO/WP:CHICAGO/WP:FOUR) 15:56, 21 July 2013 (UTC)

 Done, see here --Redrose64 (talk) 16:23, 21 July 2013 (UTC)
 Done as well! I've had a go at the references section and tidied it a bit. The harvard references for the four books are now:
  • id="CITEREFAlloway1983"
  • id="CITEREFBader2009"
  • id="CITEREFCoplans1972"
  • id="CITEREFWaldman1993"
You just need to use {{sfn|Coplans|1983|p=?}}. Even the Waldman (1993) link ought to work satisfactorily. HTH, Martin of Sheffield (talk) 16:49, 21 July 2013 (UTC)
Thanks.--TonyTheTiger (T/C/BIO/WP:CHICAGO/WP:FOUR) 16:53, 21 July 2013 (UTC)

Self-referencing link?

Don't see what the use of having a citation that self-references the article you are in, and does not actually point a new reader to the actual cite. Why not have a named citation that the reader can see and doesn't have to "look for" in a list of citations.

There's an irony here inasmuch as we stop newbies from using self-referencing links. Student7 (talk) 14:50, 30 August 2013 (UTC)

Well, it doesn't reference the article you are in – it just requires a second step to find the full reference.
But consider the alternative when a book is used many times in an article, and page references are given, as for example the use of Anderson (2001) in Cactus#References. The alternative to the use of the Harvard style links in the list of references is to repeat the full book citation every time – there are more than 25 such uses. What's the point of 25+ repetitions of "Anderson, Edward F. (2001), The Cactus Family, Pentland, Oregon: Timber Press, ISBN 978-0-88192-498-5"? Peter coxhead (talk) 15:38, 30 August 2013 (UTC)

What does the #invoke magic word do?

Because the Ringo Starr page on the Beatles Wiki was in a terrible mess (caused by somebody copying a previous version of the Misplaced Pages equivalent in a totally clueless fashion, resulting amongst other things in two different tables of contents, the Misplaced Pages one and the local one), I have just copied the current version over; unfortunately this involves copying the templates used, if they don't exist there.

I have hit a major roadblock copyng this (sfn) template; the #invoke magic word isn't recognised by Wikia's version of the cite parser, and neither the magic-words documentation nor the cite-parser documentation explains this either. I need to know so that I can recreate this functionality by some other means. Please reply on my userpage there, User:RobertATfm. — 188.29.16.101 (talk) 14:21, 13 October 2013 (UTC)

It's listed at Help:Magic words#Other and that directs you to Misplaced Pages:Lua which in turn links to mw:Extension:Scribunto; that extension needs to be installed on the wiki concerned. If you don't want to do that, you can use a pre-Lua version of {{sfn}} - the last one is here. --Redrose64 (talk) 18:25, 13 October 2013 (UTC)

Several page numbers to same book

I have used the sfn template on Wells Cathedral which we are working towards an FA nomination. One book (Smith 1975 - currently ref No: 101) has been used to support several claims. Another editor who has a copy of the book says that all the text is included on pages 1-2 and 25. What would be the page number syntax to show this within the sfn template as I can't see it in any of the examples given?— Rod 13:19, 20 November 2013 (UTC)

You can say {{sfn|Smith|1975|pp=1–2, 25}} in each place, but you might also consider being more specific, say if one of the statements were based on page 25 only. Kanguole 13:57, 20 November 2013 (UTC)
Thanks for your help - now done.— Rod 14:05, 20 November 2013 (UTC)

Multi-year ranges produce in {{sfn}} produce different results that those produced by {{cite Journal}}

When the publication date for a journal consists of a multi-year range, the span id produced by {{sfn}} differs from those generated by {{cite Journal}}. An example is:

{{Cite journal |last=Farlow |first=Archa Malcolm | title = Arizona's Admission to Statehood | journal = Annual Publication of the Historical Society of Southern California | volume = 9 | issue = 1/2 | pages = 132–153 | publisher = University of California Press | date = 1912–1913 | jstor = 41168902 |ref=harv}}

which produces a span id of "CITEREFFarlow1912.E2.80.931913", while

{{sfn|Farlow|1912-1913|p=152}}

produces a corresponding span id of "CITEREFFarlow1912-1913". Things would work better if the two matched. --Allen3  01:35, 16 April 2014 (UTC)

Using an en-dash character instead of "&ndash;" fixed it. It seems that {{sfn}} handles &ndash; properly, but Module:Citation/CS1 doesn't – the {{cite journal}} produces "CITEREFFarlow", while {{sfn|Farlow|1912&ndash;1913|p=152}} produces "CITEREFFarlow1912.E2.80.931913". This is mentioned in the table at Module talk:Citation/CS1/Archive 10#Update to the live CS1 module week of 2014-03-23. Kanguole 07:39, 16 April 2014 (UTC)
In the example given by Allen3, the |date=1912–1913 in {{cite journal}} does indeed use an en-dash - the character, not the entity &ndash; whereas the {{sfn}} doesn't use a dash of any form - it uses a hyphen-minus (the character typed on a normal keyboard). If you alter {{sfn|Farlow|1912-1913|p=152}} to {{sfn|Farlow|1912–1913|p=152}} it will work, because the {{sfn}} will now generate the URL fragment #CITEREFFarlow1912.E2.80.931913 to match the anchor in the {{cite journal}}. --Redrose64 (talk) 08:22, 16 April 2014 (UTC)
True, but in the article Allen3 was having trouble with, both used "&ndash;". Kanguole 08:30, 16 April 2014 (UTC)

Citation has multiple authors and no date

In section citation has multiple authors and no date it's suggested to use <ref>]</ref> instead of {{sfn|Lane|Singh}}. Is it also OK to add a |date=n.d. to citation and use {{sfn|Lane|Singh|n.d.}} instead?

Example.

References

  1. Lane & Singh n.d.
I have never seen the point of "n.d." The {{sfn|Lane|Singh}} form works perfectly well if the |year= and |date= parameters are omitted from the {{citation}}. --Redrose64 (talk) 19:32, 21 June 2014 (UTC)
<ref>]</ref> produces a footnote "Lane & Singh" with a CITEREFLaneSingh which is what is normally required. {{sfn|Lane|Singh}} produces a footnote of "Lane Singh" with a CITEREFLaneSingh. The linkage works fine but the displayed footnote is inadequate. For example:

References

  1. Lane & Singh
  2. Lane & Singh. sfn error: no target: CITEREFLaneSingh (help)
Personally I'd be worried about using "n.d." Remember WP:RF, what would a reader who is interested in the citations but doesn't understand Wiki markup think? Martin of Sheffield (talk) 22:24, 1 July 2014 (UTC)
Although it may seem unusual for some readers but it's recommended by Harvard style guide for situations where there is no known date and no approximate date can be estimated. (Maybe it's OK to leave it out, but I hope this discussion won't go so far as prohibiting its usage.) Dalba 05:32, 2 July 2014 (UTC)
Perhaps; but {{sfn}} is not Harvard and was never intended to be. Misplaced Pages does not enforce any one style, save that in order to qualify for featured article status, the citation style must be consistent within the article. --Redrose64 (talk) 11:35, 2 July 2014 (UTC)
By a curious coincidence I was recently wondering about dropping the year from a standard author-date (but not necessarily Harvard reference!) type of citation. Not for lack of a year, just for not being necessary. It seems to me that inclusion of the year is so standard that anyone with any familiarity with citations would find such a citation odd. Getting back to the case considered here, where no date is available, that does happen. And I wonder if the lack of a year is odd enough that that something (e.g., "n.d.") ought to be supplied in it place. In the print environment this is recommended as a placeholder where a data might be forthcoming. In our environment it could indicate that the absence of the year is not due to inadvertence, or some editor's goofy "style". ~ J. Johnson (JJ) (talk) 18:54, 2 July 2014 (UTC)
The problem as I see is that a reader who is unfamiliar with academic works but is intelligent, as WP:RF says a high school pupil, won't know what "n.d." means. If they see "Lane & Singh p. 3" it is pretty clear. "Lane & Singh (2009) p. 3" is also pretty self explanatory if you see an entry such as "Lane, Keiran & Singh, Karun (2009) ..." in the bibliography. Likewise constructs such as "2009?" or possibly even "c. 2009" work. However,, without consulting the Harvard manual of style, what does "n.d." mean? "Nunc dimittus?", "nearly done" or possibly Singh has the initials N.D. but doesn't like to use them, or alternatively they might be Singh's nickname. If you must use a placeholder then avoid technical jargon: "Lane & Singh (date unknown)" is a clear as a bell. Martin of Sheffield (talk) 22:36, 2 July 2014 (UTC)
The advantage of "n.d." in the print environment is that it could be replaced by a four digit date without upsetting any of the formatting. We, of course, are not concerned about that, and I think "date unknown" is quite satisfactory. The question is whether, in cases where the date (year) is unknown, it is satisfactory to omit the date entirely, without any explanation, or whether some indication be given ("n.d.", "date unknown", "????" or whatever) lest a reader think the omission is due to inadvertence. ~ J. Johnson (JJ) (talk) 19:13, 3 July 2014 (UTC)

No author name in citation template

In section No author name in citation template it lists examples of referencing by book title or periodical title rather than author, but there are two issues.

  1. Book and periodical titles are ordinarily in italics. The examples show italics in the main footnote but not in the short footnote. It should say definitively whether short footnotes should have book and periodical title in italics, and the examples should be consistent with this.
  2. Some Misplaced Pages articles may reference multiple articles in the same periodical, some with authors and some without. For consistency, it may be desirable to list all such articles by publication. For example, 1992 European Community Monitor Mission helicopter downing#News reports lists 5 articles in The New York Times, one of which comes from Reuters and does not have a listed author, and the article references all news stories using short footnotes referencing the periodical name even if the author is listed in the long footnote, which I think is stylistically more pleasing than using authors for some news stories. I edited this article to italicize periodical namesAnomalocaris (talk) 21:32, 1 July 2014 (UTC)
Please see Template talk:Sfn#Title-Date with wiki markup in link above, which discusses work titles in sfn. Clearly the preference is for italics for work titles and I would agree with that. If you are working a lot with sfn etc it would be a good idea to install User:Ucucha/HarvErrors.js. If you do that you will see several red messages reporting problems in the article you mentioned. It is rather difficult to catch these without some automated help. --Mirokado (talk) 01:08, 2 July 2014 (UTC)
Mirokado: Thank you for your comment. It's nice that there has been some discussion of book or periodical titles in italics on this talk page, but I am talking about the lack of discussion of this topic at Template:Sfn#No_author_name_in_citation_template, where it is needed. —Anomalocaris (talk) 10:20, 4 July 2014 (UTC)

I posted this under {{citation}}, but perhaps the experts here could have a think?

I've recently been working on Tir national and am trying to tie up the citations. One problem that has surfaced is the lack of authors for web sites, particularly those in a foreign (to me) language. In order to get an anchor for short form footnotes, I have simply forced the ref to be the title: ref = CITEREFTir_National for example. In the absence of an author the title displays first and so both the electronic linkage and the human's view agree: ^Tir National looks right.

The problem comes with long names. A title such as: "Ancienne caserne Prince Baudouin, dite également caserne Dailly" can hardly be called SHORT form! Basing the anchor on a subset works electronically but is confusing to the reader. What I'm trying is putting (in this case) "History:" before the citation, then using ref = CITEREFHistory and {{sfn|History}}. I did look at the display options, specifically author-mask, but that only works when there is a real author. Advice/comments please! Martin of Sheffield (talk) 14:32, 22 January 2015 (UTC)

@Martin of Sheffield: {{Sfn}} is for use when different pages or sections in a work are referred to. To use it, you only give the full citation to the work once (either the first time it appears in the article or in a separate Bibliography section) and then use expressions like {{sfn|Smith|2010|p=100}}, {{sfn|Smith|2010|p=110}}, {{sfn|Smith|2010|p=220}}, etc. to refer to different pages in the work. You don't need to do this for web citations as they don't have pages or chapters, so you don't need {{sfn}}. Just use <ref name=SOMENAME>FULL WEB CITATION</ref> the first time and then <ref name=SOMENAME/> thereafter. Peter coxhead (talk) 17:29, 22 January 2015 (UTC)
@Peter coxhead: We seem to have two threads on this; it's also under discussion at Template talk:Citation#Anchors. --Redrose64 (talk) 17:40, 22 January 2015 (UTC)

"Script Error" in Statue of Liberty

Statue of Liberty is very messed up right now, as it has "Script Error" in big red bold all over it, apparently where sfn is used. Is someone looking at this?

Oddly it seems OK in Opera and Firefox, but fails in Chrome "Version 36.0.1985.125 m" on Windows 8. The first instance is on the last words of "Origin":

which Bartholdi would later bring to the Statue of Liberty.Script error

A quick survey of a few other pages which use sfn shows no problems for me. Opening the article with Chrome in an incognito window gives me the same error, though. johantheghost (talk) 16:51, 10 August 2014 (UTC)

Well, it was happening consistently through restarts etc., but now it's OK... maybe a server glitch? johantheghost (talk) 03:33, 11 August 2014 (UTC)

Source in source

Is there a good way to cite an article in an anthology (book or otherwise), with just a short listing for the book which links to the full entry? This would be like sfn, but would include the author and title of the article. There is now a Template:Source in source to do this. But it is now limited in its capability. Is there a better way to do this, perhaps with sfn? DougHill (talk) 23:53, 22 August 2014 (UTC)

Could someone check my syntax?

I'd tried to implement {{sfn}} at Cakewalk to stop the References section looking too cluttered with replicated citations of the same thing, just with different page numbers, but it threw up errors each time. Could someone please check my code? Thanks! It Is Me Here 19:59, 1 September 2014 (UTC)

@It Is Me Here: The {{sfn}} template cannot be used inside <ref>...</ref>. Either remove the <ref> and </ref> wherever {{sfn}} is used, or use {{harvnb}} instead of {{sfn}} (but still inside <ref>...</ref>). --Redrose64 (talk) 21:01, 1 September 2014 (UTC)
That is correct. For the diff you have provided, with the callout consisting of just the template, I would suggest removing the ref tags and leaving just sfn as that will result in simpler source. --Mirokado (talk) 22:07, 1 September 2014 (UTC)
To editor Redrose64: OK, thanks, I've gone for the {{harvnb}} option. Now, the internal links Fletcher 1984 and Stearns & Stearns 1994 at Cakewalk#Notes work, but Baldwin 1981 doesn't. Any ideas? It Is Me Here 22:55, 1 September 2014 (UTC)
{{cite jstor}} doesn't recognise |ref=harv, nor does it pass it along the chain. Even if it did, the other links in the chain don't recognise it or pass it along either; so rather than amend each one, it's easier to go right to the end and do this. --Redrose64 (talk) 23:06, 1 September 2014 (UTC)
Is that a bug, or intentional? Would it make sense to start a thread about this at Template talk:Cite jstor? It Is Me Here 12:20, 2 September 2014 (UTC)
I don't know; jstor is outside my field (the identifiers that I typically use are isbn, lccn and oclc), so I never use {{cite jstor}}. --Redrose64 (talk) 14:15, 2 September 2014 (UTC)
Along with some other templates, {{cite jstor}} shouldn't be used for any new sources at present, as it relied on software on the old tool server, now defunct. See its documentation. Peter coxhead (talk) 14:28, 2 September 2014 (UTC)

Broken wrt {cite doi}

Recently, there and edit was made (not here, but I don't know where it was), that breaks {sfn} behaviour wrt {{cite doi}} (possibly because {cite doi} was deprecated recvently). That breaking edit is unacceptable. It is up to the closing process (actors) to cleanup any undesired (newly introduced) usage. That could be a bot in this case. -DePiep (talk) 09:11, 13 October 2014 (UTC)

@DePiep: The {{sfn}} template hasn't been edited in six months, and {{cite doi}} not in eight months. What is this breakage, and on what pages does it manifest itself? --Redrose64 (talk) 12:17, 13 October 2014 (UTC)
Indeed, I don't know where the edit was made. This question is evolving at Module_talk:Citation/CS1#Where_dos_this_break_come_from.3F (I'm sorry, bad I did multi-forum this). -DePiep (talk) 13:02, 13 October 2014 (UTC)

Postscript

"The postscript is only effective the first time sfn is used for a particular author, year and location." Is this deliberate or is it a bug? I can't see any obvious reason why this would be a good thing, but equally it's presumably quite easy to change with the addition of an extra conditional? Unless I'm missing something there could well be occasions when a two refs would want to refer to the same page, but not quote the same text or make the same point. JimmyGuano (talk) 07:55, 1 January 2015 (UTC)

In that, probably rare, case consider using |loc= to disambiguate the quotations: {{sfn|Jones|1984|loc= p. 34, para 1|ps= (but he contradicts himself below)}} and {{sfn|Jones|1984|p=34}}.
  1. Jones 1984, p. 34, para 1(but he contradicts himself below) sfn error: no target: CITEREFJones1984 (help)
  2. Jones 1984, p. 34. sfn error: no target: CITEREFJones1984 (help)
Martin of Sheffield (talk) 13:51, 1 January 2015 (UTC)
Thanks - that does look like a viable workaround. I'm still not clear why this situation is the case though? JimmyGuano (talk) 07:26, 3 January 2015 (UTC)
I think because virtually always editors are content to simply cite pages (indeed getting them to do that can be an issue). {{sfn}} is explicitly aimed to collect citations, and the tuple (author, date, page) is nearly always adequate. Off hand, except for references to multicolumn works (newspapers, physically large encyclopaedias), I can't recall seeing detail finer than that. As an alternative to using |ps= to add a note, you can always use the {{efn}} mechanism. See Hartley Colliery Disaster for an example of footnotes. HTH, Martin of Sheffield (talk) 13:44, 3 January 2015 (UTC)
@JimmyGuano:When two instances of {{sfn}} have identical authors, year, |p= |pp= |loc= they are treated as entirely identical, regardless of any other parameters that may be present. This is because it is only those eight parameters which are used to construct the name= attribute of a <ref name=...> tag, and when the MediaWiki software finds two such tags with identical names, it assumes that they are identical in all other respects, and only displays the information pertaining to the first instance. You can get a similar effect with regular <ref>...</ref> tags:
First claim;<ref name=Smith2015p1>Smith (2015), p. 1 "The Government announced that some taxes were to be increased"</ref> Second claim.<ref name=Smith2015p1>Smith (2015), p. 1 "The Government announced that some restrictions would be imposed"</ref>
gives
First claim; Second claim.
  1. ^ Smith (2015), p. 1 "The Government announced that some taxes were to be increased" Cite error: The named reference "Smith2015p1" was defined multiple times with different content (see the help page).
Notice how the two refs are merged, with the text of the second being ignored. --Redrose64 (talk) 16:17, 3 January 2015 (UTC)
Thanks Redrose, very good point about the similar <ref></ref> behaviour. Just to make it absolutely clear, in your example the whole of the text is being ignored, even the repeated citation:
One<ref name=Smith2015p1>Smith (2015), p. 1 "Comment 1"</ref> Two<ref name=Smith2015p1>Text with no relation to Smith</ref> Three<ref name=Smith2015p1/> The third instance shows the more typical way of doing this, instead of a <ref></ref> pair you can close the tag off internally.
One Two Three
  1. ^ Smith (2015), p. 1 "Comment 1" Cite error: The named reference "Smith2015p1" was defined multiple times with different content (see the help page).
Personally I prefer the {{sfn}} method. With ref tags you need to invent a name which is unique and which you reuse as appropriate. Too much work for late night sessions, {{sfn}} does all the work for you! Martin of Sheffield (talk) 20:12, 3 January 2015 (UTC)
In the (rare) cases that I use {{sfn}} to cite two different items on the same page, I would use the |loc= parameter instead of |p=, as in {{sfn|Smith|2015|loc=p. 1, paragraph 2}} {{sfn|Smith|2015|loc=p. 1, paragraph 4}} or for a newspaper {{sfn|Smith|2015|loc=p. 1, col. 2}} {{sfn|Smith|2015|loc=p. 1, col. 4}} - these are treated as distinct refs because the |loc= parameters differ. --Redrose64 (talk) 20:25, 3 January 2015 (UTC)
Thanks both - I understand now. I had assumed that there was a piece of logic that separated out the footnotes where the author, date and page were not the same, and it would therefore be quite straightforward to add "and if ps is different too". Now you've explained how it works I appreciate that it isn't that simple. The workaround you've explained seems the way forward when this is needed. I'm a big fan of sfn in general too - a very elegant footnoting solution. Apologies for the awkward question! JimmyGuano (talk) 20:40, 3 January 2015 (UTC)

translate page ranges to ndash

I use sfn as my primary cite markup. Recently I was admonished because I used "minus signs" in page ranges instead of ndash. Is there any reason sfn couldn't translate these for me? Maury Markowitz (talk) 22:12, 18 February 2015 (UTC)

My guess is that you actually used hyphens ("-"). The minus sign ("−") is different from the en-dash ("–") and em-dash ("—"). Anyway, one reason is that sometimes you want to refer to a single page that has a hyphen in its number. There is no good way of distinguishing those correctly formed but hyphenated pages from mistyped page ranges. —David Eppstein (talk) 00:46, 19 February 2015 (UTC)
Sure there is, pp vs. p. The alternative requires significant work for basically zero benefit to the end user. Maury Markowitz (talk) 15:55, 19 February 2015 (UTC)

User:Ucucha/HarvErrors

I think it would be helpful to to add to the template documenation that the tool at User:Ucucha/HarvErrors will give an error message when the coding is wrong. Dudley Miles (talk) 18:57, 3 March 2015 (UTC)

I don't think having a citeref that is never linked to should be classified as an error. That would prevent many/most uses of {{citation}}, for instance, which automatically makes citerefs. But the warning about links that don't go anywhere does look useful. —David Eppstein (talk) 19:23, 3 March 2015 (UTC)
I agree that it is annoying that the tool gives false error messages when citation is used without harv refs, but it is extremely useful in picking up errors. Dudley Miles (talk) 20:03, 3 March 2015 (UTC)
I made a copy in my userspace at User:David Eppstein/HarvErrors.js with only the messages about missing link targets, and not about unused link targets. (The other difference is that I write-protected it so that vandals can't inject bad javascript into your Misplaced Pages page views.) I'm already finding it very useful. —David Eppstein (talk) 00:16, 4 March 2015 (UTC)
You don't need a customised script. You can do it using the normal script: all you need to do is to add
span.citation strong.error { display: none; }
to Special:MyPage/common.css. --Redrose64 (talk) 11:31, 4 March 2015 (UTC)
Thanks very much Redrose64. Brilliant. Dudley Miles (talk) 12:34, 4 March 2015 (UTC)

Request TemplateData

Would someone who knows what they're doing be willing to add TemplateData to sfn? I'd try it myself but I don't like experimenting with such a widely used template. As far as I can see there's no TemplateData currently; no parameters descriptions appear in the VE template dialog. Mike Christie (talk - contribs - library) 10:44, 16 April 2015 (UTC)

The documentation is mostly in {{Harvard citation documentation}} which is shared with several others. --Redrose64 (talk) 14:33, 16 April 2015 (UTC)
The reason I asked is that in adding an sfn earlier I saw no template data come up in VE. Would that mean I just have to copy the relevant portions of the Harvard citation documentation over to sfn's TemplateData? Mike Christie (talk - contribs - library) 14:50, 16 April 2015 (UTC)
What relevant portions would those be? --Redrose64 (talk) 16:49, 16 April 2015 (UTC)