Jump to content

Template talk:Sfn

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
(Redirected from Template talk:Sfn/testcases)

Special characters

[edit]

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

{{sfn|Bernard Safran: Paintings – safran-arts}}

Generates a link to

CITEREFBernard_Safran:_Paintings_%E2%80%93_safran-arts

but

{{harvid|Bernard Safran: Paintings – safran-arts}}

generates

CITEREFBernard_Safran:_Paintings_–_safran-arts

The effect is[1]

CITEREFBernard_Safran:_Paintings_–_safran-arts

Aymatth2 (talk) 14:42, 20 November 2023 (UTC)[reply]

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}}
"Bernard Safran: Paintings", safran-arts.com, retrieved 5 June 2017
Where is the error?
Trappist the monk (talk) 15:02, 20 November 2023 (UTC)[reply]
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.
Trappist the monk (talk) 17:59, 23 November 2023 (UTC).[reply]

That did it. Duh. Thanks. Aymatth2 (talk) 21:45, 23 November 2023 (UTC)[reply]

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:

{{urlencode:CITEREFBernard_Safran:_Paintings_–_safran-arts}} → CITEREFBernard_Safran%3A_Paintings_%E2%80%93_safran-arts
{{anchorencode:CITEREFBernard_Safran:_Paintings_–_safran-arts}} → CITEREFBernard_Safran:_Paintings_–_safran-arts

Trappist the monk (talk) 20:10, 29 November 2023 (UTC)[reply]

Mobile view sees a citation error; desktop view sees no problem. Eh???

[edit]

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.
Trappist the monk (talk) 15:33, 12 April 2024 (UTC)[reply]
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]

How to use it for Proceedings

[edit]

Proceedings are collection of works published by academic institutions, museums, etc. They usually have one or more high-profil scholars as editors, who may or may not participate with their own work included into collection. Other authors, whose number can vary (few to few dozens), write a chapter with a unique title each (sometimes one author can contribute two or more chapters on different subject) on different, but subjects related to the field, say, history of some heretical order. So, now we have a book as a collection of chapters written by different authors, chapters have unique titles, collection is edited by one or more persons who contributed or not something. So, this is not the same thing as multiple authors of one paper in journal.

Is it possible to cite such book with sfn, and if so, how?
Imagine that you need to use few chapters in your wiki article but they should be used with separate footnote - every chapter has its title and writer, and the only common thing is the main title of the collection, date of publishing and an editor(s).

Example of one such Proceedings can be observed here: Zbornik radova - it is a first 11 pages with usual information and most importantly you can check Content ౪ Santa ౪99° 14:07, 6 February 2024 (UTC)[reply]

Perhaps like this:
* {{cite book |editor-last=Šanjek |editor-first=Franjo |date=2005 |title=Fenomen "Krstjani" u Srednjovjekovnoj Bosni i Humu: Zbornik Radova |location=Sarajevo |publisher=Institut za istoriju u Sarajevu |isbn=((9985-9642-5-2)) |language=hr}}
** {{harvc |last=Ančić |first=Mladen |c=Bosanska Banovina i Njezino Okruženje u Prvoj Polovici 13. Stoljeća |in=Šanjek |year=2005 |pages=11–26}}
** {{harvc |last=Neralić |first=Jadranka |c=Srednjovjekovna Bosna u Diplomatičkim Spisima Rimske Kurije |in=Šanjek |year=2005 |pages=371–386}}
** {{harvc |last=Šanjek |first=Franjo  |c=Papa Inocent III. (1198.-1216.) i Bosansko-Humski Krstjani |in=Šanjek |year=2005 |pages=425–440 |id={{sfnref|Šanjek in Šanjek|2005}}}}
The above goes in §Bibliography. The short form references (in this example {{harvnb}} because simpler) point to the {{harvc}} templates which, in turn, point to the {{cite book}} template. Here are the {{harvnb}} templates:
{{harvnb|Ančić|2005|p=20}}Ančić 2005, p. 20
{{harvnb|Neralić|2005|p=380}}Neralić 2005, p. 380
{{harvnb|Šanjek|2005|p=430|ref={{sfnref|Šanjek in Šanjek|2005}}}}Šanjek 2005, p. 430
and here is the §Bibliography section:
  • Šanjek, Franjo, ed. (2005). Fenomen "Krstjani" u Srednjovjekovnoj Bosni i Humu: Zbornik Radova (in Croatian). Sarajevo: Institut za istoriju u Sarajevu. ISBN 9985-9642-5-2.{{cite book}}: CS1 maint: ignored ISBN errors (link)
    • Ančić, Mladen. "Bosanska Banovina i Njezino Okruženje u Prvoj Polovici 13. Stoljeća". In Šanjek (2005), pp. 11–26.
    • Neralić, Jadranka. "Srednjovjekovna Bosna u Diplomatičkim Spisima Rimske Kurije". In Šanjek (2005), pp. 371–386.
    • Šanjek, Franjo. "Papa Inocent III. (1198.-1216.) i Bosansko-Humski Krstjani". In Šanjek (2005), pp. 425–440.
