Template:DisplayEquation: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(→Bugs) |
||
(59 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
< | <includeonly>{|border="0" align="center" | ||
== | |- | ||
{{DisplayEquation|eqn=a^2+b^2=c^2|no= | <!-- Spaces between braces are important in next line --> | ||
{{DisplayEquation|eqn=a | |align="center" width={{{width|610}}}|{{#if:{{{eqn|}}}|{{#tag:math|\displaystyle{ {{{eqn}}} } }}| }} | ||
|align="left" width="40"|{{#if:{{{no|}}}|{{#tag:math|\left({{{no}}}\right)}}| }} | |||
|}</includeonly><noinclude> | |||
The template takes three named parameters, ''width'', ''eqn'' and ''no'', being the | |||
equation width (default 610 pixels), LaTeX expression and the equation number respectively. | |||
All parameters are optional, but only two combinations of ''eqn'' and ''no'' are useful: | |||
<pre>{{DisplayEquation|eqn=a^2+b^2=c^2}}</pre> {{DisplayEquation|eqn=a^2+b^2=c^2}} | |||
<pre>{{DisplayEquation|no=28|eqn=\frac{\partial\rho Y_k}{\partial t} | |||
+\frac{\partial\rho u_iY_k}{\partial x_i}= | |||
\frac{\partial}{\partial x_i}\left(\rho D_k\frac{\partial Y_k}{\partial x_i}\right) | |||
+\dot{\omega}_k\qquad \text{for } k=1,2,\dots,N}}</pre> | |||
{{DisplayEquation|no=28|eqn=\frac{\partial\rho Y_k}{\partial t} | |||
+\frac{\partial\rho u_iY_k}{\partial x_i}= | |||
\frac{\partial}{\partial x_i}\left(\rho D_k\frac{\partial Y_k}{\partial x_i}\right) | |||
+\dot{\omega}_k\qquad \text{for } k=1,2,\dots,N}} | |||
Note that equation labelling is not restricted to numbers: | |||
<pre>{{DisplayEquation|no=\text{axiom }M3|width=300|eqn=\rho(a,c)\le\rho(a,b)+\rho(b,c)}}</pre> | |||
{{DisplayEquation|no=\text{axiom }M3|width=300|eqn=\rho(a,c)\le\rho(a,b)+\rho(b,c)}} | |||
==Bugs== | |||
* Do not break an equation line at an equals sign. Break it somewhere else or use the [[Template:=|equals sign]] template. | |||
* It may be necessary to separate off the closing double right braces of the template by a space from preceding right braces in the LaTeX source. | |||
* Subscripts of more than one character (enclosed in braces) may cause problems; spaces between double braces are called for. See [[UFR_4-09_Best_Practice_Advice#Appendix:_details_of_turbulence_models|equation (A8)]] in UFR4-09 for an example. | |||
* Vertical bars must be specified with the \vert family, to avoid confusion with template parameter introducers. | |||
* Most problems seem to be associated with double right-hand braces --- insert spaces | |||
</noinclude> | </noinclude> | ||
Latest revision as of 12:39, 27 September 2011
The template takes three named parameters, width, eqn and no, being the equation width (default 610 pixels), LaTeX expression and the equation number respectively. All parameters are optional, but only two combinations of eqn and no are useful:
{{DisplayEquation|eqn=a^2+b^2=c^2}}
{{DisplayEquation|no=28|eqn=\frac{\partial\rho Y_k}{\partial t} +\frac{\partial\rho u_iY_k}{\partial x_i}= \frac{\partial}{\partial x_i}\left(\rho D_k\frac{\partial Y_k}{\partial x_i}\right) +\dot{\omega}_k\qquad \text{for } k=1,2,\dots,N}}
Note that equation labelling is not restricted to numbers:
{{DisplayEquation|no=\text{axiom }M3|width=300|eqn=\rho(a,c)\le\rho(a,b)+\rho(b,c)}}
Bugs
- Do not break an equation line at an equals sign. Break it somewhere else or use the equals sign template.
- It may be necessary to separate off the closing double right braces of the template by a space from preceding right braces in the LaTeX source.
- Subscripts of more than one character (enclosed in braces) may cause problems; spaces between double braces are called for. See equation (A8) in UFR4-09 for an example.
- Vertical bars must be specified with the \vert family, to avoid confusion with template parameter introducers.
- Most problems seem to be associated with double right-hand braces --- insert spaces