Template talk:Sfn/Archive 5

New template
I have just created the template for invoking again a reference already defined via. Any comments/ideas? --Grufo (talk) 09:25, 20 September 2020 (UTC)
 * Isn't that the same as using again? Kanguole 09:32, 20 September 2020 (UTC)
 * Great, you are right. I don't know why I kept getting errors when using again on the same page, and I always ended up typing the very annoying .... I apologize for the waste of template then. --Grufo (talk) 09:40, 20 September 2020 (UTC)
 * I've been trying to work out what does, I noticed it and it was new to me.  As  says, it appears to just duplicate using  a second time.  Wherein is the purpose? Martin of Sheffield (talk) 09:42, 20 September 2020 (UTC)
 * The purpose is that of avoiding the error "The named reference blabla was defined multiple times with different content" (or something similar), which at the moment I am not able to reproduce anymore :/ Any tips from other editors' personal experience? --Grufo (talk) 09:46, 20 September 2020 (UTC)

''' Found it! '''

Go to the page Marriage in ancient Rome, start editing it, and search for the text. Replace it with. You will notice that the following text will appear among the references:

"Cite error: The named reference "FOOTNOTEStocquart1907305" was defined multiple times with different content (see the help page)."

Now replace instead  with , and see what happens.

--Grufo (talk) 10:24, 20 September 2020 (UTC)


 * See also for a more concise example --Grufo (talk) 10:55, 20 September 2020 (UTC)
 * OK, now I see what the problem is. When you use the ps parameter  spots the additional text.  It is not used in the CITEREF string, and so will combine the two references, and then complain.  Generally try to remeber that "sfn" stands for "shortened foot note" and avoid verbose inflations.  I would suggest using  in its simple form and adding an extended footnote (efn)if appropriate.  The  mechanism will then work as expected.




 * But this is exactly why I created this template. The ps= case is one example, but there might be other cases where defines a named reference multiple times. The  template grants instead that a reference is never redefined. --Grufo (talk) 11:29, 20 September 2020 (UTC)
 * No templates in section headers. I removed the section headers from your above posts.
 * Including extraneous text in a short form reference template (,, and the like) is clearly contrary to the purpose of the templates: to be . If the text that is included in the ps parameter is important to the article, use it in the article and then cite it.  Don't clutter references with non-reference text.  Yeah, I know, other editors disagree with this position.
 * If this template is to be retained, it should probably be implemented by Module:Footnotes.
 * —Trappist the monk (talk) 11:33, 20 September 2020 (UTC)
 * The "short" in "shortened footnote template" refers to the short way of citing a source (only surname and year), given afterwards in full details in the Bibliography. But it does not refer to how long what a source states must be. It is a normal usage in literature to have long quotations in footnotes followed by "Smith 2002" (for example). --Grufo (talk) 11:41, 20 September 2020 (UTC)
 * You see, other editors disagree with this position.
 * —Trappist the monk (talk) 14:58, 20 September 2020 (UTC)
 * Whatever our disagreement about a quoted text might be, this template is not about the |ps= parameter, this template is about all the possible cases in which might redefine a named reference, and it will always work simply because  refuses to create new named references, no matter how you invoke it. --Grufo (talk) 15:04, 20 September 2020 (UTC)
 * Why so defensive? Where have I said anything about how  works or what it does?
 * —Trappist the monk (talk) 15:13, 20 September 2020 (UTC)
 * You are right, Trappist. I have been involved in quite many wiki disputes lately and I might have just got used to it. --Grufo (talk) 15:17, 20 September 2020 (UTC)
 * Why so defensive? Where have I said anything about how  works or what it does?
 * —Trappist the monk (talk) 15:13, 20 September 2020 (UTC)
 * You are right, Trappist. I have been involved in quite many wiki disputes lately and I might have just got used to it. --Grufo (talk) 15:17, 20 September 2020 (UTC)

I don't even know what programming language Module:Footnotes is (is that php? perl?), so I really would not be able to contribute. And even just the current template is more like a beta version of a proposal than anything more. But if the idea is good I hope other editors more experts than me in dealing with Wikimedia templates can improve it. --Grufo (talk) 12:15, 20 September 2020 (UTC)
 * Lua.
 * —Trappist the monk (talk) 14:58, 20 September 2020 (UTC)
 * Ok, so, Module:Footnotes has a function, named, to which 's parameters p, pp, page, pages and loc are passed for sanitization. Unfortunately   is not a public function, so my template cannot access it. This means that none of the above parameters is sanitized in my template. This should not be a problem with every-day usage of p, pp, page, pages, but it definitely constitutes a problem with loc, whose support cannot be implemented without accessing the same Lua function.
 * I have seen just now that you are the author of Module:Footnotes. What would you think about exporting  as a public function? As until few hours ago I did not even know what Lua looked like, I will just stop here.
 * --Grufo (talk) 16:21, 20 September 2020 (UTC)
 * I was thinking that with a tweak,  could render  by skipping the call to   and setting   to an empty string.
 * —Trappist the monk (talk) 00:24, 21 September 2020 (UTC)
 * Yes, from within Module:Footnotes it would be really simple to implement, since it literally consists in producing a void content. --Grufo (talk) 14:02, 21 September 2020 (UTC)

Recently reverted mentions of the new resfn template in other template documentation
I noticed in my watchlist that reverted 's edits mentioning the new resfn template in other template documentation (see 1, 2, 3). Since this page appears to be where most of the discussion of Grufo's new resfn template is happening, I thought I would mention the reverts here since the reverts suggest some conflict about the rationale for the new template.

