Difference between revisions of "Template:E/doc"

From Ava Zinn Wiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
(a slight rephrasing, categorization update)
m (68 revisions from wikipedia:Template:E/doc)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
 
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
 +
 
The {{tl|e}} and {{tl|10^}} templates are intended to facilitate and make uniform [[scientific notation]] numbers. The {{tl|10^}} template works exactly as described below except that it does not generate a multiplication (“×”) symbol.
 
The {{tl|e}} and {{tl|10^}} templates are intended to facilitate and make uniform [[scientific notation]] numbers. The {{tl|10^}} template works exactly as described below except that it does not generate a multiplication (“×”) symbol.
  
===Basic usage===
+
==Usage==
 
To render {{xt|3.14&nbsp;×&nbsp;10<sup>−12</sup>}}, instead of writing {{xt|<nowiki>3.14&amp;nbsp;×&amp;nbsp;10<sup>&amp;minus;12</sup></nowiki>}} you can write {{xt|<nowiki>3.14{{e|-12}}</nowiki>}}:
 
To render {{xt|3.14&nbsp;×&nbsp;10<sup>−12</sup>}}, instead of writing {{xt|<nowiki>3.14&amp;nbsp;×&amp;nbsp;10<sup>&amp;minus;12</sup></nowiki>}} you can write {{xt|<nowiki>3.14{{e|-12}}</nowiki>}}:
  
