Шаблон:Нумерованная формула/doc

Материал из Википедии — свободной энциклопедии
Перейти к навигации Перейти к поиску

Этот шаблон создаёт нумерованные формулы.

Параметры[править код]

Параметры {{{1}}}, {{{2}}}, и {{{3}}} шаблона обязательны. Дополнительно, есть две возможных опции {{{RawN}}} и {{{LnSty}}}.
{{{1}}}: Определяет отступ. Чем больше здесь двоеточий (:), тем дальше вправо сдвинется блок. Поддерживается не более 20 двоеточий. Этот параметр может быть пустой.
{{{2}}}: Сама формула, оформленная тэгами <math> или <chem>.
{{{3}}}: Номер формулы.
{{{RawN}}}: Если непустой, то убирает скобки и форматирование номера формулы.
{{{LnSty}}}: Стиль линии.

Примеры[править код]

Equations may render HTML[править код]

{{Нумерованная формула|:|<math>y=ax+b</math>|Eq. 3}}

 

 

 

 

(Eq. 3)

{{Нумерованная формула|:|<math>ax^2+bx+c=0</math>|Eq. 3}}

 

 

 

 

(Eq. 3)

{{Нумерованная формула|:|<math>\Psi(x_1,x_2)=U(x_1)V(x_2)</math>|2}}

 

 

 

 

(2)

Абзац[править код]

{{Нумерованная формула||<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3.5}}

 

 

 

 

(3.5)

{{Нумерованная формула|:|<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|1}}

 

 

 

 

(1)

{{Нумерованная формула|::|<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|13.7}}

 

 

 

 

(13.7)

{{Нумерованная формула|:::|<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|1.2}}

 

 

 

 

(1.2)

Форматирование номера формулы[править код]

{{Нумерованная формула|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=3.5|RawN=.}}

 

 

 

 

3.5

{{Нумерованная формула|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<3.5>|RawN=.}}

 

 

 

 

<3.5>

{{Нумерованная формула|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=[3.5]|RawN=.}}

 

 

 

 

[3.5]

{{Нумерованная формула|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3='''[3.5]'''|RawN=.}}

 

 

 

 

[3.5]

{{Нумерованная формула|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''[3.5]'''</Big>}}

 

 

 

 

([3.5])

{{Нумерованная формула|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''[3.5]'''</Big>|RawN=.}}

 

 

 

 

[3.5]

{{Нумерованная формула|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<math>(3.5)</math>|RawN=.}}

 

 

 

 

Стиль линий[править код]

{{Нумерованная формула|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''(3.5)'''</Big>|RawN=.|LnSty=1px dashed red}}

 

 

 

 

(3.5)

{{Нумерованная формула|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''(3.5)'''</Big>|RawN=.|LnSty=3px dashed #0a7392}}

 

 

 

 

(3.5)

{{Нумерованная формула|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''[3.5]'''</Big>|RawN=.|LnSty=3px solid green}}

 

 

 

 

[3.5]

{{Нумерованная формула|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''[3.5]'''</Big>|RawN=.|LnSty=5px dotted blue}}

 

 

 

 

[3.5]

{{Нумерованная формула|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''[3.5]'''</Big>|RawN=.|LnSty=0px solid green}}

 

 

 

 

[3.5]

{{Нумерованная формула|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''[3.5]'''</Big>|RawN=.|LnSty=5px none green}}

 

 

 

 

[3.5]

{{Нумерованная формула|1=:|2=<math>\bold{a}(t)=\frac{d}{dt}\bold{v}(t)</math>|3=<Big>'''[3.5]'''</Big>|RawN=.|LnSty=3px double green}}

 

 

 

 

[3.5]

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:

<!-- [[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.
{{Нумерованная формула|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.

,

 

 

 

 

Eq.(6)

If it is desirable for the numbered block to span the entire line, a {{clear}} should be placed before it.

<!-- [[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}}
{{Нумерованная формула|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.

,

 

 

 

 

Eq.(6)

Table caveat[править код]

Because {{Нумерованная формула}} is implemented as a table, putting {{Нумерованная формула}} within a table yields a nested table. Due to a bug in Mediawiki's handling of nested tables, {{Нумерованная формула}} 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,

<dl><dd>
{|
|<math>(f * g)[n]\,</math>      
|{{Нумерованная формула||<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

     

 

 

 

 

(Eq.1)

      (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,

<dl><dd>
<dl><dd>
{|
|-
|The first parameter for indentation still works when used inside table.
{{Нумерованная формула|::::|<math>ax^2+bx+c=0</math>|Level 4}}
{{Нумерованная формула|:::|<math>ax^2+bx+c=0</math>|Level 3}}
{{Нумерованная формула|::|<math>ax^2+bx+c=0</math>|Level 2}}
{{Нумерованная формула|:|<math>ax^2+bx+c=0</math>|Level 1}}
{{Нумерованная формула||<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.

 

 

 

 

(Level 4)

 

 

 

 

(Level 3)

 

 

 

 

(Level 2)

 

 

 

 

(Level 1)

 

 

 

 

(Level 0)

which uses two sets of explicit tags to give the same indentation as two colons (::).