Note the unique construction of the Šanjek {{harvnb}} and {{harvc}} templates; this to avoid circular or improper links between the templates – {{cite book}} uses CITEREFŠanjek2005 so {{harvc}} must not also use that CITREF id.
Trappist the monk (talk) 15:28, 6 February 2024 (UTC)[reply]
Thanks, this looks more than promising, I am going to try how it works. @Trappist the monk, I really appreciate this, as it was always huge problem for me - I am using that kind of literature constantly (Proceedings, Yearbooks, Contributions, Collections, and similar) and it gets tiresome using RefToolbar (reflist with <ref> markup) in this case. Thanks. ౪ Santa ౪99° 17:19, 6 February 2024 (UTC)[reply]
It works like a charm @Trappist the monk, and I thank you again so much, however, is there a way to get just a footnote number inline like "[56]", which sends → "Ančić 2005, p. 20" in References-reflist, and from there "Ančić 2005, p. 20" → Biblio. "Ančić, Mladen. "Bosanska Banovina i Njezino Okruženje u Prvoj Polovici 13. Stoljeća". In Šanjek (2005), pp. 11–26."? I just replaced "harvnb" with "sfn" and it works perfectly - thank you. --౪ Santa ౪99° 17:51, 6 February 2024 (UTC)[reply]

Issue with ps and pp being used together

[edit]

There seems to be an issue with {{sfn}} when using the |ps and |pp parameters together. By default, in using both, you end up with two sentences without a space between them (see the Lindskoog example below). Some editors have tried to fix this by adding an extra |loc={{sp}} parameter, but then this gives you a comma you probably didn't intend. The comma either trails at the end of a sentence when you don't have a |ps parameter (pp. 18–19 example), or else separates two sentences when you do, instead of them being separated by a period (Gormley).

Also, when you have two {{sfn}} templates with the same |pp parameter but different |ps parameters, the engine renders them as the same citation, so the version with the |ps becomes unreadable (see the James Russell example).

Markup Renders as
The book<ref>{{cite book|title=The Lion, the Witch and the Wardrobe|p=24|year=1950|last=Lewis|first=C. S.}}</ref> explores{{sfn|Lewis|1950|pp=18–19|loc={{sp}}}} the themes of lions,{{sfn|Lewis|1950|pp=18–19|loc={{sp}}|ps=This is explored further by James Russell.}} witches{{sfn|Lewis|1950|pp=32–33|ps=This is explored further by Kathryn Lindskoog.}} and wardrobes.{{sfn|Lewis|1950|pp=64–66|loc={{sp}}|ps=This is explored further by Beatrice Gormley.}}
== Notes ==
{{reflist-talk}}

The book[1] explores[2] the themes of lions,[2] witches[3] and wardrobes.[4]

Notes

References

  1. ^ Lewis, C. S. (1950). The Lion, the Witch and the Wardrobe. p. 24.
  2. ^ a b Lewis 1950, pp. 18–19, . Cite error: The named reference "FOOTNOTELewis195018–19 " was defined multiple times with different content (see the help page).
  3. ^ Lewis 1950, pp. 32–33This is explored further by Kathryn Lindskoog.
  4. ^ Lewis 1950, pp. 64–66, This is explored further by Beatrice Gormley.

I would suggest that the preferred rendering should be:

  1. Lewis 1950, pp. 18–19.
  2. Lewis 1950, pp. 18–19. This is explored further by James Russell.
  3. Lewis 1950, pp. 32–33. This is explored further by Kathryn Lindskoog.
  4. Lewis 1950, pp. 64–66. This is explored further by Beatrice Gormley.

It Is Me Here (talk) 16:20, 15 March 2024 (UTC)[reply]

Like |postscript= in the cs1|2 templates, the purpose of |ps= and |postscript= in {{sfn}} and related templates is to control the rendering of terminal punctuation; a single character: a dot, a comma, a semicolon, etc.
You would be better served to write:
...explores{{sfn|Lewis|1950|pp=18–19}}...lions,<ref>{{harvnb|Lewis|1950|pp=18–19|ps=.}} This is explored further by James Russell.</ref>...
...explores[1]...lions,[2]...

References

  1. ^ Lewis 1950, pp. 18–19.
  2. ^ Lewis 1950, pp. 18–19. This is explored further by James Russell.
Trappist the monk (talk) 17:29, 15 March 2024 (UTC)[reply]

Timestamp parameter for videos

[edit]

