This template was considered for deletion on 2016 November 7. The result of the discussion was "keep".
Template:Prime 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. This template does not have a testcases subpage. You can create the testcases subpage here.
This template was reviewed by member(s) of WikiProject Articles for creation. The project works to allow users to contribute quality articles and media files to the encyclopedia and track their progress as they are developed. To participate, please visit the project page for more information.Articles for creationWikipedia:WikiProject Articles for creationTemplate:WikiProject Articles for creationAfC articles
Keep per above. I'm wondering if it won't be neater to have the template accept an argument, for example {{prime|f}} for f′. That way the spacing could be adjusted according to the preceding character. – Uanfala (talk) 20:13, 8 November 2016 (UTC)Reply
@Uanfala: 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 {{#invoke:String|pos|argument|-1}}, and then look it up in an if-chain with {{#invoke:String|find|abcde|letter}}. 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: {{prime|prefix|as-if|sp=0.1em}} The prefix parameter {{{1}}} is displayed, but the spacing is derived from the as-if parameter {{{2}}}, 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 {{prime|as-if}} to compactly ask for no displayed prefix.) {{{sp}}} gives an explicit spacing that overrides all of the preceding.
I'd do it with one sub-template: a {{′/calc_space|as-if}} which does the computation and returns the spacing. The parent template would invoke it if {{{sp}}} isn't given... {{{1|}}}<span class="nowrap" style="padding-left:{{{sp|{{′/calc_space|{{{2|{{#invoke:String|pos|{{{1|f}}}|-1}}}}}}}}}};">′</span> The default to 'f' provides maximum space if unspecified.
@Uanfala: 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)Reply
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)Reply