Template>Edokter |
|
(37 intermediate revisions by 13 users not shown) |
Line 1: |
Line 1: |
| <includeonly>{{#if:{{{p|}}}
| | {{{{{|safesubst:}}}#invoke:Su|main}}<noinclude> |
| |{{#if:{{{b|}}}
| | {{documentation}} |
| |<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}}"><!--
| | <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> |
| --><span style="display:inline-block; vertical-align: -0.4em; line-height:1.3em; background:transparent;">{{{p}}}<br />{{{b}}}</span></span>
| | </noinclude> |
| |{{sup|{{{p|}}}}}
| |
| }}
| |
| |{{sub|{{{b|}}}}}
| |
| }}</includeonly><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>
| |