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.
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
{{sfn}} and {{harvid}} seem to be out of sync on handling special characters. See Collective work for several examples that now show up as redlinks. Thus
Are you sure? I'm not seeing any errors in Collective work. In your examples above, you don't include a target, so here is the target from Collective work:
{{citation|ref={{harvid|Bernard Safran: Paintings – safran-arts}}|title=Bernard Safran: Paintings|work=safran-arts.com |url=http://www.safran-arts.com/index.html|access-date=5 June 2017}}
I don't see that sfn generating a link with an url encoded dash, the way you have it. Rather, it generates a link to #CITEREFBernard_Safran:_Paintings_–_safran-arts. If you are referring to footnote 1 in the top image caption, it links to the short footnote, which links to the full citation, so everything looks fine and I see no error here. Mathglot (talk) 05:28, 21 November 2023 (UTC)[reply]
There is something odd going on. I do not see the problem on my laptop, but see the screenshot to the side which I just took on my phone, which I think is up to date Android/Chrome. Aymatth2 (talk) 17:41, 23 November 2023 (UTC)[reply]
That error message is not caused by {{sfn}} but rather is caused by User:Ucucha/HarvErrors.js at User:Aymatth2/common.js#L-1 in your common.js page. Remove that line from your common.js and then refresh the page in the screen-cap. The error message should go away. If it does, try a different harv error script or report the error to Editor Ucucha.
The discussion above is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Follow up: I wonder if the problem described above is the same problem that is described at phab:T348928 where MediaWiki is incorrectly url-encoding the short-form link when it should be anchor-encoding the link:
It gets worse. Since when has é been a "special character"? (A rhetorical question! before someone comes back with "1247" .)
At Lunar month, citation 8 gets an error
Chapront-Touzé & Chapront (1988). Harv error: link from CITEREFChapront-Touz%C3%A9Chapront1988 doesn't point to any citation
but the cited source is certainly there. Exactly the same article read on desktop view sees no problem and [8] resolves as expected. It does not compute, Captain. --𝕁𝕄𝔽 (talk) 14:31, 12 April 2024 (UTC)[reply]
This is exactly the issue described (and apparently ignored) at phab:T348928.
'é' (U+00E9: Latin small letter e with acute) is not a 'special character' per se, but is a multibyte character. When rendering the html for the different views, MediaWiki differently encodes fragment wikilinks: anchor encoding for desktop view, uri encoding for mobile view. This is not something that can be fixed here.
Even though it can't be fixed here, I thought it worth putting it on the record for future archive searches. 𝕁𝕄𝔽 (talk) 17:33, 12 April 2024 (UTC)[reply]
The second instance of SfnRef is not the correct template to use, it should just be Sfn. The first instance seems like it should work to creat an anchor that the Sfn template can link to, but I also think it is unnecessary. The cite book template should be able to create the template by itself because there is nothing unusual about the citation. Jc3s5h (talk) 21:27, 18 July 2024 (UTC)[reply]
Where? Are you getting errors because you mistakenly used {{sfnref}} when you should have used {{sfn}}?
In your examples, the {{cite book}} template emits a CS1 maint: ref duplicates default message because {{SfnRef|Von Bernewitz |Geissman |2000}} produces exactly the same CITEREF anchor ID as the {{cite book}} template does for itself. The {{cite book}} template should be rewritten:
{{cite book|first1=Fred |last1=Von Bernewitz |first2=Grant |last2=Geissman |title=Tales of Terror: The EC Companion |publisher=[[Gemstone Publishing]] and [[Fantagraphics Books]]|location=[[Timonium, Maryland]], and [[Seattle, Washington]]|date=2000 |isbn={{format ISBN|9781560974031}}}}
Thank you for the advice. I didn't know that judging based on the documentation, I thought I had to use SfnRef because there's more than one author. But that helps me out a lot. thank you.Blue Pumpkin Pie (talk) 00:49, 19 July 2024 (UTC)[reply]
This has to do with the cite templates rather than {{sfn}}, but the solution is to use the plain hyphen-minus (U+002D) instead of U+2010. Kanguole17:09, 2 September 2024 (UTC)[reply]
Is this the correct template to use for an undated, single-author work? If not, which template do I use? There's an issue where using the template with "n.d." for not dated lists that as a second author. The other issue is that multiple different sources from the same author are used.--3family6 (Talk to me | See what I have done) 16:37, 2 October 2024 (UTC)[reply]
Are you sure? Always good to give real life examples when something that you think should work doesn't. I think it works so I have contrived a test (using {{harvp}} for clarity and simplicity; {{sfnp}} renders the same format):
{{cite book|last=von Helden |first=Imke |year=2010 |editor-last=Scott |editor-first=Niall W.R. |url=http://www.inter-disciplinary.net/wp-content/uploads/2010/04/mmp1ever1290310.pdf |archive-url=https://web.archive.org/web/20141028202550/http://www.inter-disciplinary.net/wp-content/uploads/2010/04/mmp1ever1290310.pdf |url-status=dead |archive-date=2014-10-28 |chapter=Barbarians and Literature: Viking Metal and its Links to Old Norse Mythology |title=The Metal Void |pages=257–263 |location=Oxford |isbn=978-1-904710-87-5 }} →
Rivadavia, Eduardo. "Blood Fire Death". AllMusic. Retrieved March 27, 2008.
Huey, Steve. "Marching Out". AllMusic. Retrieved August 21, 2015.
von Helden, Imke (2010). "Barbarians and Literature: Viking Metal and its Links to Old Norse Mythology". In Scott, Niall W.R. (ed.). The Metal Void(PDF). Oxford. pp. 257–263. ISBN978-1-904710-87-5. Archived from the original(PDF) on 2014-10-28.{{cite book}}: CS1 maint: location missing publisher (link)
Remove the parentheses from n.d.(a). {{sfn}} expects the CITEREF disambiguation letter in the same format for n.d. that it expects for a numerical year: 2024a so n.d.a.
Fixed your von Helden reference; its a book not a journal.
Lua error in Module:Footnotes/anchor_id_list at line 841: Template list not yet created.
Hi all, anyone know what this message means? I can't see that I'm using sfns any different to earlier occasions (indeed, I always C&P the format from a previous article deliberately!) In source edit mode everything's fine, but in VE you get... this. Bizarre. Any help appreciated! SerialNumber54129A New Face in Hell18:50, 13 January 2025 (UTC)[reply]
Sorry for all the pings! I've saved it to SB, weirdly now there's no problem editing in VE, no red ink. Basically it only seems to appear when it's an unsaved page in VE? But that's something new to me if so, I must say. SerialNumber54129A New Face in Hell19:21, 13 January 2025 (UTC)[reply]
Editor User:Hike395 recently made significant changes to Module:Footnotes/anchor id list so I think that the responsibility for repair lies there. I expect that the 'new' code relies on content actually existing. When previewing content written using the source editor, Module:Footnotes/anchor id list is able to fetch the wikitext content. There is no content when 'previewing' with that abomination that is VE. I am not aware of any similar errors occuring with the older module code.
Thanks Trappist... I assume that's why there's now no drop down links available either. (By the way, I tend to agree with you re the abomination, but it's quite handy when I'm in the final stages of copy-editing—it makes it easier to see through the code.) I'm sure User:Hike395's significant changes are a significant improvement, somewhere. Thanks for your help, both, even if there's not much I can do about it! SerialNumber54129A New Face in Hell20:24, 13 January 2025 (UTC)[reply]
I don't know what you mean by drop down links; {{sfn}} and the Module:Footnotes do not control or provide any 'dropdowns' whatever they might be.
No links@Trappist the monk: well, of course, I don't know the proper name for the phenomena, and you never use it anyway, so of course you wouldn't. I meant, see image, that when you typed something in to link in VE, a drop down of available pages would appear to choose from. SerialNumber54129A New Face in Hell20:56, 13 January 2025 (UTC)[reply]
I can confirm this is an error message that I added. In theory, it should never occur, but clearly Visual Editor does something very odd. I will attempt a fix. — hike395 (talk) 23:51, 13 January 2025 (UTC)[reply]
You must be looking at an sfn that is different from the one I'm looking at. For this {{sfn|Smith|1999|p=1}}[1] I don't see a comma between Smith and 1999.
References
^Smith 1999, p. 1. sfn error: no target: CITEREFSmith1999 (help)
Real life example where you as seeing Smith, 1999, p.1?
I interpret the original post to mean the template currently does not put a comma between Smith and 1999, but Fortuna imperatrix mundi wants it to. I'd ask the original poster to explain why it's a good idea to change the standard behaviour. Jc3s5h (talk) 15:06, 29 May 2025 (UTC)[reply]
Sigh. Yep, when the age is in, the wit is out... stricken.
No worries Trappist! I know wot you mean, Jc3s5h, but I'm sure I've seen it done somewhere (a bit like the possibility to indent the bibliog, or use '&' instead of 'and', etc.) If it isn't so far possible, would it be difficult to add the facility? It's a not uncommon form, e.g. the APA stylemandates it. —Fortuna, imperatrix15:27, 29 May 2025 (UTC)[reply]
I'd say that Citation Style 1 and Citation Style 2 are styles, they're not just a set of tools to imitate some other style. Citation styles are all about making arbitrary choices so all the citations look similar. So I'd say, stick with this arbitrary choice rather than making it messier by allowing two different appearances. Jc3s5h (talk) 16:17, 29 May 2025 (UTC)[reply]
Am I doing something wrong in Lycosa tarantula? I have installed .mw-parser-output .cs1-maint, .mw-parser-output .cs1-hidden-error, .mw-parser-output .harv-error in my css and get this error Harv error: linked from CITEREFFoelix2010.-- Carnby (talk) 19:40, 30 May 2025 (UTC)[reply]
This is telling you that sources that are used for referencing shouldn't be in the 'Further reading' section. You can put the cite in a separate 'Sources' section, or just ignore the message. -- LCU ActivelyDisinterested«@» °∆t°20:20, 30 May 2025 (UTC)[reply]
Hello. I assume there is a reason I can't use Sfn/harvc to call upon a book if the editor and chapter is the same – is this something that could be fixed? It's not a very uncommon use case – editors frequently write introductions or chapters for their books in nonfiction.
For example: This article uses Sfn for everything else, but has to manually override reference [38].
I've encountered this issue with A Game of Thrones (citing Lowder's introduction in the book Lowder edited).
I tried manually overriding the chapter reference with ref={{harvid|Lowder Introduction|2012}} and it didn't work.
I might not be posting this at the right place but help would be appreciated. — ImaginesTigers (talk) 14:30, 8 July 2025 (UTC)[reply]
ImaginesTigers treats Sfn and Harvc as if they are the same, but the documentation indicates they are not. Both examples use Harvc, not Sfn. Since I've never used Harvc, I don't plan to look into this further. Jc3s5h (talk) 15:20, 8 July 2025 (UTC)[reply]
Jc3s5h responds unhelpfully, but others have not. Both other respondents provided helpful, actionable advice. Since the situation is resolved, I don't need to engage further. — ImaginesTigers (talk) 12:26, 10 July 2025 (UTC)[reply]
You've set the anchor for the chapter as "Lowder introduction", the harvc template uses |id= where other templates use |ref=. Try setting |id={{harvid|Lowder Introduction|2012}}. -- LCU ActivelyDisinterested«@» °∆t°15:20, 8 July 2025 (UTC)[reply]
Hi @ActivelyDisinterested: Really sorry for the delay – I don't have this page watchlisted. Thank you for the response. I am indeed talking about A Game of Thrones. I define chapters-within-books using the Harvc template and then (normally) use Sfn to call on them. Let me quickly change the reference in question here so I can demonstrate the error I run into. Sorry again about the delay and thank you for the advice. — ImaginesTigers (talk) 12:18, 10 July 2025 (UTC)[reply]
@ActivelyDisinterested: I've reintroduced the error with these edits to show you. If I remove the chapter that cites Lowder in Lowder's book, all of the others work normally and can be called using Sfn. For this one, it doesn't work and I don't understand what I'm doing wrong. — ImaginesTigers (talk) 12:21, 10 July 2025 (UTC)[reply]
{{sfn|Wilcox|2015|p=89|ref={{sfnref|Wilcox in Wilcox}}}}
and
{{harvc|last=Wilcox|first=Claire|in=Wilcox|chapter=Plato's Atlantis: Anatomy of a Collection|pages=83–103|id={{sfnref|Wilcox in Wilcox}}|year=2015|author-link=Claire Wilcox}}
Update: What I'd done was include the year twice. That's been removed from the sfnref and works beautifully now. Thank you - you gave me enough info to work out what I'd messed up — ImaginesTigers (talk) 12:40, 10 July 2025 (UTC)[reply]
Ooohh works for me as well. Trappist, may your crops be bountiful and your pillow always be cool on both sides :) ♠PMC♠ (talk)18:21, 10 July 2025 (UTC)[reply]
That would be inappropriate for OP's examples. |contributorn= and |contribution= are defined for citing a contribution from a contributor to an author's book. For example, Quindlen's introduction to Austen's Pride and Prejudice:
{{cite book|contributor-last=Quindlen |contributor-first=Anna |contributor-link=Anna Quindlen |contribution=Introduction |last=Austen |first=Jane |title=Pride and Prejudice |location=New York |publisher=Modern Library |year=1995 |page=vii |isbn=978-0-679-60168-5 |url=https://archive.org/details/northangerabbeyb00aust_1 }}
In the Wilcox example above, Wilcox is the author of "Plato's Atlantis: Anatomy of a Collection", a chapter or section in the book Alexander McQueen for which Wilcox is the named editor. Wilcox is not the author of Alexander McQueen.