Template:Unit/doc: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Chris Day
No edit summary
imported>David Yamakuchi
mNo edit summary
Line 1: Line 1:
<big>'''Usage'''</big>
== Usage ==
__NOEDITSECTION__
This template is multi-purpose:
This template is multi-purpose:


Line 18: Line 17:


{{Unit|kJ/mol}}
{{Unit|kJ/mol}}
== Code ==
<pre><includeonly>{{#switch: {{SUBPAGENAME}}
|Doc
|doc
|Properties='''''<small>{{{1|}}}</small>'''''{{#if:{{{2|}}}|<nowiki>*</nowiki>}}{{#if:{{{3|}}}|<sup><small>†</small></sup>}}{{#if:{{{4|}}}|<sup><small>‡</small></sup>}}
|Sandbox=
|Data=
|{{BASEPAGENAME}}='''''<small>{{{1|}}}</small>'''''{{#if:{{{2|}}}|<nowiki>*</nowiki>}}
|'''''<small>{{{1|}}}</small>'''''{{#if:{{{2|}}}|<nowiki>*</nowiki>}}{{#if:{{{3|}}}|<sup>†</sup>}}{{#if:{{{4|}}}|<sup>‡</sup>}}{{#if:{{{2|}}}|<br /><nowiki>*</nowiki>{{{2|}}}}}{{#if:{{{3|}}}|<br />†{{{3|}}}}}{{#if:{{{4|}}}|<br />‡{{{4|}}}}}
}}</includeonly><noinclude>{{TlDoc}}</noinclude></pre>
Explanation of code:
The behavior is controlled by the SUBPAGENAME. 
In the case of SUBPAGENAME = BASEPAGENAME , we are '''''in''''' an article.  Just show a small, bold, italicized, unit with an asterisk if there is a note (#if: <nowiki>{{{2|}}}</nowiki>).

Revision as of 05:26, 16 December 2008

Usage

This template is multi-purpose:

  1. Format the units notation such that it can be compactly displayed in tables, etc.
  2. Remove the units for certain pages (currently /Sandbox and /Data pages) that may need to do math with the numeric (magnitude) value.
  3. Specify conditions under which the data is valid.

Please see Oxygen/Boiling_point, {{Unit/Doc/Properties}}, and {{Unit/Doc/Data}} for examples of usage in context.

{{Unit|kJ/mol}}

Example:

{{Unit|kJ/mol}}

gives:

kJ/mol

Code

<includeonly>{{#switch: {{SUBPAGENAME}}
|Doc
|doc
|Properties='''''<small>{{{1|}}}</small>'''''{{#if:{{{2|}}}|*}}{{#if:{{{3|}}}|<sup><small>†</small></sup>}}{{#if:{{{4|}}}|<sup><small>‡</small></sup>}}
|Sandbox=
|Data=
|{{BASEPAGENAME}}='''''<small>{{{1|}}}</small>'''''{{#if:{{{2|}}}|*}}
|'''''<small>{{{1|}}}</small>'''''{{#if:{{{2|}}}|*}}{{#if:{{{3|}}}|<sup>†</sup>}}{{#if:{{{4|}}}|<sup>‡</sup>}}{{#if:{{{2|}}}|<br />*{{{2|}}}}}{{#if:{{{3|}}}|<br />†{{{3|}}}}}{{#if:{{{4|}}}|<br />‡{{{4|}}}}}
}}</includeonly><noinclude>{{TlDoc}}</noinclude>

Explanation of code:

The behavior is controlled by the SUBPAGENAME.

In the case of SUBPAGENAME = BASEPAGENAME , we are in an article. Just show a small, bold, italicized, unit with an asterisk if there is a note (#if: {{{2|}}}).