Template talk:R

Latest comment: 27 days ago by Aaron Liu in topic Should I use {{r}} or <ref>?

This abomination needs to go

edit

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)Reply

Why is it impossible? EEng 05:40, 17 January 2024 (UTC)Reply
@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)Reply
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)Reply
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)Reply
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)Reply
I agree that VE ought to be fixed. This is, like, Problem #482 with it. EEng 02:26, 19 January 2024 (UTC)Reply
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)Reply
@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)Reply
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)Reply
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)Reply
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)Reply
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)Reply
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)Reply
@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)Reply
Hear, hear. Piotr Konieczny aka Prokonsul Piotrus| reply here 09:30, 15 August 2024 (UTC)Reply
@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 to if it is possibloe, I'd like to know how to do it, a workaround is the following:
  1. Open the wikitext editor on Maciej Wąsik
  2. Copy the desired ref inside {{reflist|refs=}}
  3. Open https://en.wiki.x.io/wiki/WP:Sandbox?veaction=edit
  4. Paste
  5. Click the ref
  6. Edit
  7. Show changes or use the dropdown back to source editing
  8. Copy
  9. 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)Reply

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)Reply

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)Reply
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)Reply
That bug is now fixed, though no doubt there are more limitations. Mike Christie (talk - contribs - library) 03:14, 30 January 2024 (UTC)Reply
@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)Reply
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)Reply
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)Reply
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)Reply
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)Reply
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)Reply
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)Reply

@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)Reply

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)Reply

Should I use {{r}} or <ref>?

edit

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)Reply

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)Reply
The answer to "For my future edits would it be preferred to use the {{r}} template format or the <ref> format or does it matter?" is "use <ref>, or a modern template wrapper for it that provides a needed function, like {{sfnp}}". The {{r}} template is obsolete, because it is hardcoded (via the also obsolete {{rp}}) to produce a form of deprecated inline parenthetical referencing (the "[1]:23" page numbering, injected into the main article text instead of being inside a citation). The <ref> tag is part of the MediaWiki code and future-proof (and gets new features added over time, albeit slowly), and modern templates that are built on it do not have the problems of {{r}} and {{rp}}. PS: We've had multiple RfCs about the meaning and scope of "citation style" in WP:CITESTYLE, and the result has been that which underlying code is used is not within it; rather, it refers to the rendered output seen by the reader. Even so, a citation style in this sense is not magically immune to the WP:PARENTHETICAL rule against injecting citation details inline into article text.  — SMcCandlish ¢ 😼  22:41, 4 October 2024 (UTC)Reply
SMcCandlish, I'm pretty sure I said this before: your work and knowledge about styles and so on is a great boon to Wikipedia, but there's something about {r} that makes your brain short-circuit. WP:PARENTHETICAL says Since September 2020, inline parenthetical referencing has been deprecated on Wikipedia, and that link takes us to a definition of parenthetical referencing as being (logically enough) a citation system in which in-text citations are made using parentheses. But {r} doesn't use parentheses. QED. EEng 17:08, 5 October 2024 (UTC)Reply
No, that is not what parenthetical means in this construction; it's defn. 1 here, referring to defn. 3 of parenthesis here: the use of a parenthetical remark (an aside, a qualifying interruption). It is not possible for parenthetical to mean what you think it means here, because the (...) marks are only called "parentheses" in American English, and even within that dialect this is not the only or even primary meaning of parenthesis and parenthetical; the very fact that in Am. Eng. the round brackets are called parentheses is because they usually serve a parenthetical function and are the most common punctuation used for that function; that function is not named after these punctuation marks. You're flipping cause and effect entirely backwards. To put it another way, if you think you've discovered a "magical backdoor" for evasion of WP:PARENTHETICAL and that it is removing the round brackets around intrusive parenthetical citation data, or replacing those round brackets with square or sqiggly or angled ones or some other marks, then you are bad wrong, and everyone but you understands that.  — SMcCandlish ¢ 😼  02:39, 6 October 2024 (UTC)Reply
Sandy, you really have blown a gasket. EEng 06:49, 6 October 2024 (UTC)Reply
SMcCandlish, see the actual quotation from the guideline below. I'll take a larger piece of it here: Since September 2020, inline parenthetical referencing has been deprecated on Wikipedia. This includes short citations in parentheses placed within the article text itself, such as (Smith 2010, p. 1). This does not affect short citations that use <ref> tags, which are not inline parenthetical references. I think you would benefit from re-reading that guideline; it does not match what you have claimed above, and it does not apply to Template:R, which uses ref tags. I feel silly even having to explain this, but {{r|RefName|p=22}} expands to <ref name="RefName" group=""></ref><sup class="reference nowrap"><span title="Page: 22">: 22 </span></sup>. Ref tags. No parentheses. Not inline. Please drop this stick. – Jonesey95 (talk) 00:41, 7 October 2024 (UTC)Reply
The one not dropping the stick is you, trying desperately to twist things to get what you want. Most obviously, "includes" does not and never means "is limited to", and <ref>...</ref> is not {{r}} or {{rp}}. If you read the actual discussion instead of trying to misread a closing summary, the entire point is that there is a clear consensus against interruptive injection of citation details into the article prose and that those details belong inside the citations.  — SMcCandlish ¢ 😼  01:14, 7 October 2024 (UTC)Reply
There is no sense in which the formatting produced by {{r}} or {{rp}} is "injection of citation details into the article prose". It is just a footnote, the same as what you would get from <ref>. So you are continuing to talk nonsense here. —David Eppstein (talk) 01:24, 7 October 2024 (UTC)Reply
SMcCandlish, speaking as one who has no dog in this fight, I have to say I completely fail to understand the equivalence you are drawing. David's comments above make sense to me and I have no idea, from what you have said above, how you can see an equivalence between this template and what has been deprecated. If you feel like explaining it again, please do, but try using a different form of words -- what you have said above makes no sense to me. Mike Christie (talk - contribs - library) 01:33, 7 October 2024 (UTC)Reply
And there was a much more recent discussion two months ago that found consensus to keep. Aaron Liu (talk) 11:00, 7 October 2024 (UTC)Reply
Ignore this bogus advice and use r if you want. Also ignore the claim that the format it produces is deprecated. Also ignore the claim that it is tied to the use of rp. All of these are false.
The r template is primarily a substitute for named references, a mechanism that allows for the reuse of footnotes and for defining footnotes separately for their uses. You can use them as a shortcut for a named reference, or not, as you please, but please use them consistently.
I happen not to like rp-formatted page-numbers-in-footnotes. I disagree that this format is in any way deprecated. But it is easy to use r and avoid this format: just don't use its page and pages parameters. I use r regularly, and never use pages in r. Used in this way, it is purely and only a shorter synonym for one or more named references. —David Eppstein (talk) 23:47, 4 October 2024 (UTC)Reply
This template also uses <ref>; to be specific, it's an elaborate wrapper around {{#tag:ref, which additionally does a pre-save transform. You seem to believe that it uses some other unorthodox method, which is not true.
I also have no idea how you would build {{rp}} on top of <ref> in our present moment Aaron Liu (talk) 01:24, 5 October 2024 (UTC)Reply
Correct. This template is not deprecated or affected by WP:PAREN. There are no parentheses, it's not in-line, and that guideline specifically says This does not affect short citations that use <ref> tags, which are not inline parenthetical references. Carry on. – Jonesey95 (talk) 16:00, 5 October 2024 (UTC)Reply

