Mudanças entre as edições de "Predefinição:NumBlk/doc"
NumBlk>Cedar101 m (→Positioning relative to surrounding images: {{markupv}}) |
|||
Linha 143: | Linha 143: | ||
To illustrate, consider the example: | To illustrate, consider the example: | ||
− | < | + | {{markupv|m=<nowiki> |
+ | [[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)]] | [[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 | <br><br>A Bayesian network (or a belief network) is a probabilistic graphical model that represents a set of | ||
Linha 151: | Linha 152: | ||
{{NumBlk|1=:|2=<math> | {{NumBlk|1=:|2=<math> | ||
P(a, b, \lambda) = P(a| \lambda) P(b | \lambda) P(\lambda)\, | P(a, b, \lambda) = P(a| \lambda) P(b | \lambda) P(\lambda)\, | ||
− | </math>,|3='''Eq.(6)'''|RawN=.}}</ | + | </math>,|3='''Eq.(6)'''|RawN=.}}</nowiki> |
+ | |r= | ||
[[Image:Bnet_fan2.png|frame|right|Fig.1: Bayesian Network representation of Eq.(6)]] | [[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)]] | [[Image:Bnet_fan2.png|frame|left|Fig.1: Bayesian Network representation of Eq.(6)]] | ||
Linha 161: | Linha 163: | ||
P(a, b, \lambda) = P(a| \lambda) P(b | \lambda) P(\lambda)\, | P(a, b, \lambda) = P(a| \lambda) P(b | \lambda) P(\lambda)\, | ||
</math>,|3='''Eq.(6)'''|RawN=.}} | </math>,|3='''Eq.(6)'''|RawN=.}} | ||
+ | }} | ||
{{clear}} | {{clear}} | ||
If it is desirable for the numbered block to span the entire line, a {{tl|clear}} should be placed before it. | If it is desirable for the numbered block to span the entire line, a {{tl|clear}} should be placed before it. | ||
− | < | + | {{markupv|m=<nowiki> |
+ | [[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)]] | [[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 | <br><br>A Bayesian network (or a belief network) is a probabilistic graphical model that represents a set of | ||
Linha 172: | Linha 176: | ||
{{NumBlk|1=:|2=<math> | {{NumBlk|1=:|2=<math> | ||
P(a, b, \lambda) = P(a| \lambda) P(b | \lambda) P(\lambda)\, | P(a, b, \lambda) = P(a| \lambda) P(b | \lambda) P(\lambda)\, | ||
− | </math>,|3='''Eq.(6)'''|RawN=.}}</ | + | </math>,|3='''Eq.(6)'''|RawN=.}}</nowiki> |
+ | |r= | ||
[[Image:Bnet_fan2.png|frame|right|Fig.1: Bayesian Network representation of Eq.(6)]] | [[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)]] | [[Image:Bnet_fan2.png|frame|left|Fig.1: Bayesian Network representation of Eq.(6)]] | ||
Linha 184: | Linha 189: | ||
</math>,|3='''Eq.(6)'''|RawN=.}} | </math>,|3='''Eq.(6)'''|RawN=.}} | ||
{{clear}} | {{clear}} | ||
+ | }} | ||
== Table caveat == | == Table caveat == |
Edição das 04h34min de 25 de abril de 2017
This template creates a numbered block which is usually used to number mathematical formulae. This template can be used together with {{EquationRef}} and {{EquationNote}} to produce nicely formatted numbered equations if a back reference to an equation is wanted.
Índice
Parameters
Parameters {{{1}}}, {{{2}}}, and {{{3}}} of this template are required. In addition, there are three optional parameters {{{RawN}}}, {{{LnSty}}} and {{{Border}}}.
- {{{1}}}: Specify indentation. The more colons (:) you put, the further indented the block will be, up to a limit of 20. This parameter can be empty if no indentation is needed.
- {{{2}}}: The body or content of the block.
- {{{3}}}: Specify the block number.
- {{{RawN}}}: If a non-empty non-whitespace value, no extra formatting will be applied to the block number.
- {{{LnSty}}}: Specify the line style.
- {{{Border}}}: If set, put a box around the equation. (Experimental.)
Examples
Equations may render HTML | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
Indentation | |||||||||||||||
|
{{#if:|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if:::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
Formatting of equation number | |||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
Line style | |||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
| ||||||||||||||
Border | |||||||||||||||
|
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
|
Positioning relative to surrounding images
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.
To illustrate, consider the example:
{{#if: | |+ '}}Markup | [[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=.}} | |||||||
Renders as |
|
If it is desirable for the numbered block to span the entire line, a {{clear}} should be placed before it.
{{#if: | |+ '}}Markup | [[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. {{clear}} {{NumBlk|1=:|2= <math> P(a, b, \lambda) = P(a| \lambda) P(b | \lambda) P(\lambda)\, </math> ,|3='''Eq.(6)'''|RawN=.}} | |||||||
Renders as |
{{#if::|Erro de script: Nenhum módulo desse tipo "String".|}}
|
Table caveat
Because {{NumBlk}} is implemented as a table, putting {{NumBlk}} within a table yields a nested table. Due to a bug in MediaWiki's handling of nested tables, {{NumBlk}} must be used carefully in this case. In particular, when indentation for the outer table is desired, use explicit <dl><dd> and </dd></dl> tags for indentation instead of a leading colon (:).
For example,
-
[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)
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 shows how the outer <dl><dd> and </dd></dl> tags give the same indentation as a single colon (:) preceding the table should.
For another example,
-
-
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}})}}
-
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 uses two sets of explicit tags to give the same indentation as two colons (::).