Mudanças entre as edições de "NumBlk/doc"
NumBlk>Justin545 (→Table caveat: more precise desription. add another example.) |
NumBlk>TedPavlic m (→Table caveat: Copyedit.) |
||
Linha 82: | Linha 82: | ||
== Table caveat == | == Table caveat == | ||
− | + | Putting {{tl|NumBlk}} within a table yields [[Help:Table#Nested_tables|nested table]] because {{tl|NumBlk}} itself is implemented as a table. Due to a bug in [[Mediawiki]], {{tl|NumBlk}} must be used carefully inside tables. In particular, when indentation for outer table is desired, use explicit '''<nowiki><dl><dd></nowiki>''' and '''<nowiki></dl></dd></nowiki>''' tags instead of using colon (:) to indent. | |
For example, | For example, |
Edição das 13h49min de 5 de fevereiro de 2009
This template creates a numbered block which is usually used to number mathematical formulae.
Índice
Parameter
Parameters {{{1}}}, {{{2}}}, and {{{3}}} of this template are required. In addition, there are two optional parameters {{{RawN}}} and {{{LnSty}}}.
{{{1}}}: Specify indentation. The more colons (:) you put, the further indented the block will be. This parameter can be empty if no indentation is needed.
{{{2}}}: The body or content of the block.
{{{3}}}: Specify the block number.
{{{RawN}}}: Assigned with a non-empty or non-whitespaced string to remove the formatting on the number and the parentheses surround the number.
{{{LnSty}}}: Specify the line style.
{{{Border}}}: If set, put a box around the equation. (Experimental.)
Example
Equations may render HTML
{{NumBlk|:|<math>y=ax+b</math>|Eq. 3}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]y=ax+b[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:|Eq. 3|({{ safesubst:#if:1|Eq. 3}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|:|<math>ax^2+bx+c=0</math>|Eq. 3}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]ax^2+bx+c=0[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:|Eq. 3|({{ safesubst:#if:1|Eq. 3}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|:|<math>\Psi(x_1,x_2)=U(x_1)V(x_2)</math>|2}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\Psi(x_1,x_2)=U(x_1)V(x_2)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:|2|({{ safesubst:#if:1|2}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
Indentation
{{NumBlk||<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3.5}}
{{#if:|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:|3.5|({{ safesubst:#if:1|3.5}})}} |
{{#if:|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|:|<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|1}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:|1|({{ safesubst:#if:1|1}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|::|<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|13.7}}
{{#if:::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:|13.7|({{ safesubst:#if:1|13.7}})}} |
{{#if:::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|:::|<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|1.2}}
{{#if::::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:|1.2|({{ safesubst:#if:1|1.2}})}} |
{{#if::::|Erro de script: Nenhum módulo desse tipo "String".|}}
Number formatting
{{NumBlk|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=3.5|RawN=.}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:.|3.5|({{ safesubst:#if:1|3.5}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<3.5>|RawN=.}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:.|<3.5>|({{ safesubst:#if:1|<3.5>}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=[3.5]|RawN=.}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:.|[3.5]|({{ safesubst:#if:1|[3.5]}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3='''[3.5]'''|RawN=.}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:.|[3.5]|({{ safesubst:#if:1|[3.5]}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''[3.5]'''</Big>}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:|[3.5]|({{ safesubst:#if:1|[3.5]}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''[3.5]'''</Big>|RawN=.}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:.|[3.5]|({{ safesubst:#if:1|[3.5]}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
Line style
{{NumBlk|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''(3.5)'''</Big>|RawN=.|LnSty=1px dashed red}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:.|(3.5)|({{ safesubst:#if:1|(3.5)}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''(3.5)'''</Big>|RawN=.|LnSty=3px dashed #0a7392}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:.|(3.5)|({{ safesubst:#if:1|(3.5)}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''[3.5]'''</Big>|RawN=.|LnSty=3px solid green}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:.|[3.5]|({{ safesubst:#if:1|[3.5]}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''[3.5]'''</Big>|RawN=.|LnSty=5px dotted blue}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:.|[3.5]|({{ safesubst:#if:1|[3.5]}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''[3.5]'''</Big>|RawN=.|LnSty=0px solid green}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:.|[3.5]|({{ safesubst:#if:1|[3.5]}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''[3.5]'''</Big>|RawN=.|LnSty=5px none green}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:.|[3.5]|({{ safesubst:#if:1|[3.5]}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
{{NumBlk|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''[3.5]'''</Big>|RawN=.|LnSty=3px double green}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\bold{a}(t)=\frac{d}{dt}\bold{v}(t)[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:.|[3.5]|({{ safesubst:#if:1|[3.5]}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
Border
{{NumBlk|:|<math>y=ax+b</math>|Eq. 3|Border=1}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]y=ax+b[/math]
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:|Eq. 3|({{ safesubst:#if:1|Eq. 3}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
Work with float
Numbered blocks should be able to be placed around images that take up space on the left or right side of the screen. To ensure numbered block has access to the entire line, consider using a {{clear}}-like template.
[[Image:Bnet_fan2.png|frame|right|Fig.1: Bayesian Network representation of Eq.(6)]] [[Image:Bnet_fan2.png|frame|left|Fig.1: Bayesian Network representation of Eq.(6)]] <br><br>A Bayesian network (or a belief network) is a probabilistic graphical model that represents a set of variables and their probabilistic independencies. For example, a Bayesian network could represent the probabilistic relationships between diseases and symptoms. Given symptoms, the network can be used to compute the probabilities of the presence of various diseases. {{NumBlk|1=:|2=<math> P(a, b, \lambda) = P(a| \lambda) P(b | \lambda) P(\lambda)\, </math>,|3='''Eq.(6)'''|RawN=.}}
A Bayesian network (or a belief network) is a probabilistic graphical model that represents a set of
variables and their probabilistic independencies. For example, a Bayesian network could represent the
probabilistic relationships between diseases and symptoms. Given symptoms, the network can be used to compute
the probabilities of the presence of various diseases.
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]
P(a, b, \lambda) = P(a| \lambda) P(b | \lambda) P(\lambda)\,
[/math]
,
|
thin solid|none}}; padding:0.08em;"|
|
thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:.|Eq.(6)|({{ safesubst:#if:1|Eq.(6)}})}} |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
Table caveat
Putting {{NumBlk}} within a table yields nested table because {{NumBlk}} itself is implemented as a table. Due to a bug in Mediawiki, {{NumBlk}} must be used carefully inside tables. In particular, when indentation for outer table is desired, use explicit <dl><dd> and </dl> </dd> tags instead of using colon (:) to indent.
For example,
<dl><dd> {| |<math>(f * g)[n]\,</math> |{{NumBlk||<math>\stackrel{\mathrm{def}}{=}\sum_{m=-\infty}^{\infty} f[m]\cdot g[n - m]\,</math>| 3=<font color=darkred>'''(Eq.1)'''</font>|RawN=.}} |- | |<math>= \sum_{m=-\infty}^{\infty} f[n-m]\cdot g[m].\,</math> ([[Convolution#Commutativity|commutativity]]) |} </dd></dl>
produces
-
[math](f * g)[n]\,[/math] Erro de script: Nenhum módulo desse tipo "String".|}} thin solid|none}}; padding:0.08em;" class="nowrap"| [math]\stackrel{\mathrm{def}}{=}\sum_{m=-\infty}^{\infty} f[m]\cdot g[n - m]\,[/math]thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" rowspan="2"| thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" rowspan="2"| thin solid|none}}; border-top:0px none #e5e5e5; border-right:{{#if:|thin solid|none}}; border-bottom:{{#if:|thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:.|(Eq.1)|({{ safesubst:#if:1|(Eq.1)}})}}
[math]= \sum_{m=-\infty}^{\infty} f[n-m]\cdot g[m].\,[/math] (commutativity)
which gives the same indentation as a single colon (:). For another example,
<dl><dd> <dl><dd> {| |- |The first parameter for indentation still works when used inside table. {{NumBlk|::::|<math>ax^2+bx+c=0</math>|Level 4}} {{NumBlk|:::|<math>ax^2+bx+c=0</math>|Level 3}} {{NumBlk|::|<math>ax^2+bx+c=0</math>|Level 2}} {{NumBlk|:|<math>ax^2+bx+c=0</math>|Level 1}} {{NumBlk||<math>ax^2+bx+c=0</math>|Level 0}} |- |} </dd></dl> </dd></dl>
produces
-
-
The first parameter for indentation still works when used inside table. {{#if:::::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]ax^2+bx+c=0[/math]thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" rowspan="2"| thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" rowspan="2"| thin solid|none}}; border-top:0px none #e5e5e5; border-right:{{#if:|thin solid|none}}; border-bottom:{{#if:|thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:|Level 4|({{ safesubst:#if:1|Level 4}})}}
{{#if::::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]ax^2+bx+c=0[/math]thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" rowspan="2"| thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" rowspan="2"| thin solid|none}}; border-top:0px none #e5e5e5; border-right:{{#if:|thin solid|none}}; border-bottom:{{#if:|thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:|Level 3|({{ safesubst:#if:1|Level 3}})}}
{{#if:::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]ax^2+bx+c=0[/math]thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" rowspan="2"| thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" rowspan="2"| thin solid|none}}; border-top:0px none #e5e5e5; border-right:{{#if:|thin solid|none}}; border-bottom:{{#if:|thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:|Level 2|({{ safesubst:#if:1|Level 2}})}}
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]ax^2+bx+c=0[/math]thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" rowspan="2"| thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" rowspan="2"| thin solid|none}}; border-top:0px none #e5e5e5; border-right:{{#if:|thin solid|none}}; border-bottom:{{#if:|thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:|Level 1|({{ safesubst:#if:1|Level 1}})}}
{{#if:|Erro de script: Nenhum módulo desse tipo "String".|}}
thin solid|none}}; padding:0.08em;" class="nowrap"| [math]ax^2+bx+c=0[/math]thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" rowspan="2"| thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" rowspan="2"| thin solid|none}}; border-top:0px none #e5e5e5; border-right:{{#if:|thin solid|none}}; border-bottom:{{#if:|thin solid|none}}; padding:0.08em;"| thin solid|none}}; padding:0.08em;" class="nowrap"| {{#if:|Level 0|({{ safesubst:#if:1|Level 0}})}}
-
which gives the same indentation as two colons.