Template talk:R
![]() | This template was nominated for deletion. Please review the prior discussions if you are considering re-nomination:
|
![]() | Template:R 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. |
This is the talk page for discussing improvements to the R template. |
|
|
|
This page has archives. Sections older than 180 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
This abomination needs to go
It plays very badly with visual editor and with various tools. For example, I wanted to reformat (convert) citations (missing dates, authors) etc. in Maciej Wąsik. Impossible. Piotr Konieczny aka Prokonsul Piotrus| reply here 01:55, 17 January 2024 (UTC)
- Why is it impossible? EEng 05:40, 17 January 2024 (UTC)
- @EEng What I meant is that it is impossible to edit references using this template in the Visual Editor (or, if it is possibloe, I'd like to know how to do it). Right now I can either manually and painstakingly try to convert references to visual editor compatibile simple format in code, or give up on trying to edit the references using that system. Piotr Konieczny aka Prokonsul Piotrus| reply here 14:26, 17 January 2024 (UTC)
- I looked at the article, and the only thing I can imagine you're having trouble with is WP:List-defined references, and those aren't specific to {r}. EEng 17:37, 17 January 2024 (UTC)
- Visual Editor is very limited when it comes to interacting with list-defined references, according to this help page and Wikipedia:VisualEditor#Limitations. – Jonesey95 (talk) 14:16, 18 January 2024 (UTC)
- Those two seem to often be used together. Since VE is the default tool for new editors (and anyone who is not particularly masochistic), we really should think about how to fix this (of course, coding this into VE shouldn't be impossible...). Piotr Konieczny aka Prokonsul Piotrus| reply here 01:29, 19 January 2024 (UTC)
- I agree that VE ought to be fixed. This is, like, Problem #482 with it. EEng 02:26, 19 January 2024 (UTC)
- I'm a big fan of VE, but I don't think incompatibility is a good reason to say people shouldn't use this referencing system. How about asking at the article talk page if anyone would care if you converted to a different referencing system? Mike Christie (talk - contribs - library) 17:38, 19 January 2024 (UTC)
- @Mike Christie Converting is a lot of work, and I do not care much about that article. But what I worry is that increasingly, most people rely on VE, and so articles that use this legacy code are becoming increasingly difficult to fix. I mean, I am a veteran editor, I could fix this article, I don't want to - it is too much hassle (if it used VE compatible code, it would take me one minute, fine; converting would take me 5-20 minutes - no, I am not willing to do this as this is effectively make-up work that should be done with some gadget/button). Piotr Konieczny aka Prokonsul Piotrus| reply here 01:59, 20 January 2024 (UTC)
- That's fair. It might actually be possible to have a bot change it from LDR; if there's no disagreement on the talk page. I don't think any such bot exists but it's an idea. Mike Christie (talk - contribs - library) 02:13, 20 January 2024 (UTC)
- While this needs a VP/RFC, maybe we should have a bot do it for all articles? I don't see what benefits the legacy system has, while the disadvantages (making things hard to fix for VE users, i.e. 99.9% of the new users and growing number of old ones) is clear. Piotr Konieczny aka Prokonsul Piotrus| reply here 03:50, 20 January 2024 (UTC)
- This problem seems like a problem with the just-recently-out-of-beta Visual Editor, not with LDR, but maybe I misunderstand. It seems like the VisualEditor tail is wagging the dog, but if there are other reasons to object to LDR, maybe that style should be re-evaluated. – Jonesey95 (talk) 05:30, 20 January 2024 (UTC)
- It looks like it should be pretty easy to automate. I'll see if I can put something together in the next day or so to try out on this article. Re the tail wagging the dog: it would be inappropriate to do mass updates unless as Piotrus suggests LDR get deprecated, but a tool to switch easily when there is consensus to do so seems harmless. Mike Christie (talk - contribs - library) 09:31, 20 January 2024 (UTC)
- This problem seems like a problem with the just-recently-out-of-beta Visual Editor, not with LDR, but maybe I misunderstand. It seems like the VisualEditor tail is wagging the dog, but if there are other reasons to object to LDR, maybe that style should be re-evaluated. – Jonesey95 (talk) 05:30, 20 January 2024 (UTC)
- While this needs a VP/RFC, maybe we should have a bot do it for all articles? I don't see what benefits the legacy system has, while the disadvantages (making things hard to fix for VE users, i.e. 99.9% of the new users and growing number of old ones) is clear. Piotr Konieczny aka Prokonsul Piotrus| reply here 03:50, 20 January 2024 (UTC)
- That's fair. It might actually be possible to have a bot change it from LDR; if there's no disagreement on the talk page. I don't think any such bot exists but it's an idea. Mike Christie (talk - contribs - library) 02:13, 20 January 2024 (UTC)
- @Mike Christie Converting is a lot of work, and I do not care much about that article. But what I worry is that increasingly, most people rely on VE, and so articles that use this legacy code are becoming increasingly difficult to fix. I mean, I am a veteran editor, I could fix this article, I don't want to - it is too much hassle (if it used VE compatible code, it would take me one minute, fine; converting would take me 5-20 minutes - no, I am not willing to do this as this is effectively make-up work that should be done with some gadget/button). Piotr Konieczny aka Prokonsul Piotrus| reply here 01:59, 20 January 2024 (UTC)
- I'm a big fan of VE, but I don't think incompatibility is a good reason to say people shouldn't use this referencing system. How about asking at the article talk page if anyone would care if you converted to a different referencing system? Mike Christie (talk - contribs - library) 17:38, 19 January 2024 (UTC)
- I agree that VE ought to be fixed. This is, like, Problem #482 with it. EEng 02:26, 19 January 2024 (UTC)
- I looked at the article, and the only thing I can imagine you're having trouble with is WP:List-defined references, and those aren't specific to {r}. EEng 17:37, 17 January 2024 (UTC)
- @EEng What I meant is that it is impossible to edit references using this template in the Visual Editor (or, if it is possibloe, I'd like to know how to do it). Right now I can either manually and painstakingly try to convert references to visual editor compatibile simple format in code, or give up on trying to edit the references using that system. Piotr Konieczny aka Prokonsul Piotrus| reply here 14:26, 17 January 2024 (UTC)
- The title of the thread is correct. If this abomination, VE, cannot handle list-defined references, then VE needs to go. If it cannot handle list-defined references, it also cannot handle repeated references, and those are unavoidable. On the other hand, R is just fine for repeated references or other uses of labeled references such as list-defined references, and does not need to go anywhere.
- As for deprecating list-defined references, I would strongly oppose any such change. Having the references interrupting the body text makes it very very difficult to read the source text for those of us not using this abomination, VE. List-defined references fix that by putting all the references in one convenient place where they can be cleaned up if you are cleaning up references or ignored if you are editing body text. And for long articles with many repeated references, list-defined references make it much easier to find the reference than having them inline somewhere far away in the source. As someone said above, using this abomination VE as an excuse to prevent us from using list-defined references would be the tail wagging the dog. —David Eppstein (talk) 18:07, 22 January 2024 (UTC)
- @David Eppstein: Help:List-defined_references#Overview says {{r}} could merely be "Alternatively" used. Therefore, LDR is off-topic for TfD.
- I understand why a professor of computer science is interested in the wikitext
source
code. However, despite me working in software myself, I want a break from code when I clock out. According to File:Size_of_English_Wikipedia_(1000_vol).svg, 3/4 articles belong to the faculty of humanities or art, not the faculty of math or engineering. All those people are scared of code, including wikitext. - I hereby boldly claim that the majority of editors (especially less active editors) believe that the wikitext editor needs to go. VisualEditor, Microsoft Word, and Google Docs are what they understand, not HTML, CSS, and LaTeX. Even I nowadays prototype in the former category before converting to the latter. Let's remove the "View Source" button and restrict that to the API or data dumps so that it's no longer
very very difficult to read
. - Just kidding, we should keep the wikitext editor for the minority that knows coding or needs to do template editing. But seriously, VE makes editing practical and efficient for many people, and {{r}} is interfering with that. Finally, I think a better venue for this discussion is TfD, and I might be sending this template there. 142.113.140.146 (talk) 06:30, 15 August 2024 (UTC)
- @Piotrus: What exactly are you trying to edit? At the sandbox in [1], I used VE to move around references mixed with {{r}} and the moving worked. VE just treats it as a bundled reference. In those cases, the (URL-containing) definition of the ref needs to be located first.
- Editing the refs is more awkward. VE doesn't provide an edit button for {{reflist}}. Even if it did, it hasn't implemented the
"content"
TemplateData type. In response toif it is possibloe, I'd like to know how to do it
, a workaround is the following:- Open the wikitext editor on Maciej Wąsik
- Copy the desired ref inside
{{reflist|refs=}}
- Open https://en.wikipedia.org/wiki/WP:Sandbox?veaction=edit
- Paste
- Click the ref
- Edit
- Show changes or use the dropdown back to source editing
- Copy
- Paste overwriting the ref in Maciej Wąsik
- Very tedious but TemplateData makes life easier than reading the {{citation/doc}} wall of text. I sometimes use this sandbox workaround to get VE to work, and frequently at Wiktionary which hasn't enabled VE.
- It seems this talk page section is about VE and LDR not VE and {{r}}, while my TfD is using VE to rebut the previous TfD about {{r}}. 142.113.140.146 (talk) 09:37, 16 August 2024 (UTC)
Piotrus, I have created a script that converts pages written using {{R}} to use named references instead. I've tested it on Maciej Wąsik; you can see the converted version here. Can you take a look and see if you can find any problems with the conversion?
It would be fairly easy to change the script to convert in the other direction -- that is, it could take a page using named references and convert it to list-defined references using R.
I think there's a potential for misuse of this script (in contravention of WP:CITEVAR) so I probably should not make it generally available, but if there are pages using LDR and you get no opposition on the talk page to changing the citation style, I can try applying the script. I've only tested it on this one page so far and no doubt there are special cases I haven't considered, so it might not work in all cases. Mike Christie (talk - contribs - library) 22:51, 29 January 2024 (UTC)
- I for one would strongly object to uses of this script to un-list-define any article I have drafted in list-defined format. And your script conflates two different things: whether the references are list-defined, and whether named references defined elsewhere (regardless of whether elsewhere in the body or elsewhere in a list of refs) are accessed using {{r}} or using <ref name=name/>. But I think your script is buggy: it has not converted all the {{r}} templates, and as a result it is not true that all references have been moved up to the point of their first use. In your example link, references gov.2023 and gov.briefing have both been moved up to their second use, with the first use left unconverted. —David Eppstein (talk) 23:47, 29 January 2024 (UTC)
- Yes, I wouldn't apply it unless I saw agreement from editors of that page to do so, or the relevant editors had retired. Thanks for pointing out the bugs -- will have a look at those. There may be no demand for this anyway, but it was an interesting exercise. Mike Christie (talk - contribs - library) 23:54, 29 January 2024 (UTC)
- That bug is now fixed, though no doubt there are more limitations. Mike Christie (talk - contribs - library) 03:14, 30 January 2024 (UTC)
- @Mike Christie Thanks for the tool. Can you adjust it so it does not move the references to the infobox if possible? VE cannot handle references hidden in templates.
- In other news, it is ridcolous VE still cannot do it. Anyone knows which bugzilla tracks this? WMF has money to give away to unrelated projects by other NGOs but not for finishing VE. Ridcolous. Piotr Konieczny aka Prokonsul Piotrus| reply here 02:16, 2 February 2024 (UTC)
- It would be possible to move the refs out of the inbox with a script, but I think that should be a separate function -- I'd rather not combine it with this. In some cases it wouldn't work anyway as the only instance of a reference might be within the infobox. And I think it's more general than just infoboxes; if a ref tag only occurs within a note tag I think those are also invisible to VE. There are certainly Phab reports on the issue; if I recall correctly it's a bigger development effort than it appears. WhatamIdoing, do you recall the status on this? I know you've been repeatedly asked about this over the years and I thought you might have the inside information. Mike Christie (talk - contribs - library) 02:26, 2 February 2024 (UTC)
- It seems likely to me that the same thing that prevents VE from seeing references in iboxes is the thing that prevents it from seeing them in reflists. See my earlier comments about "this abomination, VE": we should not let its limitations push us into worsening editing for the rest of us who avoid it, by making the source code of our articles unreadable. —David Eppstein (talk) 03:08, 2 February 2024 (UTC)
- Mike, it's called "rich editing of templates", and it is a h-u-g-e project. I believe that it's currently blocked on the parser unification (and, you know, deciding to have a development team spend a couple of years on it instead of, say, the mobile visual editor).
- @Piotrus, if this particular template (Template:R) is the same as the one used years ago at the Polish Wikipedia, then @Tar Lócesilion will know what's involved in converting. WhatamIdoing (talk) 07:13, 2 February 2024 (UTC)
- If the issues are what I think they are, then {{r}} is not the problem. The problem is VE + list-defined references and you would have exactly the same problem regardless of whether you used {{r}} or <ref name=X/> to access those list-defined references. You could test this by trying to use VE to edit a named reference defined elsewhere in the body (not list-defined) and comparing its behavior for {{r}} vs <ref name=X/>. —David Eppstein (talk) 07:21, 2 February 2024 (UTC)
- I finally filed a bug at phabricator about the VisualEditor and list-defined references here: https://phabricator.wikimedia.org/T356471
- As the help page linked above says: "
You can edit existing list-defined references in VisualEditor. You cannot add or remove list-defined references. It also does not support modifying list-defined references inside {{reflist}}, only <references/>.
" - The VisualEditor struggles with the {{r}} template's named references because they are defined within a template. If named references are defined like
<ref name="Doe1999">Doe, John (1999). ''Some Book''.</ref>
within the body text, then the VisualEditor does fine. If you ever come across pages with reference names like ":2" those are the default names created when the VisualEditor creates named references. Hope that helps, Rjjiii (talk) 03:58, 9 February 2024 (UTC)- It is not actually a necessary part of using {{r}} that its references be defined within a template. They could be defined as above within body text. Or you could wrap them inside <references> ... </references> at the end of the article instead of using the {{reflist}} template to do that for you. Maybe it is {{reflist}} that we should be pushing to eliminate in favor of <references> so that VE works better? Only now I see in the phab bug and its test case that this abomination VE does not even work with list-defined references using <references>. —David Eppstein (talk) 05:57, 9 February 2024 (UTC)
- If the issues are what I think they are, then {{r}} is not the problem. The problem is VE + list-defined references and you would have exactly the same problem regardless of whether you used {{r}} or <ref name=X/> to access those list-defined references. You could test this by trying to use VE to edit a named reference defined elsewhere in the body (not list-defined) and comparing its behavior for {{r}} vs <ref name=X/>. —David Eppstein (talk) 07:21, 2 February 2024 (UTC)
- It seems likely to me that the same thing that prevents VE from seeing references in iboxes is the thing that prevents it from seeing them in reflists. See my earlier comments about "this abomination, VE": we should not let its limitations push us into worsening editing for the rest of us who avoid it, by making the source code of our articles unreadable. —David Eppstein (talk) 03:08, 2 February 2024 (UTC)
- It would be possible to move the refs out of the inbox with a script, but I think that should be a separate function -- I'd rather not combine it with this. In some cases it wouldn't work anyway as the only instance of a reference might be within the infobox. And I think it's more general than just infoboxes; if a ref tag only occurs within a note tag I think those are also invisible to VE. There are certainly Phab reports on the issue; if I recall correctly it's a bigger development effort than it appears. WhatamIdoing, do you recall the status on this? I know you've been repeatedly asked about this over the years and I thought you might have the inside information. Mike Christie (talk - contribs - library) 02:26, 2 February 2024 (UTC)
- That bug is now fixed, though no doubt there are more limitations. Mike Christie (talk - contribs - library) 03:14, 30 January 2024 (UTC)
- Yes, I wouldn't apply it unless I saw agreement from editors of that page to do so, or the relevant editors had retired. Thanks for pointing out the bugs -- will have a look at those. There may be no demand for this anyway, but it was an interesting exercise. Mike Christie (talk - contribs - library) 23:54, 29 January 2024 (UTC)
@David Eppstein, EEng, Jonesey95, Mike Christie, Piotrus, Rjjiii, Tar Lócesilion, and WhatamIdoing: This discussion should be continued at Wikipedia:Templates_for_discussion/Log/2024_August_15#Template:R. 142.113.140.146 (talk) 08:35, 15 August 2024 (UTC)
- Perhaps the proper procedure was for me to have first started a RfC at WP:VPR instead to separately seek consensus for change per CITEVAR. Oh well, if only VE came 14 years earlier. Now {{r}} has become somewhat more widespread and fragmentation is too hard to fight. With 1:1 arguments about VE at TfD, and 2:1 currently in favor of usefulness, I don't think a deprecation RfC would stand any chance.
- Let's look at the {{r}} supporters' usefulness claims from another perspective. If I imagine {{r}} as a {{tsh}}, I suppose {{r}} becomes more tolerable... 142.113.140.146 (talk) 04:27, 16 August 2024 (UTC)
Should I use {{r}}
or <ref>
?
I was reading the article about Swatting and I discovered an {{r}}
reference named "Krebs_1" with a page number and a tool tip. This was my first time seeing that. I thought there was an error with the reference, so I looked at the source and noticed that there was a quote but when I hovered over the reference, the quote did not show. It did not occur to me to hover over the page number to see the quote in the tool tip. I also noticed that this quote did not display in the references section like a <ref>
quote does so I could not read it there either. The only place to read the quote was hovering over the page number, which in this case was unnecessary because the reference was a single short web page and not a book with multiple pages. Maybe I shouldn't have but I changed the reference to the <ref>
format and moved it from the references section. I changed the format of the reference so that the quote would be appended to the citation instead of displayed as a tool tip. It may have been an unnecessary edit but I worry that other Wikipedia readers might not understand that if you hover over the page number there might be a tool tip. This was not at all obvious to me.
Also, the tool tip text is much smaller and more difficult to read than the text in the citation.
So, the main reason I am creating this topic is to find out which reference system I should use when working with references? Most of the edits that I do are fixing dead links and adding archived pages and in general fixing references as I read Wikipedia. For my future edits would it be preferred to use the {{r}}
template format or the <ref>
format or does it matter? Also, on my first edit of the Swatting page in the references section, I removed {{reflist}}
and replaced it with <references />
after I moved the reference out of the references section. However, I was unsure of the differences between {{reflist}}
and <references />
so I changed it back. What is the difference? I noticed that there was another {{r}}
reference in the source and it still displayed correctly in the references section when I used <references />
instead. Also, I don't use an editor, I edit the source directly. -- Ubh [talk... contribs...] 15:03, 7 March 2024 (UTC)
- The {{reflist}} template permits overriding the defaults on
<references />
, but if you're not using those parameters it's supposed to be identical. I believe there is a slight difference in rendering on mobile. It also used to be the case that using<references />
was better for editors using the Visual Editor, but VE now copes with {{reflist}} so that's no longer an issue. I typically use<references />
. For {{r}} vs. <ref> tags, as a VE user myself I find the ref tags much easier to work with, and as {{r}} is not widely used I would not suggest you adopt it unless it has some specific benefits you like. If you're editing an article that has an established citation style, though, you should try to stick with that, per WP:CITEVAR. Otherwise if you use VE it will put in ref tags by default. If you don't use VE, I would suggest using whatever you find easiest -- ref tags, {{sfn}}, or one of the other systems out there. Mike Christie (talk - contribs - library) 15:57, 7 March 2024 (UTC)
Ranges of pages with hyphens?
It is unclear what markup to use for a range of pages when the page numbers contain hyphens. Which of these is correct for p1-s1 through p2-s2
|pp=p1-s1-p2-s2
|pp=((p1-s1))-((p2-s2))
|pp=
{{page range|p1-s1|p2-s2}}
It would be helpful to have bothdirection and examples of proper usage for this case. -- Shmuel (Seymour J.) Metz Username:Chatul (talk) 03:25, 17 June 2024 (UTC)
Edit request 15 August 2024 TfD
![]() | This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Description of suggested change: TfD at Wikipedia:Templates_for_discussion/Log/2024_August_15#August_15. This ER is per "If the template to be nominated for deletion is protected" at WP:TFD. However, some editors might oppose this on non-policy grounds per Wikipedia:Templates_for_discussion/Log/2010_February_14#c-Peterkingiron-2010-02-14T21:18:00.000Z-IBen-2010-02-14T19:03:00.000Z.
Diff:
− | + | {{subst:Tfd|type=inline}}<includeonly><!-- ### 1 ### |
142.113.140.146 (talk) 08:27, 15 August 2024 (UTC)
- Inline is too large relative to the size of a ref. I think the choice is between either
|type=tiny
or|type=disabled
. SilverLocust 💬 09:23, 15 August 2024 (UTC) Done – Jonesey95 (talk) 13:22, 15 August 2024 (UTC)
- (Jonesey went with something equivalent to disabled: inline but with noinclude tags.) SilverLocust 💬 22:34, 15 August 2024 (UTC)
- Thank you both for the solution to hide the notice, which I credit for saving me from a 28,000+ editor pile-on.
- The TfD is over now, so I'm requesting removal of the notice. 142.113.140.146 (talk) 18:06, 24 August 2024 (UTC)
- (Jonesey went with something equivalent to disabled: inline but with noinclude tags.) SilverLocust 💬 22:34, 15 August 2024 (UTC)
Done — Martin (MSGJ · talk) 13:31, 25 August 2024 (UTC)