{{xpd5op3c|a|||||e|b|d=}}
+
{{#invoke:DemoTemplate|e|b}}
 +
 
 +
{{#invoke:DemoTemplate|10^|b}}
 +
 
 +
{{#invoke:DemoTemplate|10^|-12}}
 +
 
 +
The first output character for {{tlf|e}} is a non-breaking thin-space:
 +
 
 +
.<code><nowiki>{{e|b}}</nowiki></code>. &rarr; <code>.</code>{{e|b}}<code>.</code>
 +
 
 +
.<code><nowiki>{{10^|b}}</nowiki></code>. &rarr; <code>.</code>{{10^|b}}<code>.</code>
  
{{xpd5op3c||||||10^|b|d=}}
+
.<code><nowiki>{{10^|-12}}</nowiki></code>. &rarr; <code>.</code>{{10^|-12}}<code>.</code>
  
{{xpd5op3c||||||10^|-12|d=}}
+
===Delimiters===
  
===Delimitation===
+
The template uses gaps or commas, per {{tl|val/delimitnum}}.<br />
The template uses the delimitation logic of the {{tl|val}} template, i.e. typing {{xt|<nowiki>1.2{{e|12341}}</nowiki>}} will produce a delimited exponent ({{xt|1.2{{e|12341}}}}). See ''[[#Forcing text display]]'' to turn this off.
+
{{xt|<nowiki>1.2{{e|12341}}</nowiki>}} &rarr; {{xt|1.2{{e|12341}}}}.  
  
=== Text and number recognition ===
+
See ''[[#Forcing text display]]'' to turn this off.
 +
 
 +
===Text and number recognition===
 
By default, the template recognizes both text and numbers. That is, typing {{xt|<nowiki>3.14{{e|-12}}</nowiki>}}  will produce {{xt|3.14{{e|-12}}}}, with the proper [[minus sign]] ({{xt|&minus;}}), rather than with a [[hyphen]] ({{xt|-}}). However, typing {{xt|<nowiki>A{{e|-BC}}</nowiki>}} will produce {{xt|A{{e|-BC}}}} since {{xt|BC}} is not a number. In those cases, you need to write {{xt|<nowiki>A{{e|&amp;minus;BC}}</nowiki>}} to produce the correct {{xt|A{{e|&minus;BC}}}}.
 
By default, the template recognizes both text and numbers. That is, typing {{xt|<nowiki>3.14{{e|-12}}</nowiki>}}  will produce {{xt|3.14{{e|-12}}}}, with the proper [[minus sign]] ({{xt|&minus;}}), rather than with a [[hyphen]] ({{xt|-}}). However, typing {{xt|<nowiki>A{{e|-BC}}</nowiki>}} will produce {{xt|A{{e|-BC}}}} since {{xt|BC}} is not a number. In those cases, you need to write {{xt|<nowiki>A{{e|&amp;minus;BC}}</nowiki>}} to produce the correct {{xt|A{{e|&minus;BC}}}}.
  
 
A minus sign also has to be provided for cases like {{xt|1.2{{e|1 &minus; 2}}}} ({{xt|<nowiki>1.2{{e|1 &amp;minus; 2}}</nowiki>}}).
 
A minus sign also has to be provided for cases like {{xt|1.2{{e|1 &minus; 2}}}} ({{xt|<nowiki>1.2{{e|1 &amp;minus; 2}}</nowiki>}}).
  
=== Explicit plus sign ===
+
===Explicit plus sign===
 
To explicitly display the {{xt|+}} character, write {{xt|<nowiki>1.2{{e|4|plus}}</nowiki>}} which will produce {{xt|1.2{{e|&#43;4}}}}.
 
To explicitly display the {{xt|+}} character, write {{xt|<nowiki>1.2{{e|4|plus}}</nowiki>}} which will produce {{xt|1.2{{e|&#43;4}}}}.
  
=== Forcing text display ===
+
===Forcing text display===
To force the template to display the input as text, and forgo the automatic delimitation and the recognition of the hyphen as a minus sign, write {{xt|<nowiki>1.2{{e|-42342|text}}</nowiki>}}, which will display {{xt|1.2&nbsp;&times;&nbsp;10<sup>-42342</sup>}} instead of {{xt|1.2{{e|-42342}}}}. This can also be used as an alternative to explicitly display the plus sign ({{xt|<nowiki>1.2{{e|+4|text}}</nowiki>}} gives {{xt|1.2{{e|&#43;4}}}}), but remember that you also lose delimitation if you do it this way.
+
To force the template to display the input as text, and forgo the automatic delimitation and the recognition of the hyphen as a minus sign, write {{xt|<nowiki>1.2{{e|-42342|text}}</nowiki>}}, which will display {{xt|1.2&nbsp;&times;&nbsp;10<sup>−42342</sup>}} instead of {{xt|1.2{{e|-42342}}}}. This can also be used as an alternative to explicitly display the plus sign ({{xt|<nowiki>1.2{{e|+4|text}}</nowiki>}} gives {{xt|1.2{{e|&#43;4}}}}), but remember that you also lose delimitation if you do it this way.
  
=== See also ===
+
== Tracking category ==
 +
[[:Category:Articles using E without any arguments]] is a hidden category which may be added to pages using [[Template:E]].
 +
 
 +
==See also==
 
* [[m:Template:e]]
 
* [[m:Template:e]]
 +
* {{tl|e-sp}}, a more spaced version of {{tl|e}}.
 
* {{tl|val}}
 
* {{tl|val}}
 
* {{tl|scinote}}
 
* {{tl|scinote}}
* {{tl|esp}}, a spaced version of this template.
+
 
* {{tl|Sup/sub-related templates}}
+
 
 +
{{Sup and sub-related templates}}
  
 
<includeonly>
 
<includeonly>
Line 37: Line 55:
 
[[Category:Mathematical formatting templates]]
 
[[Category:Mathematical formatting templates]]
 
[[Category:Superscript and subscript templates]]
 
[[Category:Superscript and subscript templates]]
 +
[[Category:Templates that add a tracking category]]
  
[[bn:টেমপ্লেট:E]]
 
 
</includeonly>
 
</includeonly>

Latest revision as of 08:51, 15 March 2016

The {{e}} and {{10^}} templates are intended to facilitate and make uniform scientific notation numbers. The {{10^}} template works exactly as described below except that it does not generate a multiplication (“×”) symbol.

Usage[edit]

To render Template:Xt, instead of writing Template:Xt you can write Template:Xt:

{{#invoke:DemoTemplate|e|b}}

{{#invoke:DemoTemplate|10^|b}}

{{#invoke:DemoTemplate|10^|-12}}

The first output character for {{e}} is a non-breaking thin-space:

.{{e|b}}. → .×10Template:Val/delimitnum.

.{{10^|b}}. → .Template:10^.

.{{10^|-12}}. → .Template:10^.

Delimiters[edit]

The template uses gaps or commas, per {{val/delimitnum}}.
Template:XtTemplate:Xt.

See #Forcing text display to turn this off.

Text and number recognition[edit]

By default, the template recognizes both text and numbers. That is, typing Template:Xt will produce Template:Xt, with the proper minus sign (Template:Xt), rather than with a hyphen (Template:Xt). However, typing Template:Xt will produce Template:Xt since Template:Xt is not a number. In those cases, you need to write Template:Xt to produce the correct Template:Xt.

A minus sign also has to be provided for cases like Template:Xt (Template:Xt).

Explicit plus sign[edit]

To explicitly display the Template:Xt character, write Template:Xt which will produce Template:Xt.

Forcing text display[edit]

To force the template to display the input as text, and forgo the automatic delimitation and the recognition of the hyphen as a minus sign, write Template:Xt, which will display Template:Xt instead of Template:Xt. This can also be used as an alternative to explicitly display the plus sign (Template:Xt gives Template:Xt), but remember that you also lose delimitation if you do it this way.

Tracking category[edit]

Category:Articles using E without any arguments is a hidden category which may be added to pages using Template:E.

See also[edit]


Template:Sup and sub-related templates