Template:′

From Ava Zinn Wiki
(Redirected from Template:Prime)
Jump to: navigation, search

Documentation icon Template documentation[view] [edit] [history] [purge]

This template produces a prime symbol with leading space so it does not collide with a preceding italic character (such as produced by {{mvar}}). It is known by two names, {{′}} (which is shorter), and {{prime}} (which is easier to find on a keyboard). For example:

  • ''{{′|f}}''(''{{′|x}}'') ≥ 0 or {{math|''{{′|f}}''(''{{′|x}}'') ≥ 0}}

generates:

for comparison, without the leading space, you end up with the prime symbol being almost indistinguishable from the ascender of the italic f:

The space provided is similar to {{'}} (a.k.a. {{apostrophe}}), used to provide a single quote with extra space, but provides the prime (minutes of arc) symbol instead of an apostrophe, and it can take the preceding letter into account when deciding how much space to add.

({{'}} has a second function which is not needed by {{prime}}: it ensures the apostrophe is not interpreted as wiki markup. For example, it can be written immediately after the wiki markup for italics as ''{{'}}, without being interpreted as wiki markup for bold '''.)

  • The template may be used without any arguments (a bare {{′}}), in which case is simply displays a prime symbol with the maximum space. It may be a bit wide in some cases, but will be intelligible.
  • The first argument (|1=) is preceding text. This is displayed before the prime symbol, and the last letter of this text is used to determine the amount of space to provide.
  • The second argument (|2=) is a single letter which determines the amount of space to provide. This defaults to the last letter of the first argument, but if the preceding text ends with markup rather than a letter to be displayed, that won't work right. Normally if the second argument is supplied, the first one is omitted. That is, people normally find ''[[π]]{{prime||π}}'' more legible than the equivalent ''{{prime|[[π]]|π}}''.
  • An optional |sp= argument allows you to explicitly specify the space, overriding the internal computation. Values around 0.1em normally work well. If this is supplied, the first argument is of little use, and the second is ignored completely.

Note that, although Greek letters are supported, it currently does not work with the corresponding HTML entities like α.

The extra space is most needed after tall letters which, in italic, extend far to the top right. Here is a table illustrating various combinations, to help decide:

Italic text {{mvar}} Italic text {{mvar}}
{{}} {{}} {{}} {{}}
a′ A′ a A Template:Mvar Template:Mvar n′ N′ n N Template:Mvar Template:Mvar
b′ B′ b B Template:Mvar Template:Mvar o′ O′ o O Template:Mvar Template:Mvar
c′ C′ c C Template:Mvar Template:Mvar p′ P′ p P Template:Mvar Template:Mvar
d′ D′ d D Template:Mvar Template:Mvar q′ Q′ q Q Template:Mvar Template:Mvar
e′ E′ e E Template:Mvar Template:Mvar r′ R′ r R Template:Mvar Template:Mvar
f′ F′ f F Template:Mvar Template:Mvar s′ S′ s S Template:Mvar Template:Mvar
g′ G′ g G Template:Mvar Template:Mvar t′ T′ t T Template:Mvar Template:Mvar
h′ H′ h H Template:Mvar Template:Mvar u′ U′ u U Template:Mvar Template:Mvar
i′ I′ i I Template:Mvar Template:Mvar v′ V′ v V Template:Mvar Template:Mvar
j′ J′ j J Template:Mvar Template:Mvar w′ W′ w W Template:Mvar Template:Mvar
k′ K′ k K Template:Mvar Template:Mvar x′ X′ x X Template:Mvar Template:Mvar
l′ L′ l L Template:Mvar Template:Mvar y′ Y′ y Y Template:Mvar Template:Mvar
m′ M′ m M Template:Mvar Template:Mvar z′ Z′ z Z Template:Mvar Template:Mvar

Lower-case f, l, and upper-case T are the worst cases; they require the full 0.15em of space. Other letters like j and V need some space, but not as much. And letters like o, A and L look worse with any extra space. Unfortunately there's no HTML equivalent of TeX's \/ italic correction, so this uses a crude approximation (from {{Italics correction/calc}}) which does not take the user's font into account.

{{pprime}} = {{″}} and {{ppprime}} = {{‴}} don't currently exist, but might be worth adding.