Template talk:Binpre

Latest comment: 6 months ago by Doerakpoes in topic Not a footnote 2

Transclusion edit

This template breaks when pages are transcluded into one another (see Random access memory and the cite errors when you hover over the reference indicator). —Locke Coletc 19:17, 6 May 2021 (UTC)Reply

Hovering over either of the indicators (currently #78) in Random access memory works normally for me under Windows 10, both logged in with gadgets using Firefox, and logged out in Firefox, Edge and Brave. Should we compare Wikipedia gadgets? NebY (talk) 16:30, 9 May 2021 (UTC)Reply
It was corrected in this edit. —Locke Coletc 16:39, 9 May 2021 (UTC)Reply
Ah. Even before that in this version I see it pop up OK on hover, albeit with an ungodly number of markers in the note and a lot of clutter in the tables. NebY (talk) 16:54, 9 May 2021 (UTC)Reply
I was trying to find a way to "preview" the old revision on Random access memory (where Synchronous dynamic random-access memory is transcluded) but unfortunately article-space doesn't have the "preview in page" functionality that pages in the Template namespace provide. Basically, prior to the linked corrected edit the cite was invalid/threw an error because it wasn't defined within Random access memory (because it was defined in a part of SDRAM that was not transcluded into Random access memory). So every single link had an error when you hovered over it. —Locke Coletc 17:08, 9 May 2021 (UTC)Reply
I think I understand now. Awkward. It sounds like a problem that would hit any reference/note first defined outside a section transcluded elsewhere, with nothing to alert a hapless editor. I thought this kind of article-to-article transclusion was being deprecated, but I guess that never happened. NebY (talk) 17:26, 9 May 2021 (UTC)Reply
I didn't even know transclusions like that existed before Locke pointed out the problem. Assuming that there aren't too many transcluded pages/sections using this template, I guess the only workaround is to have the 'first' use either in the transcluding page or in the transcluded section, which is where I moved it to. If more of this does come up we might need a better solution. Sadly, you can't check for these conditions from within the template. --Zac67 (talk) 17:44, 9 May 2021 (UTC)Reply
Yeah, at the time of my original comment above I had only identified that there was a problem and the likely culprit (transclusion), I hadn't sussed out what needed to be fixed but didn't want to not say something in case it was something Zac67 or someone else could figure out and fix before I could. I think this is the only transclusion of SDRAM into another page, so I'm torn on if the content should be moved to the Template namespace and just transcluded into both articles or not (as it's very unlikely any other articles would need the content). —Locke Coletc 18:15, 9 May 2021 (UTC)Reply
Right. Well, it is only transcluded by Random access memory. And itself. NebY (talk) 19:29, 9 May 2021 (UTC)Reply
Well, transclusion could be used elsewhere where this template is used. I've done some testing: a named footnote can be defined multiple times as long as the content doesn't differ (which isn't a problem here). So, in case that happens again we could always throw in a |first on the transcluded section.
If repeating the definition is supported (a pleasant surprise), does that mean the careful good practice of declaring |first is actually risky, and you might as well scrap the |first parameter and define it every time? It would make even normal untranscluded use much simpler. NebY (talk) 22:08, 9 May 2021 (UTC)Reply

Not a footnote edit

Though this is described as producing a footnote, it produces a numbered reference instead. A lettered footnote would be much more appropriate. Can this be changed? NebY (talk) 08:49, 8 May 2021 (UTC)Reply

@NebY: This template produces explanatory footnotes as described by WP:FOOTNOTES. --Zac67 (talk) 19:15, 8 May 2021 (UTC)Reply
I find it produces references eg example1[1] as opposed to notes eg example2[a]. Articles such as International System of Units and London separate notes from citations to good effect (eg a detail about mass prefixes[Note 1] footnoted in International System of Units#Notes, as opposed to a citation for redefinition[3] appearing International System of Units#References). In London#Notes you'll even find a distinction made between upper-alpha notes and those declared as being in the "notes" group. That may be excessive but it does demonstrate the possibilities. My own preference is for lower-alpha notes, which I suspect are more common if only because they're so easily placed using {{efn}} and {{notelist}}. The different types are detailed within WP:FOOTNOTES at WP:EXPLNOTE.

Notes placed using efn and notelist

  1. ^ a demo note for example2

Notes placed using Reflist|group

  1. ^ Names and symbols for decimal multiples and sub-multiples of the unit of mass are formed as if it is the gram which is the base unit, i.e. by attaching prefix names and symbols, respectively, to the unit name "gram" and the unit symbol "g". For example, 10−6 kg is written as milligram, mg, not as microkilogram, μkg.[2]: 144 

References

  1. ^ Here, K, M, G, or T refer to the binary prefixes based on powers of 1024.
  2. ^ Le Système international d’unités [The International System of Units] (PDF) (in French and English) (9th ed.), International Bureau of Weights and Measures, 2019, ISBN 978-92-822-2272-0
  3. ^ "Kilogram finally redefined as world's metrologists agree to new formulation for SI units". Physics World. 2018-11-16. Retrieved 2020-09-19.

NebY (talk) 11:50, 9 May 2021 (UTC)Reply

Hmm. Since not all pages are using efn-style notes, I think it's best to make the template adaptable via parameter. I'll cook something up that's still as easy to use as possible. Thanks for the suggestions! --Zac67 (talk) 12:47, 9 May 2021 (UTC)Reply
Great - thank you! NebY (talk) 16:18, 9 May 2021 (UTC)Reply
I would also appreciate this capability. ~Kvng (talk) 14:46, 27 May 2021 (UTC)Reply

Cite error edit

I came across a cite error at Amiga 500 that is being caused by this template. The entry is being correctly populated in the reference section, but is then generating an error. For reference the specific error is "Cite error: A list-defined reference with the name "binpre" has been invoked, but is not defined in the <references> tag (see the help page)."

{{binpre|first}} is correctly declared, and no other references to "binpre" exist outside of properly declare {{binpre}} tags. I thought it might be related to the issue discussed above, but it doesn't seem to fit. Any ideas? 92.5.2.97 (talk) 08:21, 2 June 2021 (UTC)Reply

Thanks for the info. As far as I can see, there's nothing technically wrong with the template – the problem seems to be the rather large number of uses. Reducing that number somewhat removes the error messages. Possibly that a wikimedia bug or limitiation. As there are admins here that won't allow a reasonable use of IEC prefixes and require the use of in-place disambiguation (see the lengthy discussion), I'm afraid there's nothing much we can improve the template with. --Zac67 (talk) 11:01, 2 June 2021 (UTC)Reply
Just for info I managed to fix the issue. Someone has been overzealous and added {{binpre}} inside a reference. Doing so caused the cite error, and didn't add the notation to the reference.92.5.2.97 (talk) 12:28, 2 June 2021 (UTC)Reply
Thanks for investigating – that one seems to be the exact one I tested with. "MB" in the binary sense requires disambiguation, too, but until we've got a better way, let's just leave it at that. It would be so very much easier to just use "MiB"... --Zac67 (talk) 18:44, 2 June 2021 (UTC)Reply

Not a footnote 2 edit

This still produces something indistinguishable from a source reference.

Please make this not produce something like the superscript number in 16 kB2. The previous suggestion, producing something like 16kBb is okay.

If you want to retain the ability to produce a superscript numeral, make sure that requires extra parameters. The default should not be identical to regular source references.

I consider this a huge problem, and would like to ask for a most urgent fix. Thank you CapnZapp (talk) 16:17, 31 January 2023 (UTC)Reply

So is this ever gonna use {{efn}}, or the lower-alpha group? Is there anything in particular preventing the usage of the lower-alpha group instead of the numbers which are usually reserved for sources? Doerakpoes (talk) 16:44, 16 November 2023 (UTC)Reply