Template talk:Prime

Proposed revision, copied from deletion discussion
The original can be found at Templates for discussion/Log/2016 November 7, but is copied here for reference, as it's now being wored on. 71.41.210.146 (talk) 16:00, 17 November 2016 (UTC)


 * Keep per above. I'm wondering if it won't be neater to have the template accept an argument, for example for f. That way the spacing could be adjusted according to the preceding character. – Uanfala (talk) 20:13, 8 November 2016 (UTC)
 * H'mm... that's more ambitious than I was planning (I was considering allowing an explicit spacing specification), but not a horrible idea. Since the number of possible spacings is small (characters are go into groups which share the spacing), I could take the last character with, and then look it up in an if-chain with .  We could at least cover the standard Latin and Greek alphabets.
 * The big problem is that the correct spacing is font-dependent, and I don't know the user's display fonts, so it's all a guess. But I don't think a rough guess is making it worse.  (I spent a while playing with Unicode zero-width characters to see if there existed one that would get the kerning right, but no joy.)
 * So I'm thinking the following:  The prefix parameter  is displayed, but the spacing is derived from the as-if parameter, which defaults to the last character of the prefix, but may be given separately if trailing markup in the prefix would confuse things.  (Doing it this way allows a double pipe  to compactly ask for no displayed prefix.)    gives an explicit spacing that overrides all of the preceding.
 * I'd do it with one sub-template: a which does the computation and returns the spacing.  The parent template would invoke it if  isn't given...    The default to 'f' provides maximum space if unspecified.
 * Does that seem like a reasonable plan? 71.41.210.146 (talk) 11:48, 9 November 2016 (UTC)
 * Second thoughts: Probably the calculation template should not be here, but a sub-template of Template:italics correction. Maybe Template:Italics correction/calc?  Then both templates can use it. 71.41.210.146 (talk) 12:04, 9 November 2016 (UTC)
 * I have almost no knowledge of typography so I'm afraid I won't be of much use. But yes, that sounds like a good idea. – Uanfala (talk) 14:36, 9 November 2016 (UTC)
 * It wasn't the typography I was asking about, but the Wikipedia template design & implementation. Are those good parameters?  Does that seem like a reasonably efficient implementation?  And should I start work now, or wait for this TfD wraps up?  71.41.210.146 (talk) 16:02, 9 November 2016 (UTC)
 * I don't know much about templates either, but the parameters look usable enough, and it's sensible to have the calculation done in one place where it can be used by multiple templates. As for efficiency, if you have experience of lua, it'll be better to do it with a module. If not, it's OK – I don't think computational efficiency should be much of an issue. – Uanfala (talk) 16:10, 9 November 2016 (UTC)

(FTR, this has since been implemented. -- Beland (talk) 19:17, 3 February 2023 (UTC))