@Trappist the monk: Would it be possible to add a parameter to the template which functions similarly to |p=, but instead marks a timestamp to make it easier to use Template:Cite AV media as reference? Antiquistik (talk) 17:39, 10 April 2024 (UTC)[reply]

You can use |loc= instead of |p=, it's for in-source location when |p= and |pp= are inappropriate. -- LCU ActivelyDisinterested «@» °∆t° 17:55, 10 April 2024 (UTC)[reply]
Or the obvious parameters |time= or |minutes=. -- Michael Bednarek (talk) 01:40, 11 April 2024 (UTC)[reply]
I'm confused unlike |loc=, which is available and used for this purpose, |time= and |minutes= don't work with {{sfn}} -- LCU ActivelyDisinterested «@» °∆t° 10:52, 11 April 2024 (UTC)[reply]

Confusion reigns. This is the talk page for {{sfn}} however the OP asked about {{Cite AV media}}. ActivelyDisinterested replied in the spirit of SFN whereas Michael answered correctly for AV media, which is why AD can't find the parameters in SFN! Martin of Sheffield (talk) 11:33, 11 April 2024 (UTC)[reply]

Ah I see the confusion, I took Would it be possible to add a parameter to the template as meaning this template, and that the OP meant Cite AV Media as reference to mean the cite that SFN is linking to. -- LCU ActivelyDisinterested «@» °∆t° 11:56, 11 April 2024 (UTC)[reply]
The OP wanted to do short references to particular timestamps in a video cited with {{Cite AV media}}, so |loc= is indeed the answer. Kanguole 13:50, 11 April 2024 (UTC)[reply]

Cite court

[edit]

Can this be used with {{Cite court}}?--SRuizR ¡Pure life! 20:50, 28 April 2024 (UTC)[reply]

Yes you just have to setup the |ref= field as described in the Template:Cite court documentation. -- LCU ActivelyDisinterested «@» °∆t° 21:23, 28 April 2024 (UTC)[reply]
Oh, I didn't see that. Thanks.--SRuizR ¡Pure life! 21:44, 28 April 2024 (UTC)[reply]

 You are invited to join the discussion at Module talk:Footnotes § loc, at. Rjjiii (talk) 02:42, 4 May 2024 (UTC)[reply]

Error when using "ps" parameter and no "ps" for the same page

[edit]

Hello, in Madam La Compt there is the following message: "Cite error: The named reference "FOOTNOTEMcDermott1949128" was defined multiple times with different content (see the help page)."

There are some {{sfn|McDermott|1949|p=128}} and one {{sfn|McDermott|1949|p=128|ps=. Note 100.}}

Do you know how I can get rid of the error? Thanks so much!–CaroleHenson (talk) 15:34, 21 May 2024 (UTC)[reply]

As a short-term solution I added another copy of the source and |ref={{harvid|McDermott (note)|1958}}</nowki> and <nowiki>{{sfn|McDermott (note)|1949|p=128}}–CaroleHenson (talk) 15:43, 21 May 2024 (UTC)[reply]
You can express what you're after with {{sfn|McDermott|1949|p=128|loc=Note 100}}. Kanguole 15:48, 21 May 2024 (UTC)[reply]
Excellent, thanks, Kanguole!–CaroleHenson (talk) 16:48, 21 May 2024 (UTC)[reply]
@CaroleHenson: This is a misuse of |ps=, and is explicitly cautioned against at Template:Sfn#Adding additional comments or quotes. --Redrose64 🌹 (talk) 21:14, 21 May 2024 (UTC)[reply]
As fixed by Kanguole and communicated here.–CaroleHenson (talk) 23:32, 21 May 2024 (UTC)[reply]

work with Template:Cite Q?

[edit]
one conversation in one place

Hello: Could someone please modify either template:cite Q or template:sfn so they work properly together by default?

See recent edits to Gwendolyn Grant (activist) for examples of the problem.

Thanks, DavidMCEddy (talk) 21:54, 5 July 2024 (UTC)[reply]