Like Redrose64 (apparently), I am skeptical about the need for the new resfn template. Why create a new template—why not just document this particular limitation of sfn in its documentation and explain how to work around it using a named tag? It may be too rare of a limitation to justify a new template: Grufo even had trouble reproducing the limitation, as seen above! Biogeographist (talk) 02:27, 21 September 2020 (UTC)
 * The text that was reverted did not adequately explain why someone would use resfn, so it was not helpful. There is more at Template talk:Resfn. As far as I can tell, resfn's functionality is supposed to be "act like sfn but use the ps value from the originally defined sfn template with the same author/year/page combination". But I am a poor mind-reader. The template's author claims, but has not yet demonstrated, that there may be other uses. I created a testcases page to try to help the template's author show how the template might be useful. – Jonesey95 (talk) 04:15, 21 September 2020 (UTC)
 * The edits that [//en.wikipedia.org/wiki/Special:Contributions/Redrose64?offset=20200920193600&limit=3 I reverted] showed no situation that could not have been used for, no suggestion that any advantage was being provided by using  instead. What I saw was a misunderstanding of the purpose of, it is designed for multiple use, and may be seen used in that way at several recent TfAs, such as Ismail I of Granada, Battle of the Bagradas River (255 BC) or Qibla. -- Red rose64 &#x1f339; (talk) 10:24, 21 September 2020 (UTC)
 * Thank you for your intervention, . I think first we need to make clear what we are talking about. If we look at a footnote, we can schematize it as follow: REF_CONTENT. When an editor invokes sfn, the latter always produces an output for, but it might produce an output for   or not, depending on several considerations. Currently, in the cases where sfn would emit a   despite an editor does not want it, the only solution is to write by hand   (using a very complicate  ) – which is a bit bizarre, since there is currently an effort from Wikipedia against having to write by hand the   tag.
 * Take the example I gave above from Marriage in ancient Rome. Imagine someone erases from the page  and consequently   returns an error. For someone not skilled enough in HTML, finding what   referred to will be a nightmare. While if the resfn was used instead of , it would be as simple as switching back from resfn to sfn.
 * In summary, resfn is nothing else than a variant of sfn where  is always void, no matter how resfn is invoked.
 * --Grufo (talk) 14:00, 21 September 2020 (UTC)
 * Thanks for the explanation—that makes it much clearer for me. If the template is kept, I agree with others that the documentation should be much clearer. What you just wrote above is a good first step. I wasn't aware that there is currently an effort from Wikipedia against having to write by hand the tag. Biogeographist (talk) 14:42, 21 September 2020 (UTC)
 * The tag is not deprecated, the effort is just visible from the number of templates produced (and actively used) for footnotes. The relationship between resfn and sfn would bit more or less like the one between r and a generic named note not defined via sfn. --Grufo (talk) 15:32, 21 September 2020 (UTC)
 * I'm glad to hear that the humble tag is not passé, since I am more inclined to write   and   than to try to stuff it all into a sfn template, though I will happily use sfn for short citations without the "blah blah blah..." Biogeographist (talk) 17:24, 21 September 2020 (UTC)
 * The construction in Marriage in ancient Rome is strange, and one that I have never seen in my editing of thousands of articles using sfn. I'm not sure why someone wouldn't just follow the guidance in this template's documentation and use  inside ref tags, which is much easier to parse and will not break if the original sfn template is removed. If resfn is a shortcut to that syntax, its documentation should explain that usage. – Jonesey95 (talk) 15:43, 21 September 2020 (UTC)
 * The harvnb template is not specific for creating a void, but its purpose is that of not enclosing a reference within the   tags (so, nearly the opposite). As such, if used for our scenario, it would have the inconvenience of duplicating identical footnotes. It seems to me that using harvnb for our case is more like an ugly workaround for something that resfn would do with a better result. --Grufo (talk) 16:01, 21 September 2020 (UTC)
 * works fine for identical footnotes. The problem arise when you want to make them different, using ps. There's no sensible way to merge them in that case. Kanguole 16:11, 21 September 2020 (UTC)
 * That of a different ps is a different case. As the two footnotes would effectively be two different footnotes, if a differentiation is to be implemented this must be done within the sfn template. This could be done by introducing a marker parameter for example, or by hashing the ps parameter via Lua – but these are just ideas for another discussion with sfn's author. But it would not concern resfn, as the latter deals only with producing a shortened footnote with an empty.
 * If two sfn footnotes have different ps values but the same author/year/page values, they are different footnotes, and they currently generate an error message. The documented  inside ref tags method is the only way to work around the problem today, AFAIK. The new resfn template reuses the ps value from the first sfn template (as shown in this test case), so it does not meet the need (yet?) of people who want to use two sfn footnotes with different ps values but that otherwise match. – Jonesey95 (talk) 20:10, 21 September 2020 (UTC)
 * I'm still not convinced of the need. Here's the relevant portion of Marriage in ancient Rome:  There are five instances of  here, three of which use ps and they're all rather lengthy. The point about  is that it produces shortened footnotes, that's why it has the name. If you feel that you need to give such a huge amount of supporting information for a reference, that tells me that one of these things is occurring:
 * it's not a reliable source so you're attempting to boost its credibility
 * you're synthesising your own interpretation of the source text by "showing your working" to show how one leads to the other
 * you feel that the source uses some obscure terms which could benefit from explanation
 * you need to clarify which portion of the source supports the referenced sentence, but a page number is insufficiently precise, so use a direct quotation
 * I really hope it's 3 or 4; for no. 3, have you considered using / for those explns, or even making them part of the main text? For no. 4, it would be better to use e.g. which is distinct from  and no error will be thrown if both are used.
 * I have been back through the archives of this page, and the following are relevant: Template talk:Sfn/Archive 1; Template talk:Sfn/Archive 1; Template talk:Sfn/Archive 2; Village pump (technical)/Archive 141; Template talk:Sfn/Archive 2; ; Template talk:Sfn/Archive 2; and Template talk:Sfn/Archive 3. -- Red rose64 &#x1f339; (talk) 20:49, 21 September 2020 (UTC)
 * Despite in the case of a long ps I would definitely opt for resfn, the template itself is not directly related to the length of a quotation. I have created a comparison of the same short quotation referenced many times, in one case using only sfn and in the other case using sfn + resfn. You can find my comparison . As you can see, using only sfn you have to repeat the same quotation many times – and I have chosen a very short sentence for this example. --Grufo (talk) 21:41, 21 September 2020 (UTC)
 * I've just tried to add an alternative to show that your example is incomplete. However the sandbox is never still and your example has been overwritten many times now.  It would be better in future to use your personal sandbox to avoid this issue.  I've copied your original to one of my sandboxes here (genuine contributors to this discussion are invited to add to it).  I've added another stanza showing how to do it in two different ways using the existing templates. Martin of Sheffield (talk) 08:03, 22 September 2020 (UTC)

That is what I meant with my answer to Jonesey95. Your example (at ) produces a result that is not desirable in my opinion: two different footnotes and the disappearance of the quotation in one. Of course this could be solved by using  the first time, and   all the other times… But then we would just be using our old affectionate  tag for all our notes. P.S. Thank you for giving us a sandbox under your username. Whether we use that or we use the public Sandbox for our examples, we should always reference our edits as oldid or oldid2 as I did before, so that our links are truly permanent. --Grufo (talk) 09:56, 22 September 2020 (UTC)
 * There are only two different references because I forced "eiusmod" to be different to show the alternative. I could have more easily just used the  and then reference [3] would not exist.  I don't follow "the disappearance of the quotation in one".  It is clearly there under footnote [a]. Martin of Sheffield (talk) 10:19, 22 September 2020 (UTC)
 * The note after “ullamco” does not have a quotation. And if you do insert it in the same way you did for the first line (the note after “sed do”) it will be a very confusing quoting… Imagine you had many sources in the same point… We would see something like [1][a][2][3][b][5] – a nightmare. --Grufo (talk) 10:48, 22 September 2020 (UTC)

FWIW I like this new template. It seems like a much better way of resolving the cite error than what Help:Cite errors/Cite error references duplicate key recommends at present. – SD0001  (talk) 07:21, 21 September 2020 (UTC)
 * FWIW I agree. --Grufo (talk) 14:21, 21 September 2020 (UTC)
 * I am late to this discussion, but to avoid this issue, I would use loc as the in-source location when the author-year-page are identical. Btw the error used to be generated with various iterations of, including sfnm in the same page. So this:  in the same page as this:   would also generate an error. At least until a few years back, it is not the case now. My solution was   and in subsequent usage,  . The loc label also works in the rarer case where you have more than two such instances, as long as you format the location differently e.g.  . All these are still hacks of course. 98.0.246.242 (talk) 02:13, 30 December 2020 (UTC)

Web citations
I am trying to fix sfn errors in Christopher Codrington. References 9 and 10 are to undated websites so the sfns don't link to the sources. Should they be changed from sfn to cite web style, or is there a better way to resolve this? TSventon (talk) 20:29, 21 January 2021 (UTC)
 * You might rewrite them as:
 * —Trappist the monk (talk) 20:43, 21 January 2021 (UTC)
 * Or use sfnref inside the ref parameter of cite web, like this. I think that is more common. – Jonesey95 (talk) 20:46, 21 January 2021 (UTC)
 * Thank you and  I fixed my own sfn error at Association for the Education of Women but Codrington was a bit more complex. TSventon (talk) 22:08, 21 January 2021 (UTC)
 * Or use sfnref inside the ref parameter of cite web, like this. I think that is more common. – Jonesey95 (talk) 20:46, 21 January 2021 (UTC)
 * Thank you and  I fixed my own sfn error at Association for the Education of Women but Codrington was a bit more complex. TSventon (talk) 22:08, 21 January 2021 (UTC)

Problem with ps=
See X Y

vs X Y


 * The location within the text belongs in loc rather than ps, e.g. X, Y, Z Kanguole 13:06, 30 January 2021 (UTC)
 * Thanks. Wtmitchell (talk) (earlier Boracay Bill) 15:36, 30 January 2021 (UTC)
 * Thanks. Wtmitchell (talk) (earlier Boracay Bill) 15:36, 30 January 2021 (UTC)

Translator without author
The sfn template doesn't seem to work if the ref has a translator without an author, which is the case with most of the ancient Hindu texts. What is broken is the clicking of the "Last 2000" link as well as the modal window that appears when you hover your mouse over the link.

Jroberson108 (talk) 04:15, 7 March 2021 (UTC)
 * Use  in the cite book template to create a match for the sfn template. See Template:SfnRef. – Jonesey95 (talk) 05:56, 7 March 2021 (UTC)

Does ref= do anything?
I am finding examples of people setting it to harv. AManWithNoPlan (talk) 15:59, 18 April 2021 (UTC)
 * In the citation templates, harv used to set the name of the reference using author surnames and year, but that behaviour is now the default, so harv is redundant. I don't think it ever did anything useful in . Kanguole 16:44, 18 April 2021 (UTC)
 * It is possible to set harv in an template:
 * That creates a link to an anchor  so one could do this (using the above :
 * → Some text linked from the
 * That creates a link to an anchor  so one could do this (using the above :
 * → Some text linked from the


 * The target 'Some text ...' doesn't highlight blue because it isn't wrapped in a tag.
 * ref in allows editors to override or customize the target link; useful I suppose when linking to non-cs1|2 targets.
 * —Trappist the monk (talk) 16:57, 18 April 2021 (UTC)
 * There were 568 articles using ref as of the most recent monthly Template Data report. If ref is set to "harv", it is probably an error. – Jonesey95 (talk) 21:49, 18 April 2021 (UTC)
 * There were 568 articles using ref as of the most recent monthly Template Data report. If ref is set to "harv", it is probably an error. – Jonesey95 (talk) 21:49, 18 April 2021 (UTC)


 * , You asked if ref does anything? Besides the harv example you asked about and which has already been answered, it can be used to set the value to be used with when no authors (or no year) are available in a citation, or where there are a lot of authors, and you want a shorter sfn. Typically, this is done with the aid of template harvid because it's much easier that way. See several examples of this at Liberation of France, including  for linking to a reference coded as  for the official journal of Free France, which is a governmental bulletin something like the Congressional Record. Mathglot (talk) 18:38, 18 May 2021 (UTC)

Problems dereferencing sfns embedded in remote NoteTagged passages
Hi, in articles with large numbers of citations, I use sfn's and template notetag to remove the inline &lt;ref> clutter in the interests of making it less confusing for new contributors to make additions. However in the case of notetagged material, if it has an sfn within it, I cannot place the note at the end of the article and refer to it by name, or I will get redtext warnings that the sfn referents were not resolved. An example may make this more clear. For example, in the Trumpism article, notetag Jones2012 works just fine because it has no sfns. But notetag|name=Goldberg1 text does not if it is moved to the notes section as with the Jones note. If you try this and preview the result, you will see the error red text I am talking about. I have tried Ref=sfnref to address what I anticipate is a template processing order of dereferencing issue, but to no avail. Putting &lt;ref>'s in the notetag works, but this solution junks up the footnote section with voluminous material that belongs in the bibliography section. Any suggestions? I can live with the inline notetag clutter as you see in the example article but I suspect others may have found a solution to this annoying situation. If there is no immediate answer, please ping me even if your suggested solution occurs to you years from now. Thanks in advance for any suggestions on workarounds which will be reasonably copyable by wiki editors. Even random ideas on what I could experiment with. J JMesserly (talk) 02:33, 18 May 2021 (UTC)
 * You might be looking for Nesting footnotes. – Jonesey95 (talk) 13:57, 18 May 2021 (UTC)
 * Thanks for the pointer, but the example I gave with s inside a notetag is effectively what the Nesting footnotes page describes with refs within a refn. That does work, but is unacceptable for the stated formatting reasons. It does give me an idea on something else this page does not describe but the wikimedia engine might support.  Thanks.  J JMesserly (talk) 20:44, 18 May 2021 (UTC)
 * When I ran into something similar to what you are describing, someone helped me tie what I was seeing into a known bug being tracked on Phabricator. I can't remember who it was; maybe  or ?  Mathglot (talk) 18:00, 18 May 2021 (UTC)
 * @J JMesserly, if you don't want to look at wikitext markup code any more than necessary, then have you considered using the visual editor instead? It works like a word processor.  Click on https://en.wikipedia.org/w/index.php?title=Trumpism&veaction=edit to see it in action.  It's awesome for tables (insert, delete, and rearrange columns at the click of a button...) and really helpful for copyediting.  There's no real need for anyone to be dealing with clutter in the interface. WhatamIdoing (talk) 00:59, 19 May 2021 (UTC)
 * I have gotten quite comfortable with wikitext over the past 18 years and was quite annoyed with the visual editor when it came out and haven't taken a more recent look. I guess I assumed wrongly that novice editors would be intimidated by the heavy citation markup of complicated articles like Trumpism.  (300+ cites). It's good to know that this is less of a problem than I thought.  Do most people use this now?  If so, then my motivation for finding a solution to this would be much reduced.  01:46, 19 May 2021 (UTC)

Sfn with author and abbreviation but no year
I'm not 100pc sure whether this is the best place to look. Regardless, I'm working a lot with Sfn for modern works and I'd also like to use them for ancient ones. While the citation of Plutarch, Life of Brutus (for example) can be worked around page numbers using the  parameter, the date isn't important at all.

While I can get Sfn to produce serviceable author-year pairs for modern works and also for the translation editions of ancient ones, when you have "Plutarch 1917" and "Plutarch 1918" referring to "Life of Pompey" and "Life of Brutus" respectively, this becomes less useful.

Instead, is it possible to get Sfn to produce footnotes like "Plut. Brut. 3.2" or "Plutarch, Life of Brutus 3.2" where the title of the work (Brut, Life of Brutus) is given a wiki-link? I've already tried something like creating a harvid  but this is interpreted as a separate author (ie "Plutarch & Life of Brutus") rather than something like a title, so I'm stumped. Ifly6 (talk) 04:07, 21 May 2021 (UTC)


 * You could do something with sfnref like |ref= and then call it with So that'd look like:


 * — short citation linked to....


 * — full citation, with sfnref in ref


 * Umimmak (talk) 04:14, 21 May 2021 (UTC)


 * , Yes, you can, use the ref parameter, and the harvid template. Mathglot (talk) 08:44, 21 May 2021 (UTC)

Refs and notes

 * My thanks both to Umimmak and Mathglot for showing me this alternative formulation. Ifly6 (talk) 16:13, 21 May 2021 (UTC)

Sfn usage with multiple sources with no years
Hello, looking at the template page, I don't see an example usage with more than one source from the same author but with no year for both sources, so I'm not sure how I can repeat 2007a and 2007b type usage when doing something like source1: and source2:. My specific example is here on this edit - I use n.d.e. and n.d., which feels improper. Does anyone have a suggestion on this? --Engineerchange (talk) 02:03, 29 May 2021 (UTC)
 * you can use harvid similar to the example above. Ping me if you need a fuller explanation. Mathglot (talk) 02:24, 29 May 2021 (UTC)
 * In this particular case, you are using a distinct "Author" too (ACS1 and ACS2), so there would be no need to distinguish the date parameters. Why "ACS", did you intend "ACM" (Anacostia Community Museum)? Some editors use work titles (or parts of them) in italics when necessary, which is where you would need in the citation : in this case you could use During Slavery and in Maryland as short distinctive names. The date parameter can be omitted with a single "Author" – "n.d.e." is just cluttering up the table here. --Mirokado (talk) 02:34, 29 May 2021 (UTC)
 * excellent! worked like a gem, thank you! --Engineerchange (talk) 02:50, 29 May 2021 (UTC)

Throwing an error when a reference is absent?
What needs to happen to change the code for "" to check to see if the reference cited is actually available and to provide a user friendly error message when it's not?

User:Tamerlanahayav added to World War II without adding the reference. When I clicked on "Geiger", it did nothing, because it did not know where to go. That's a deficiency in the article on "World War II", but I would think there should be a way to inform a user when they've added a reference to something that's not there. In this case,  displays with "Geiger 2012" blue and underlined, which suggests that I should be able to click on it and get more information about it. However, in this case, when I click on it, nothing happens.

At minimum, I think it should display as red to make it easier for the user who inserted to see that something is missing. I think it would be better if it displayed a more informative error message when a user presses "Show preview".

Thanks, DavidMCEddy (talk) 14:42, 19 June 2021 (UTC)
 * See to learn how to show various errors.
 * —Trappist the monk (talk) 14:46, 19 June 2021 (UTC)
 * Thanks, but shouldn't the software be REQUIRED to notify a user when they insert a reference like without a complete citation to "Geiger 2012" someplace else in that Wikipedia article?
 * Currently, users get no notice of a need to add a reference to which something like refers.  In other contexts, when someone inserts a broken link, it appears as red.  That alerts the user that there's something wrong.  This doesn't do that.
 * User:Tamerlanahayav may eventually see my complaint above and fix the error introduced by inserting without the complete citation.  I think a user who commits an error like this should be notified immediately, like they are when they introduce other broken links.  It shouldn't require someone like me to pester them ;-)  DavidMCEddy (talk)
 * Were it up to me, I would have Module:Footnotes emit visible error messages. Alas, it is not up to me.  The community have decided that because of the issue of false positives, the error messages emitted by Module:Footnotes must be hidden from editors who have not elected to enable error message display.
 * —Trappist the monk (talk) 16:37, 19 June 2021 (UTC)
 * Re when someone inserts a broken link, it appears as red and I think a user who commits an error like this should be notified immediately, like they are when they introduce other broken links. - red links are not "broken links", they are also not necessarily errors. See WP:REDDEAL. -- Red rose64 &#x1f339; (talk) 08:21, 20 June 2021 (UTC)


 * Thanks for the reference to WP:REDDEAL.
 * What do you think should happen when a user inserts something like into an article for which no reference mating "Geiger|2012" can be found in that article?
 * In this case, User:Tamerlanahayav received no notice of a problem at the time. I posted a question here just over two hours later that included , and another user reverted the addition entirely roughly 14 hours later, noting, "unverifiable without full citation, presumably copied from another article without attribution. This is a GA."
 * However, if User:Tamerlanahayav does not have a working email properly associated with their account (and they are "Watching" that article), they may never find out there's a problem with what they did unless they manually happen to check that article again. DavidMCEddy (talk) 13:48, 20 June 2021 (UTC)
 * While I came down on the side of hiding the warnings by default (and let's remember that the on-switch, and Category:Harv and Sfn no-target errors at 25K+ entries, are there for gnomes' pleasure), I interpreted 's request to ask for a warning message on preview only. No doubt that's an over-interpretation, and I seriously doubt it's possible for the preview to suppress warning on pre-existing sfn/harv errors, but I can dream. David Brooks (talk) 14:22, 20 June 2021 (UTC)
 * There are some cases of spurious errors which only appear in preview mode, so that would be a hindrance for editors who have not chosen to see them. --Mirokado (talk) 14:53, 20 June 2021 (UTC)
 * @Editor Mirokado: There are some cases of spurious errors which only appear in preview mode Are you talking about  errors?  If you are, can you provide evidence to support that claim?  Can you provide examples of where these errors occur?
 * —Trappist the monk (talk) 15:42, 20 June 2021 (UTC)
 * Thanks for encouraging me to investigate further. While doing so I noticed Category:Harv and Sfn template errors and updated to your current script User:Trappist the monk/HarvErrors.js. With that new script the problems I was seeing seem to have gone away. Well done. --Mirokado (talk) 22:26, 20 June 2021 (UTC)

Problems with Sfn
was just added to World War II without adding anything like Geiger (2012) to the World War II. As a result, when I clicked on Geiger, I got nothing. I don't have any idea about how to find that reference.

Beyond that, I'm negatively impressed with the use of "" because it's very hard for someone not familiar with Wikipedia to understand.

I vastly prefer to enter a reference into Wikidata and then reference it using template:Cite Q. This has the same problem of being hard for someone not familiar with Wikipedia to understand, except that you can click on the QID and it will take you to the Wikidata entry. In this case, clicking on "Geiger 2012" did NOTHING for me except generate mild frustration at not being able to find the said reference.

To illustrate the use of "Cite Q", suppose I want to cite Kahneman's Thinking, Fast and Slow: I start by entering that name into https://www.wikidata.org/. This tells me it's already there with a QID = Q983718. I take that QID to wherever I want to use it and write,. This displays as.

I add ..., which is a comment, so an editor can see what's actually being cited.

If I don't find the item I want in Wikidata, I can create a Wikidata entry for it. It takes me more time to create a Wikidata entry than to complete a citation template in an article, but that's only true if the item is not already in Wikidata.

AND using WikiCite / Wikidata like this has other advantages:
 * If the item is already in Wikidata, it's much quicker to cite it than to complete a standard citation template.
 * A Wikidata entry is more robust to link rot, because if the same resource is cited in multiple places, fixing it once fixes it for all uses. That's not true if the template is completed separately for each use.
 * Similarly, Wikidata entries that are used multiple places are more likely to be more accurate and more complete and therefore more valuable than individual citation templates, because when I look at a Wikidata entry that's already there, I often find a way to improve it.
 * Also, in entering "Author" in Wikidata, I nearly always use a Wikidata entry for that author. Again for an author who is not already in Wikidata, this is more work.  However, when there is more than one person with the same name like James Brown (disambiguation), Wikidata makes it relatively easy to be clear about which "James Brown" is being cited in a particular context.  By contrast, I don't know how to make such distinctions using the more traditional citation templates.

By the way, Mike Peel and Andy Mabbett have offered to make a presentation at Wikimania 2021, August 13-17, on "Automatically maintained citations with Wikidata and Cite Q". This year's Wikimania will be virtual, which means that anyone interested should be able to attend without travel. I've attended Wikimania three times before and WikiConference North America twice, including the virtual conference late last year. I've found them to be quite valuable. For example, I learned what I know about WikiCite mostly from asking questions at Hackathons at previous Wikimanias. DavidMCEddy (talk) 03:55, 19 June 2021 (UTC)
 * This is not really the place to express your opinion of or to discuss perceived benefits or drawbacks of cs1|2 /  / Wikidata.  This is the correct venue if you have an issue with  that needs to be addressed.
 * —Trappist the monk (talk) 10:46, 19 June 2021 (UTC)
 * An off-topic ramble, indeed. I love the assertion that sfn is confusing but Cite Q is somehow easier and better. I especially enjoy that the above example of Cite Q has an author name that would not comply with CITEVAR in most articles, along with an ISBN used as an ASIN, which displays a red error message. The former issue has been discussed at length at the Cite Q talk page. The latter, thank goodness, is subject to 's assertion that Wikidata entries are easy to improve. (BTW, the answer to the implied question in the last bullet is author-link, which is documented at e.g. Template:Cite_book). – Jonesey95 (talk) 13:46, 19 June 2021 (UTC)
 * Yep. A complete waste of byteage. Cite Q indeed, for a litany of errors. ——  Serial  13:56, 19 June 2021 (UTC)

I just want to address the first thing you brought up at the top. I am strongly opposed to the idea of "automatically" fixing a reference like the one above. The citation is bad, and it should remain bad until an editor is able to check the source (by reading the actual source) and make sure that it actually verifies the text. This citation is missing -- it's a citation needed. Automatic fixes should not be applied. CharlesGillingham (talk) 22:24, 27 June 2021 (UTC)

Prefatory signals
Is there a way (or would it be possible to add one) to add prefatory signals to this template? For instance, could a parameter be added that would turn a "Smith 1998, p. 1" citation into "see Smith 1998, p. 1" or "but see Smith 1998, p. 1" citations, to signal citations that add general support, or that, while relevant, go against the trend? --Usernameunique (talk) 04:32, 12 August 2021 (UTC)
 * , the straightforward way to do this at present is with harvnb; i.e. . Wham2001 (talk) 06:48, 12 August 2021 (UTC)

Request for help from Teahouse
Teahouse volunteer here. Anyone know how to help this person? Teahouse TimTempleton (talk) (cont)  22:15, 11 August 2021 (UTC)
 * Hello all, I inquired of the Teahouse about this help. I have just discovered the problem and will address it.  Kind regards,Hu Nhu (talk) 23:31, 11 August 2021 (UTC)
 * Solved - it was a piping issue. Not a template problem. TimTempleton (talk) (cont)  20:53, 12 August 2021 (UTC)

Adding a URL for the page or location with linked text
I'm looking for an equivalent to section-url in the cite templates. Using the technique described in Template:Sfn, e.g.,, the citation displays with external link icons linked to the appropriate location. Is there a way to suppress those icons and instead link directly from the location and page number text? Shmuel (Seymour J.) Metz Username:Chatul (talk) 16:48, 9 December 2020 (UTC)
 * External links, including those linked by chapter-url, are shown with an external link icon to indicate to the reader that they are leaving Wikipedia. It's a feature. Do you have an example of a place where that should be suppressed, and an explanation of why that should happen? – Jonesey95 (talk) 17:24, 9 December 2020 (UTC)
 * Probably not desirable for a consistent appearance, but to answer the question, there is a way to suppress the external link icon using plain link:


 * --Matthiaspaul (talk) 16:44, 14 September 2021 (UTC)

Link rot in sfn
I worry that Wikipedia's various "link rot" tools don't consider the links in, and that many links from point nowhere. (We currently add links to by using the workaround of placing a hand-written direct link in the loc or p parameter.)

So my question is: do the current "link rot" bots consider these kind of handwritten links? If not, then could we:
 * 1) Add url, access-date, archive-date and other relevant parameters to  (preferably using the same code that is used by  and other "CS1" templates).
 * 2) Notify the editors who maintain the various "link rot" bots to implement support for  as well.

Anyone up for this work? I'm afraid it's beyond my technical expertise. CharlesGillingham (talk) 23:04, 7 September 2021 (UTC)
 * Non-working links from sfn and similar templates to full references are tracked via and an error message that is currently hidden by default due to some false positives. There is more information about the tracking at the category page. The proposed parameters do not belong in sfn templates; they belong in the full references to which these templates link. – Jonesey95 (talk) 00:53, 8 September 2021 (UTC)


 * I'm not talking about the internal links, I'm talking about a reference to external URL, such as:  which renders as . There may be several links to different pages of the same book; thus the full citation is not an option for these links.  CharlesGillingham (talk) 01:36, 8 September 2021 (UTC)
 * Oh, I see what you mean. I don't know why link rot scripts and bots would be unable to tag dead links within the p parameter, like this: – Jonesey95 (talk) 02:15, 8 September 2021 (UTC)


 * The answer is not to link to specfic pages in eg Google books or archive.org items but trust that if the item as a whole is listed in the general references that a reader can go to the url and locate the specified page from there.GraemeLeggett (talk) 17:16, 14 September 2021 (UTC)

Add automatic endash for page number range?
Hi there! In Talk:Antoine Ephrem Cartier/GA1, the reviewer asked for an endash in the pages parameter for the sfn templates. The CS1 templates automatically display an endash when a hyphen is used. Could that same functionality be added to sfn?

Examples:

Thanks! GoingBatty (talk) 22:10, 8 September 2021 (UTC)
 * Would that all pagination had the same format. Alas, it doesn't.  Were we to do as you suggest there would likely be smiles all around until someone complained about Module:Footnotes improperly converting the hyphen in a hyphenated page number to an endash.  So then we have to implement the accept-this-as-written markup.  Do we really need this?  Do we  need this?
 * —Trappist the monk (talk) 23:37, 8 September 2021 (UTC)
 * Sure - just as much as we need it in the CS1 templates. To avoid the issue you mentioned, I suggest implementing it in the pages parameter, not the page parameter.  Thanks!  GoingBatty (talk) 01:40, 9 September 2021 (UTC)
 * That does not avoid the issue: 2-1-2-3, 2-31 ff..
 * —Trappist the monk (talk) 11:26, 9 September 2021 (UTC)
 * You are correct! In those edge cases, editors can use the same workaround that's being discussed at Help_talk:Citation_Style_1.  GoingBatty (talk) 12:44, 9 September 2021 (UTC)
 * It might be worth noting that this has been added recently to the r, rp and ran citation templates as well, including support for the accept-this-as-written syntax (only for the plural page parameters pages/pp and quote-pages/qpp (and aliases). See Template_talk:R. --Matthiaspaul (talk) 13:08, 13 September 2021 (UTC)
 * I can see that I've lost this round. It would probably be best to move   from Module:Citation/CS1 to Module:Citation/CS1/Utilities where it can be exported (along with   and  ).  Modules wanting to endashify hyphens then simply  .  That way there is only one copy of   to maintain; now there are at least three...
 * —Trappist the monk (talk) 15:07, 13 September 2021 (UTC)
 * Does this add much runtime? Some articles have hundreds of uses of this template. Kanguole 10:03, 14 September 2021 (UTC)
 * Adds some, certainly. Enough to worry about?  Don't know.  The additional code is only executed when pp or pages is present and has a value.
 * —Trappist the monk (talk) 12:04, 14 September 2021 (UTC)
 * is most useful with either p or pp, so that would be a very common case. Kanguole 12:23, 14 September 2021 (UTC)
 * Of course, but as I said the additional code is only executed when pp or pages is present and has a value but is executed when p or page is the insource-location parameter.  I blanked my sandbox and wrote a simple  template to act as a target and then created 1000  templates:
 * Previewing that and looking at the Parser profiling data I got:
 * Lua time usage	1.462/10.000 seconds
 * Lua memory usage	5,277,646/52,428,800 bytes
 * then I changed pp to p, previewed and got:
 * Lua time usage	1.044/10.000 seconds
 * Lua memory usage	5,285,110/52,428,800 bytes
 * then I changed back to pp, previewed and got:
 * Lua time usage	1.004/10.000 seconds
 * Lua memory usage	5,277,646/52,428,800 bytes
 * Then I changed to, previewed and got:
 * Lua time usage	2.351/10.000 seconds
 * Lua memory usage	5,463,754/52,428,800 bytes
 * Switched to p, previewed and got
 * Lua time usage	2.122/10.000 seconds
 * Lua memory usage	5,428,951/52,428,800 bytes
 * Worst-case in my simple experiment appears to be 400ms so a 400us-per-template penalty.
 * —Trappist the monk (talk) 13:07, 14 September 2021 (UTC)
 * Which, I think, is neglectible for the achieved improvement of usability, appearance, and consistency across citation templates. Thanks for adding it.
 * --Matthiaspaul (talk) 16:20, 14 September 2021 (UTC)
 * :clover: No competition, we're all just striving for the best-possible solution, so we are all winning.
 * Yeah, merging the variants makes a lot of sense to keep things in sync (but the String2 variant already has some minor but important functional changes and an additional parameter for use in the family of r-templates, still, it would be possible to recombine adding a boolean to switch the behaviour).
 * --Matthiaspaul (talk) 16:20, 14 September 2021 (UTC)
 * Are you taking care of your proposed change in CS1 to move its hyphen2dash into Module:Citation/CS1/Utilities so that the freshly forked hyphen2dash function in Module:Footnotes can move back into CS1 after the next round of CS1 updates? Or should I?
 * The modified hyphen2dash function from Module:String2 is so far only used by r/ref and rp. I could take care of making the necessary adjustments for a separate entry point (with the necessary extra parameter) for this into Module:Citation/CS1/Utilities once the CS1 function has moved there.
 * --Matthiaspaul (talk) 12:23, 16 September 2021 (UTC)
 * Moved to Module:Citation/CS1/Utilities/sandbox; removed from Module:Footnotes/sandbox.
 * Moved to Module:Citation/CS1/Utilities/sandbox; removed from Module:Footnotes/sandbox.


 * —Trappist the monk (talk) 20:06, 16 September 2021 (UTC)
 * See also:: Help_talk:Citation_Style_1
 * --Matthiaspaul (talk) 20:19, 25 September 2021 (UTC)

Support for "quote" parameter
As we move from the era of print to web-based everything, page numbers are disappearing, and even "loc" becomes somewhat less useful. "quote" is becoming common for other citation systems, and I would argue it is time that sfn supported it as well. Maury Markowitz (talk) 14:16, 24 November 2021 (UTC)
 * See the archives of this talk page, where advice is repeatedly given on how to house a quotation or other comment within a reference. I have updated the guidance at Template:Sfn to match that repeated advice. – Jonesey95 (talk) 15:54, 24 November 2021 (UTC)
 * The rationale is that the point of sfn is to produce short citations that are merged when they refer to the same location. Including quotes would make a mess of that. Kanguole 16:36, 24 November 2021 (UTC)


 * Ok, but...
 * In the first reply, using loc instead of quote does nothing. It's literally the same result, yet less obvious to the editor. Semantic content is valuable. Am I missing something?
 * I get the basis for the second point, but that seems like tilting at windmills. Making people use some other tag instead of sfn isn't going to make the refs section any shorter, but it will, generally, make the source text harder to read. Yes, sfn can definitely improve the results in the display version, but it also has value in the source as well.
 * Maury Markowitz (talk) 18:25, 29 November 2021 (UTC)

p vs. pp detection
It's really easily to mistakenly do something like, using p instead of pp. Could we make this template so that it's smarter and automatically detects and corrects or warns about instances like this? &#123;{u&#124; Sdkb  }&#125;  talk 07:03, 7 December 2021 (UTC)
 * The documentation does not spell out exactly how to write the page numbers. It does say that the value for pp should be a comma-separated list. So another correct way to write Sdkb's example would be.
 * In the case of the p parameter and a book of over 1000 pages, an editor might write p=1,280 and that would work. Nothing in the documentation forbids it. So distinguishing between two pages in a short work and one page in a long work would be tricky. Tricky behind-the-scenes corrections tend to confuse editors. Jc3s5h (talk) 23:27, 7 December 2021 (UTC)
 * Oh, ack, that's a good point about the page numbers (perhaps my example above is referring to page 147,148 in a really long book lol). I guess that makes this infeasible. &#123;{u&#124; Sdkb  }&#125;  talk 00:18, 8 December 2021 (UTC)

At loc mode
Proposal: sync short refs (including Harvard) with CS1/2 by: I don't know how many RfCs this may need, but it is an idea. 68.173.76.118 (talk) 15:50, 13 February 2022 (UTC)
 * Renaming locn to atn. First by aliasing them
 * Add mode per CS1 to provide field separator choice

Automatically linking page numbers: my sfn dream
I had a dream about sfn. I was hoping someone could tell me how feasible it would be. First, thanks to those who maintain this template—I use it all the time with books, often with many sfn citations to any given volume. This, of course, means that verifying any citation is a multi-click process, first the footnote number to the short footnote to the full citation to the source URL then back to the short footnote (to recall the page number) then back to the source URL to lookup the specific page reference. This could be made a lot shorter by linking the page number in the footnote, which some do, but it is often cumbersome both within the wikitext and to do consistently. The Internet Archive (IA) hosts just about every book I reference (available for checkout in one-hour increments) and is often the best place to link. What if sfn linked to the IA book page number automatically?

Is sfn able to detect the full citation? If so, and it could either see the IA book URL and/or a dedicated IA parameter, then it would be reasonable to automate the linking of any sfn that has a linked IA book id. Eh? czar 06:08, 2 January 2022 (UTC)


 * I do not think that IA covers all the material, although it may include all cited material for individual Wiki articles. A more subtle problem maybe related to scanning. I have encountered errors, mis-scans and missing items several times. I don't know what scan-proofing regime the IA employs. It seems they relegate the proofing to the scan sources (often, scan "farms") themselves. This is not be entirely reassuring, as scan proofig becomes an opaque practice, that one basically has to take on faith, unless one has access to the source in alternate media. Personally I would use IA only when I am certain that the scan is a faithful repro. 68.173.76.118 (talk) 15:43, 13 February 2022 (UTC)
 * I am referring specifically to IA's library uploads, which with rare exception have been fully accurate in my experience. (What matters is the image of the page, not the quality of the OCR automated transliteration, if that's what you mean.) IA lets users link to a specific page (for example), which is perfect for sfn's purposes. This would only cover books that are in IA's (large) repository, so of course it would not cover all cited material in all articles, just the ones that have already linked to the IA upload in its citation. czar  15:54, 13 February 2022 (UTC)


 * I see. I guess the proposal is actionable for such IA sources then. It seems this will require tighter integration (read: added logic) to both CS1 modules and Sfn modules. As for an id, I don't think Wikipedia should be making or synthesizing ad hoc identifiers for other entities' assets. But there is Internet Archive that could be used in CS1 parameter id, to begin with. 68.173.76.118 (talk) 16:12, 13 February 2022 (UTC)

Where to put relative to reflist?
Hi, I'm cleaning up references at oil refinery, and I was just wondering, where do I put the template relative to the template? Under it? Above it? A new section wholly? My temporary solution (i.e. before I publish it) is to put the book links in a new section titled "Bibliography". Cheers X-750 List of articles that I have screwed over 13:15, 20 August 2022 (UTC)
 * Just like any other reference, goes right at the place in the article text that the source supports.
 * —Trappist the monk (talk) 14:22, 20 August 2022 (UTC)
 * I think it's my fault for not clarifying, but I meant the actual citation itself, i.e. the thingy. I know where the sfn tag itself goes, just wondering where the citation it links to should be. Apologies for not being clear on that. X-750 List of articles that I have screwed over 22:25, 20 August 2022 (UTC)
 * There is a script: User:Trappist the monk/HarvErrors.js. The script has a doc page (such as it is...).  The script has a testcases page that illustrates how I think short-form and long-form citations should be placed.
 * You might find the script handy if you are doing much with /  et al.
 * —Trappist the monk (talk) 22:43, 20 August 2022 (UTC)
 * See MOS:REFERENCES and WP:CITESHORT. If you are using short footnotes and separate full citations, they usually go either in two separate sections (e.g. "Notes" and "References") or in two subsections of the "References" section (which could be named e.g. "Notes" and "Works cited"). The section with the full citations should go after the section with the footnotes. —David Eppstein (talk) 23:44, 20 August 2022 (UTC)
 * See MOS:REFERENCES and WP:CITESHORT. If you are using short footnotes and separate full citations, they usually go either in two separate sections (e.g. "Notes" and "References") or in two subsections of the "References" section (which could be named e.g. "Notes" and "Works cited"). The section with the full citations should go after the section with the footnotes. —David Eppstein (talk) 23:44, 20 August 2022 (UTC)

Square brackets around year?
A request that I suspect is somewhat complicated, but nevertheless, I ask: with would it be possible to have a version where the parentheses are rendered as square brackets? ie [2022] instead of (2022). The reason being that the High Court of Australia uses square brackets in citations to indicate the year of a decision: eg Dietrich v The Queen [1992] HCA 57. Regards, Goldsztajn (talk) 10:41, 18 October 2022 (UTC)