Help talk:Footnotes

Latest comment: 4 hours ago by Rjjiii in topic Tag or template preference

Interfering note lists

edit

Is there a way to use groups to prevent note lists used only for an infobox from interfering with other note lists used elsewhere in an article? For instance, here, the note "lr note" should be appearing in the "notelist-lr" section, not in the infobox. (Courtesy pinging @Bsherr, as this relates to your change.) Sdkbtalk 20:12, 24 April 2024 (UTC)Reply

Yes, you could use markup and a unique group name instead of the efn-lr template. See WP:REFGROUP --Bsherr (talk) 20:20, 24 April 2024 (UTC)Reply
There are several forms of {{efn}}, not just {{efn-lr}}; each one has a matching notelist. --Redrose64 🌹 (talk) 20:30, 24 April 2024 (UTC)Reply
I tried that here, but I didn't see it working in the preview of my sandbox and don't see it working live either. Sdkbtalk 20:35, 24 April 2024 (UTC)Reply
@Sdkb: Don't use a manual group, use one of the predefined forms as I advised. --Redrose64 🌹 (talk) 20:48, 24 April 2024 (UTC)Reply
The issue is that an article could be using any of the existing predefined forms, so they would all potentially interfere. We also want to keep the lower roman formatting without a visual change. Sdkbtalk 21:03, 24 April 2024 (UTC)Reply
Your problem at Template:Infobox U.S. college admissions is because neither template accepts a |group= parameter. At User:Sdkb/sandbox/early drafts, change
blah more blah.{{efn-lr|lr note}}
to
blah more blah.{{efn-ur|ur note}}
and
==Notelist-lr==
{{notelist-lr}}
to
==Notelist-ur==
{{notelist-ur}}
This will not then conflict. --Redrose64 🌹 (talk) 21:50, 24 April 2024 (UTC)Reply
I think Sdkb point is that they want to use {{efn-lr}} style notes, and include a {{notelist-lr}} in the infobox, but not catch Cite error: There are <ref> tags on this page without content in them (see the help page). notes from outside the infobox in that notelist. If they use {{efn-ua}} they would not want to catch {{efn-ua}} notes from outside the infobox. I don't believe there's anyway of doing this with the currently available options. -- LCU ActivelyDisinterested «@» °∆t° 22:16, 24 April 2024 (UTC)Reply
Yes, that's correct, Actively. Too bad there isn't currently a solution — is there a Phabricator ticket or some other technical project that might offer one? Sdkbtalk 01:38, 25 April 2024 (UTC)Reply
In the meantime, @Bsherr, I wonder if we should just go back to the manual footnotes to avoid the possibility of conflicts? Sdkbtalk 01:42, 25 April 2024 (UTC)Reply
This was brought up at Template talk:Notelist#The group= parameter is not working as documented about six years ago, notelist doesn't use group in the same way as {{reflist}}. So it can't be used in the way you want to use it. -- LCU ActivelyDisinterested «@» °∆t° 22:23, 24 April 2024 (UTC)Reply
EFN only works with the predefined groups. Instead, you can use Reflist or the magic word. Alternatively, we can just remove the notelist from the template and put it at the bottom of each article, integrated with any other explanatory footnotes. --Bsherr (talk) 03:36, 25 April 2024 (UTC)Reply
Or in other words, {{efn}} is implemented by Template:Efn, with the predefined groups that Bsherr mentioned, whereas <ref>s are implemented by the Wikimedia software, with whatever group names you legally define. So they are not symmetric. And since the {{Efn}} template is not Wikimedia software, a Phab ticket doesn't seem like the right venue. Mathglot (talk) 09:49, 25 April 2024 (UTC)Reply
Mathglot, this has still been bugging me a bit. Would you have a suggestion besides a Phabricator ticket for addressing this? Sdkbtalk 20:54, 8 April 2025 (UTC)Reply
Custom anchors should work, or the listref/relist template which is so rarely used outside of lists and glossaries that it is unlikely to ever conflict with this college admissions template? Rjjiii (talk) 00:51, 9 April 2025 (UTC)Reply
Sdkb, I tried a bunch of things, but couldn't find an alternative, but looks like Rjjiii did, and that solution ought to be added to the doc of a few templates so it can be discovered more easily. If you want to follow up at another venue, I would say Module talk:Footnotes, but anyone monitoring there is probably looking here as well, so not sure if practically speaking that will gain anything, but maybe it's worth adding a discussion advisory/feedback request there linking this discussion. Mathglot (talk) 02:04, 9 April 2025 (UTC)Reply
Ooh, thanks both! I'll look into those options, Rjiii. Sdkbtalk 04:35, 9 April 2025 (UTC)Reply
@Sdkb Posting some more stuff to clarify. So, the ref tags and templates that invoke them like {{efn}} do several things:
  1. Create an anchor link from the superscript callout down the correct footnote.
  2. Highlight the footnote when the superscript callout link is clicked.
  3. Display the footnote in mouseover popup on desktop.
  4. On mobile: replace the above the 3 behaviors with a popup at the bottom of the screen containing the footnote when the superscript callout is clicked.
  5. Automatically create a list of the references with backlinks to the superscript callouts.