Sfn templates work by matching to the details in the source text of the cite (kind of that's just the simple way of putting it), as Cite Q has no author or year details in source text a false positive error will always occur. It's an issue that has been raised on the Cite Q template talkpage a few times. Until it is fixed you can add dummy duplicates of the missing text details to the cite, or use {{sfn whitelist}} to suppress the false positive error messages. -- LCU ActivelyDisinterested «@» °∆t° 22:21, 5 July 2024 (UTC)[reply]
Thanks. I've tried assigning "CNN Newsource" to different properties in Wikidata, so far without suppressing "{{cite journal}}: |author= has generic name (help)" from:
Can {{tl|sfn whitelist}} suppress this complaint? If so, how? (I've tried a couple of things, so far without success.)
Thanks again, DavidMCEddy (talk) 23:53, 5 July 2024 (UTC)[reply]
No, sfn whitelist is unrelated; it suppresses the harv linking errors that you always get with sfn+cite Q. Your problem is badly formatted metadata that squeezes the information from the citation into the wrong parameters. The citation should probably have publisher=KMIZ and agency=CNN Newsource. I suspect there is a mismatch between how wikidata represents reference metadata and how the citation templates expect to see it, causing cite Q to try to hammer round pegs into square holes. I don't know enough about how cite Q works to persuade it to format the citation correctly. Why not just use {{cite news}} and fill in the metadata locally? —David Eppstein (talk) 00:04, 6 July 2024 (UTC)[reply]

Why is this discussion happening in twop places. Don't do that. Continue at Template talk:Cite Q.

Trappist the monk (talk) 00:07, 6 July 2024 (UTC)[reply]


Why is this not working?

[edit]

I have this

{{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=9781560974031 |ref={{SfnRef|Von Bernewitz |Geissman |2000}} }}

, and this

{{SfnRef|Von Bernewitz |Geissman |2000}}

Why is this giving me code errors?Blue Pumpkin Pie (talk) 21:20, 18 July 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]
(edit conflict)
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}}}}
Von Bernewitz, Fred; Geissman, Grant (2000). Tales of Terror: The EC Companion. Timonium, Maryland, and Seattle, Washington: Gemstone Publishing and Fantagraphics Books. ISBN 978-1-56097-403-1.
Trappist the monk (talk) 21:30, 18 July 2024 (UTC)[reply]

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]

Edit request 29 July 2024

[edit]

Description of suggested change: Shouldn't the See Also example text be an un-ordered list?

Diff:

==See also== [[Ipso facto]]
+
==See also== *[[Ipso facto]]

Dough34 (talk) 21:23, 29 July 2024 (UTC)[reply]

Not done. The template documentation is not protected. If you know how to make the template documentation better, please do so.
Trappist the monk (talk) 21:36, 29 July 2024 (UTC)[reply]

References

  1. ^ Smith 2018, p. 2
  2. ^ Smith 2018, p. 2

What to do with hyphenated, "non-Latin" surname?

[edit]

I'm having an error pop up due to a hyphenated surname... How can I correct this? Thanks. ~ HAL333 16:46, 2 September 2024 (UTC)[reply]

Where? Always give real life examples of problems so that we don't have to hunt for whatever it is that you are talking about.
If this is about this reference (permalink), that has nothing to do with {{sfn}}. Where did you get the idea that it did?
Trappist the monk (talk) 17:05, 2 September 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. Kanguole 17:09, 2 September 2024 (UTC)[reply]
Sorry for the imbecility. Thanks! ~ HAL333 17:21, 2 September 2024 (UTC)[reply]

Using undated, single author work

[edit]

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):
{{harvp|Green|n.d.}}Green (n.d.)
and the target:
{{cite book |title=Title |last=Green |first=EB |date=n.d.}}
Green, EB (n.d.). Title.
Trappist the monk (talk) 17:06, 2 October 2024 (UTC)[reply]
Sorry, let me provide an examples from the page where I'm having the issue (Viking metal)
{{harvp|Rivadavia|n.d.(a)}}Rivadavia & n.d.(a)
{{harvp|Rivadavia|n.d.(b)}}Rivadavia & n.d.(b)
<ref>{{harvp|Huey|n.d.(a)}}; {{harvp|von Helden|2010|p=257}}</ref>[1]
Targets:
{{cite web |ref={{SfnRef|Rivadavia|n.d.(a)}} |first=Eduardo |last=Rivadavia |url=http://www.allmusic.com/album/stronger-than-evil-mw0000997320 |title=Stronger Than Evil |website=AllMusic |access-date=August 21, 2015 }}
{{cite web |ref={{SfnRef|Rivadavia|n.d.(b)}} |first=Eduardo |last=Rivadavia |url=http://www.allmusic.com/album/blood-fire-death-mw0000171761 |title=Blood Fire Death |website=AllMusic |access-date=March 27, 2008 }}
{{cite web |ref={{SfnRef|Huey|n.d.(a)}} |last=Huey |first=Steve |url=http://www.allmusic.com/album/marching-out-mw0000650446 |title=Marching Out |website=AllMusic |access-date=August 21, 2015 }}
{{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 }}
--3family6 (Talk to me | See what I have done) 17:40, 2 October 2024 (UTC)[reply]
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.
Trappist the monk (talk) 17:55, 2 October 2024 (UTC)[reply]
Thank you! I'd been trying to discover the solution for awhile! (and I already fixed von Helden)--3family6 (Talk to me | See what I have done) 17:59, 2 October 2024 (UTC)[reply]

References

Making whitelisting simpler and more efficient

[edit]

 You are invited to join the discussion at Module talk:Footnotes § Making whitelisting simpler and more efficient. — hike395 (talk) 17:42, 28 November 2024 (UTC)[reply]