Ranges of pages with hyphens?

edit

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)Reply

Edit request 15 August 2024 TfD

edit

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:

<includeonly><!-- ### 1 ###
+
{{subst:Tfd|type=inline}}<includeonly><!-- ### 1 ###

142.113.140.146 (talk) 08:27, 15 August 2024 (UTC)Reply

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)Reply
  DoneJonesey95 (talk) 13:22, 15 August 2024 (UTC)Reply
(Jonesey went with something equivalent to disabled: inline but with noinclude tags.) SilverLocust 💬 22:34, 15 August 2024 (UTC)Reply
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)Reply
  Done — Martin (MSGJ · talk) 13:31, 25 August 2024 (UTC)Reply

Deprecated or not?

edit

Back in January, @SMcCandlish added templates to relevant help articles saying that this was deprecated according to Wikipedia:Centralized discussion/Citation discussion#Suspend replacing of ref by Template:r in citations—a 2010 discussion, yet PAG such as WP:SFN and WP:IBID actively recommend it. Since then, a 2024 TfD has resulted in a consensus to keep.

The aforementioned discussion had 3 points for unsuspension. Since guidelines recommend it, points 1 and 3 are probably satisfied. However, point 2—requiring *all* bots support it just as well as <ref>—would probably never happen. So, is this template deprecated or not? Aaron Liu (talk) 17:43, 4 October 2024 (UTC)Reply

This template is not deprecated and was kept overwhelmingly at TFD (the earlier TFD was closed as "no consensus"). Any note saying that it is deprecated should be removed. If someone wants to deprecate this template, a true RFC would need to be held, probably at the talk page for WP:CITEVAR, since that guideline is at the heart of this template's existence. – Jonesey95 (talk) 18:38, 4 October 2024 (UTC)Reply
It appears that SMcCandlish's actual crusade is against rp. The r template includes functionality to invoke rp via its page and page parameters, but it can also be used for other purposes without ever invoking rp (as I do, because I like the abbreviated formatting of r vs named references but I dislike the rp format). I do not believe that the format produced by rp has ever been deprecated. —David Eppstein (talk) 23:51, 4 October 2024 (UTC)Reply
Well, his edits warned about r in contexts unrelated to rp. Anyways, since he has since edited, I will be reverting the additions to help pages. Aaron Liu (talk) 01:26, 5 October 2024 (UTC)Reply
Good points for those who do not know the full history. Emir of Wikipedia (talk) 14:41, 5 October 2024 (UTC)Reply