The solutions I mentioned above, do the first 3 and not the second two. On mobile, they work like anchor links and there is no mouse-over popup because there is no mouse. It's probably not realistic to try to recreate the mobile behavior. Older versions of those templates used the reference class that ref tags and {{efn}} use. This worked on desktop, but the JavaScript for mobile would just break the links. I tried reporting this, but the solution was just to take out the reference class.
The {{ran}}/{{rma}} and {{listref}}/{{listref/reflist}} template pairs were both created for sort of the same reason. They are meant to avoid creating backlinks. If you cite a couple biographies a hundred times or cite the same directory hundreds of times, then the software goes buckwild and gives so many links they become useless. There is another template {{citeref}} that also does something similar and could be used. (It was made to create links between footnotes, which sounds very useful for the House of Leaves article. While trying out citeref, I started thinking that maybe the best solution isn't actually available right now.
Ran & listref both work, but say you have a navbox and infobox that both use them. In that case, you could end up with duplicate anchor links which are invalid HTML and could make the links point to the wrong target. This is less an issue with {{ran}}, because each template would be picking a letter or handful of letters. So the odds go down pretty low pretty quickly (1/26, 1/676, 1/17576). That said, I think the correct solution is to add something into the callout template and footnote template that is meant just for use in other templates. Call the parameter |tm-id= or whatever is easy to remember. Then when you invoke {{rma}} (or {{listref}} which is just a wrapper for it), you would use the same |tm-id= throughout a single template. This way, it wouldn't matter if you had six navboxes all using the template with [i] because their links would each be using an anchor that is inherently unique: #CITEREFtm-uscollegedamissions-i instead of #CITEREFi
If there is interest, I can try an example in one of the sandboxes, Rjjiii (talk) 20:46, 12 April 2025 (UTC)Reply
@Sdkb & Mathglot: Changes are done in all 5 template sandboxes. I think this version will just work, and will just work for *box templates in general. If conflicts linking ever do pop up, one template can just use a more specific |tm-id=. Rjjiii (talk) 14:47, 13 April 2025 (UTC)Reply
I pushed the changes live to {{rma}}, {{ran}}, {{listref}}, and {{listref/reflist}}. Some brief explanation is now at Template:Listref#Within templates. I can update the initial template that started this thread soon if there are no objections, questions, or concerns. Rjjiii (talk) 17:45, 23 April 2025 (UTC)Reply
I've been meaning to look over the fixes, and haven't had a chance but trust your work. Much thanks for taking this on! Sdkbtalk 18:04, 23 April 2025 (UTC)Reply

Line breaks for ref refnotes

edit
File:Ref line break.jpg

In limited cases, the <ref> generated footnote numbers are breaking lines, even when the <ref> is correctly flush with the preceding characters, i.e. no space. It seems to only occur in Firefox, not Chrome, only in wide mode and not standard and only when logged in (Vector 2022). I used the fluorine article for testing. Just a heads up if anyone is interested. —  AjaxSmack  19:27, 15 July 2024 (UTC)Reply

This has been requested before, but not on this page. It's not been done because the amount of work that would be needed simply isn't worth it: cases like this are rare, and are also dependent on factors such as browser, device width, font size etc. --Redrose64 🌹 (talk) 21:33, 15 July 2024 (UTC)Reply
Thanks for the explanation. It doesn't bother me as long as it doesn't affect the unwashed masses. (And thanks for pointing out in your edit summary that <ref> tags don't belong in headers.)  AjaxSmack  22:00, 15 July 2024 (UTC)Reply

  You are invited to join the discussion at Wikipedia talk:Citing sources § New proposal: deprecate {{reflist|refs= in favor of <references>?. Dan Leonard (talk • contribs) 03:02, 30 April 2025 (UTC)Reply

Confusing: How to name a reference

edit

In the section "Footnotes: using a source more than once", the method to name the reference and the one to use it is confusing. Maybe because the syntax is confusing, as the only difference is the use of "ref" when naming.

After the syntax definition:

 The syntax to define a named footnote is:
 <ref name="name">content</ref>
  To invoke the named footnote:
  <ref name="name" />

an example should be given right after to clarify this as well as underlining the subtle

Also, the Reference template allows you to specify a page or page range, which gets stuck to the full reference (right?), so a short reference to a different page will be confusing to the reader.

Adding to the possiblity for confusion, there is the Shortened Footnote. I have read the pages about three times and I am still confused what to use when. Jp1008 (talk) 04:57, 13 December 2025 (UTC)Reply

@Jp1008, how is the "manchester2002" example unclear? Do you have any ideas on what would make it more clear? What pages about shortened footnotes are unclear and how? You won't often see both in one article. Named references repeat the entire foonote. Shortened footnotes can each include a separate page number or other in-source location, and point to a full citation, typically in a list at the bottom of the page. Rjjiii (talk) 07:20, 13 December 2025 (UTC)Reply
I have just added a few words to make it easier for the public to understand this.
I often use {{rp|page number(s)}} to add page numbers to a reference, including the short named refs used elsewhere on the page. -- Valjean (talk) (PING me) 17:33, 13 December 2025 (UTC)Reply
Rjj, thanks for your request for suggestions.
1) Changing:
<ref name="name">content</ref>
to:
<ref name="name">tex of full reference</ref>
would help, as I was not sure what "content" referred and messed up a few times in my edits.
2) The simple moving of the example below immediately after the definition would help as the definition requires you to parse several nestings of "modifiers" (not sure that is the right term).
I would do what I am suggesting, but still a newbie and therefore not too comfortable of messing up a Help Page ... Jp1008 (talk) 23:41, 13 December 2025 (UTC)Reply
@Valjean: what do you think of the above idea (I saw you update the documentation a bit ago)? Personally, I have no objections. Rjjiii (talk) 00:20, 14 December 2025 (UTC)Reply
Excellent idea, and I have added those words. Thanks for the suggestion. -- Valjean (talk) (PING me) 01:09, 14 December 2025 (UTC)Reply

I have made a few changes to make it even easier to understand. Feel free to improve. One thing that is very confusing is using the word name twice (<ref name="name">). I have used an actual example ("manchester2002"). I consider this much better than a number, but far from ideal, since "manchester" could conceivably author myriad articles during 2002. That's why I follow and recommed the practice used by all scientific publications. They use the last name of the author(s) and full date of publication. See this: A basic citation template I like to use. -- Valjean (talk) (PING me) 01:06, 14 December 2025 (UTC)Reply

The changes improved it a lot. After many tries I made it work but they it is clearer now, thanks! Jp1008 (talk) 06:30, 14 December 2025 (UTC)Reply
Good. I suspect that there is still some unnecessary duplication, so feel free to examine it and see if it can be improved, and SIMPLIFIED!!!, even more. You started here in 2006 (but have relatively few edits), so I wouldn't call you a newbie, but if you feel you don't understand this stuff, don't feel bad. Lots of old timers don't either. So don't sell yourself short. Sometimes people who are relatively new on these pages are the ones who spot problems the rest of us gloss over without discovering, so your input is highly valued. Fresh eyes and all that. I'm counting on you to ask for more help to fix more problems you have found!   -- Valjean (talk) (PING me) 07:10, 14 December 2025 (UTC)Reply

Tag or template preference

edit

Jacobolus has complained that the guidance on this page is unclear about whether editors should use <references /> or {{reflist}}. It is clear that {{reflist}} cannot be used with list-defined footnotes, but what guidance should there be in other circumstances? Note that with {{refwidth}}, it is now possible to set column widths for <references />, but only one width per article. So what guidance should there be on this help page?

  • When not using LDRs, editors are free to choose either technique. Articles should not be changed from whatever they have now unless there is a reader-visible change (e.g. column width or numbering style) or functional reason (such as VisualEditor compatibility for LDRs, or removing deprecated parameters).
  • {{reflist}} is always preferred for non-LDRs
  • <references /> is always preferred
  • <references /> is always preferred except when styling is needed (column width, numbering style)
  • Something else?

-- Beland (talk) 04:53, 18 December 2025 (UTC)Reply

"It is clear that {{reflist}} cannot be used with list-defined footnotes,"
Except this is not actually the current consensus as far as I can tell. The current consensus, in my understanding, is that {{reflist}} should not be used with list-defined footnotes unless any other features of {{reflist}} are also used, in which case it's okay again. –jacobolus (t) 05:09, 18 December 2025 (UTC)Reply
The RFC at Wikipedia:Village pump (proposals)/Archive 223 § Bot to make list-defined references editable with the VisualEditor endorsed a bot removing only instances of {{reflist|refs= when there are no other parameters, but the discussion at Wikipedia talk:Citing sources/Archive 58#Should list-defined references be discouraged? endorsed fixing all such instances. I interpret this to mean that the remaining pages should drop custom column widths, stop using list-defined references, use the new {{refwidth}}, or whatever other solution is available to fix the VisualEditor incompatibility. A human decision needs to be made as to which approach is best in each case, which is why this was not left up to a bot. -- Beland (talk) 05:25, 18 December 2025 (UTC)Reply
Note that this discussion was closed by Beland with the summary "[...] There was 2:1 support in favor of deprecating {{reflist|refs=}} and replacing existing instances. [...]". However, this does not at all seem like a community consensus position, in the simple manner expressed by that summary. Myself and multiple other editors have called out this summary for being misleading and inaccurate. I urge interested readers to go actually read through the discussion at Wikipedia talk:Citing sources/Archive 58 § Should list-defined references be discouraged? which was far from conclusive or straightforward. –jacobolus (t) 05:41, 18 December 2025 (UTC)Reply
As for the above comment, "I interpret this to mean that the remaining pages should drop custom column widths, stop using list-defined references, use the new {{refwidth}}, or whatever other solution is available to fix the VisualEditor incompatibility." – This seems completely unsupported by the discussion at Wikipedia:Village pump (proposals)/Archive 223 § Bot to make list-defined references editable with the VisualEditor, and seems to me like Beland substituting their personal preference for community consensus. –jacobolus (t) 05:46, 18 December 2025 (UTC)Reply
To elaborate, here was Beland's personal preference:
  • "My bias would be toward removing any customizations and going with the default rendering."
But I didn't notice anyone else agreeing with this opinion, and there were a wide range of opinions expressed that either opposed this change altogether or only supported it contingent on having no outwardly visible effect or other downsides. Some quotations:
  • "(a) Is the rendered result is perfectly identical what's being replaced?"
  • "I would be fine with deprecation if the tag were sufficiently responsive for shortened footnotes."
  • "Oppose This does not seem worth running a bot to make 55,000 edits over to me."
  • "Oppose VE is broken and we should not extend the damage to the rest of Wikipedia by making our templates broken and clogging up our watchlists with bot edits as well."
  • "Support deprecating {{reflist}} altogether except for instances where specific functions unique to the template are required for some reason."
  • "Support provided that no changes are made if {{reflist}} is invoked with |colwidth=."
  • "Support limited to where |refs= is the only parameter in the reflist template."
  • "Oppose. Fix the actual problem where it lies, don't ask someone else to put up with a workaround."
  • "This is a really minor change that would produce major benefits with no downsides."
  • "Support - [... as] there isn't a visual difference, we might as well."
jacobolus (t) 06:09, 18 December 2025 (UTC)Reply
One of the differences between the two is that {{reflist}} is the worse choice when the PEIS limit is hit. That's not common, but it does happen. That suggests that the tag would be the better default choice if there are no features of the template needed. Mike Christie (talk - contribs - library) 05:44, 18 December 2025 (UTC)Reply
I lean towards <references/> but have no issues when other editors swap to {{reflist}}. When there are no parameters for the template, the output is just about the same; I think in the past the template was necessary to generate columns. When there are list-defined references the template obscures those in the Visual Editor and the WMF have been pretty upfront about having no fix planned for that. Rjjiii (talk) 06:19, 18 December 2025 (UTC)Reply