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:
<noinclude>{{documentation}}<!--
{{#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><!--
PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS
--------------------------------------------------------------
Normally, the code for the template is included, but this template is too complex to do that.
--NOTES:
--></noinclude><includeonly>{{#if:{{{p|}}}|{{#if:{{{b|}}}|<span style="display:-moz-inline-box;-moz-box-orient:vertical;display:inline-block;vertical-align:bottom;min-height:1em;{{#ifeq:{{{w|}}}|f|font-family:monospace;}}font-size:80%;line-height:1;margin-bottom:-0.1em;overflow:visible;text-align:{{#switch:{{{a|}}}|r=right|c=center|left}}"><span style="display:block;min-height:1em;margin-top:-1.1em;line-height:1;background:transparent;overflow:visible">{{{p|super}}}</span><span style="display:block;min-height:1em;background:transparent;line-height:1;overflow:visible">{{{b|sub}}}</span></span>|{{sup|{{{p|}}}}}}}|{{sub|{{{b|}}}}}}}</includeonly>
--  [ 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>

Revision as of 09:03, 21 December 2010

super
sub