Template:Su: Difference between revisions
From Zoophilia Wiki
Jump to navigationJump to search
meta>TFOWR m Changed protection level of Template:Su: Restoring semi-protection per consensus at Wikipedia:Administrators'_noticeboard/IncidentArchive638#HJ_Mitchell_mass_fully_protecting_templates. Discussion is ongoing at WT:HRT - I won't consider it wheel-warri |
meta>Wikid77 for IE6 & new browsers, shows super/subscript together by vertical <br>; +new fontsize=80%; removed "includeonly" tags; moved {documentation} to bottom; put many internal NOTES comments, etc. |
||
Line 1: | Line 1: | ||
{{#if:{{{p|<noinclude>x</noinclude>}}}|{{#if:{{{b|<noinclude>x</noinclude>}}}|<span style="{{#ifeq:{{{w|}}}|f|font-family:monospace;}}font-size:{{{fontsize|80%}}};line-height:1;margin-bottom:-0.1em;overflow:visible;text-align:{{#switch:{{{a|}}}|r=right|c=center|left}}"><span style="display:inline-block; vertical-align: -0.4em; line-height:1.3em; background:transparent;">{{{p|super}}}<br/>{{{b|sub}}}</span></span>|{{sup|{{{p|}}}}}}}|{{sub|{{{b|}}}}}}}<noinclude><!-- | |||
-------------------------------------------------------------- | |||
--NOTES: | |||
-- [ These comments are omitted by "noinclude" and not put | |||
-- in pages sent over the Internet, only during edit.] | |||
-- | |||
-- NOTE A1: This template displays either a subscript {b} or | |||
-- superscript {p}, or both in vertical alignment. | |||
-- Usage: {{su |p=super |b=sub}} | |||
-- | |||
-- NOTE C2: For compatibility with browser MS IE6, the result | |||
-- with both subscripts is a span with vertical "<br>" | |||
-- to align the superscript & subscript together. | |||
-- | |||
-- NOTE F3: The font can be changed by w=f to select the | |||
-- font-family:monospace, or by fontsize=nn% (default: | |||
-- 80%) where 100% is the usual super/subscript size. | |||
-- | |||
-- NOTE L4: The logic to select the typesetting, is shown by | |||
-- the following 2 nested if-then-else statements: | |||
-- | |||
-- IF superscript {p} exists | |||
-- THEN IF subscript {b} exists | |||
-- THEN show both aligned {p}<br>{b} | |||
-- ELSE show superscript {p|} ENDIF | |||
-- ELSE show subscript {b|} ENDIF | |||
-- | |||
-- NOTE T5: Other templates are used unless {p} & {b} are | |||
-- both specified together: | |||
-- Template:sup - shows superscript when only {p} | |||
-- Template:sub - shows subscript when only {b} | |||
-- {documentation} - to display the /doc subpage. | |||
-- | |||
-------------------------------------------------------------- | |||
--HISTORY: | |||
--09Apr08 Created for Template:PhysicsParticle & Template:val. | |||
--21Dec10 Display super/subscript together by vertical <br>. | |||
--21Dec10 New parameter fontsize=80% to alter font size. | |||
--21Dec10 Removed unnecessary "includeonly" tags. | |||
--21Dec10 Moved {documentation} to bottom as typical. | |||
--21Dec10 Added NOTES comments to explain template coding. | |||
--21Dec10 Added HISTORY comments to log major changes. | |||
-- | |||
-->{{documentation}}<!-- | |||
-- PLEASE ADD CATEGORIES & INTERWIKIS TO /doc SUBPAGE - NOT HERE. | |||
--></noinclude> |