The {{vec}} mathematical formatting template typesets vectors using overscript [right arrow] notation (as an alternative to boldface notation, which is an option), unit vectors using [hat] notation, rays (i.e. half-lines) using overscript/underscript [either left arrow or right arrow] notation and lines using overscript/underscript [left-right arrow] notation. You may choose to obtain either HTML+CSS or LaTeX.
Usage
- {{vec|vector/ray/line symbol|notation|format}}
where the first parameter (vector/ray/line symbol) is the base character
and the second parameter (notation) is among
- -> or o or o -> (overscript right arrow) (default)
- <- or o <- (overscript left arrow)
- <-> or o <-> (overscript left-right arrow)
- u or u -> (underscript right arrow)
- u <- (underscript left arrow)
- u <-> (underscript left-right arrow)
- b or bold (for vectors using bold notation, the base character being set in [non-italic] boldface)
- ^ or unit (for unit vectors using [hat] notation, the base character being set in italic boldface)
and the third parameter (format) is among (case insensitive)
- h or htm (default)
- t or tex
Notes
- Must be used inside the {{math}} template, since the fine tuning (tweaking) is optimized for it.
- The default for notation is set to match the LaTeX analogue
\vec{A}
: .
- With arrow notation, the base character is automatically set in italic.
- With bold notation, the base character is automatically set in [non italic] bold.
- With unit vector [hat] notation, the base character is automatically set in italic boldface.
Examples
HTML+CSS examples
Notation
|
Code
|
Result
|
Code
|
Result
|
Code
|
Result
|
Default
|
{{math| {{vec|A}} |&&}} |
|
{{math| {{vec|A|o}} |&&}} |
|
{{math| {{vec|A|u}} |&&}} |
|
Right arrow
|
{{math| {{vec|v|->}} |&&}} |
|
{{math| {{vec|v|o ->}} |&&}} |
|
{{math| {{vec|v|u ->}} |&&}} |
|
Left arrow
|
{{math| {{vec|A|<-}} |&&}} |
|
{{math| {{vec|A|o <-}} |&&}} |
|
{{math| {{vec|A|u <-}} |&&}} |
|
Left-right arrow
|
{{math| {{vec|A|<->}} |&&}} |
|
{{math| {{vec|A|o <->}} |&&}} |
|
{{math| {{vec|A|u <->}} |&&}} |
|
Notation
|
Code
|
Result
|
Code
|
Result
|
Code
|
Result
|
Boldface
|
{{math| {{vec|A|b}} |&&}} |
|
{{math| {{vec|v|b}} |&&}} |
|
{{math| {{vec|p|b}} |&&}} |
|
"
|
{{math| {{vec|A|bold}} |&&}} |
|
{{math| {{vec|v|bold}} |&&}} |
|
{{math| {{vec|p|bold}} |&&}} |
|
Unit vectors
|
{{math| {{vec|i|^}} |&&}} |
|
{{math| {{vec|j|^}} |&&}} |
|
{{math| {{vec|k|^}} |&&}} |
|
"
|
{{math| {{vec|i|^}} |&}} |
|
{{math| {{vec|j|^}} |&}} |
|
{{math| {{vec|k|^}} |&}} |
|
"
|
{{math| {{vec|e|^}}{{sub|1}} |&&}} |
|
{{math| {{vec|e|^}}{{sub|2}} |&&}} |
|
{{math| {{vec|e|^}}{{sub|3}} |&&}} |
|
"
|
{{math| {{vec|i|unit}} |&&}} |
|
{{math| {{vec|j|unit}} |&&}} |
|
{{math| {{vec|k|unit}} |&&}} |
|
TeX examples
Notation
|
Code
|
Result
|
Code
|
Result
|
Code
|
Result
|
Default
|
{{math| {{vec|A||tex}} |$$}} |
|
{{math| {{vec|A|o|tex}} |$$}} |
|
{{math| {{vec|A|u|tex}} |$$}} |
|
Right arrow
|
{{math| {{vec|v|->|tex}} |$$}} |
|
{{math| {{vec|v|o ->|tex}} |$$}} |
|
{{math| {{vec|v|u ->|tex}} |$$}} |
|
Left arrow
|
{{math| {{vec|A|<-|tex}} |$$}} |
|
{{math| {{vec|A|o <-|tex}} |$$}} |
|
{{math| {{vec|A|u <-|tex}} |$$}} |
|
Left-right arrow
|
{{math| {{vec|A|<->|tex}} |$$}} |
|
{{math| {{vec|A|o <->|tex}} |$$}} |
|
{{math| {{vec|A|u <->|tex}} |$$}} |
|
Notation
|
Code
|
Result
|
Code
|
Result
|
Code
|
Result
|
Boldface
|
{{math| {{vec|A|b|tex}} |$$}} |
|
{{math| {{vec|v|b|tex}} |$$}} |
|
{{math| {{vec|p|b|tex}} |$$}} |
|
"
|
{{math| {{vec|A|bold|tex}} |$$}} |
|
{{math| {{vec|v|bold|tex}} |$$}} |
|
{{math| {{vec|p|bold|tex}} |$$}} |
|
Unit vectors
|
{{math| {{vec|i|^|tex}} |$$}} |
|
{{math| {{vec|j|^|tex}} |$$}} |
|
{{math| {{vec|k|^|tex}} |$$}} |
|
"
|
{{math| {{vec|i|^|tex}} |$}} |
|
{{math| {{vec|j|^|tex}} |$}} |
|
{{math| {{vec|k|^|tex}} |$}} |
|
"
|
{{math| {{vec|e|^|tex}}{{sub|1|tex}} |$$}} |
|
{{math| {{vec|e|^|tex}}{{sub|2|tex}} |$$}} |
|
{{math| {{vec|e|^|tex}}{{sub|3|tex}} |$$}} |
|
"
|
{{math| {{vec|i|unit|tex}} |$$}} |
|
{{math| {{vec|j|unit|tex}} |$$}} |
|
{{math| {{vec|k|unit|tex}} |$$}} |
|
Formulae examples
The code
Vorticity of a fluid with velocity field {{math|{{vec|u}}|&}}: inline as <!--
-->{{math|{{vec|{{Greek|omega}}}} {{=}} {{vec|{{op|nabla}}|b}} {{op|times}} {{vec|u}}|&}}, or display style
: {{math|{{vec|{{Greek|omega}}}} {{=}} {{vec|{{op|nabla}}|b}} {{op|times}} {{vec|u}}|&&}}
Tangential velocity in rigid body dynamics: inline as <!--
-->{{math|{{vec|v}} {{=}} {{vec|{{Greek|omega}}}} {{op|times}} {{vec|r}}|&}}, or display style
: {{math|{{vec|v}} {{=}} {{vec|{{Greek|omega}}}} {{op|times}} {{vec|r}}|&&}}
Rotating reference frame: inline as <!--
-->{{math|{{frac|''d''{{vec|A}}{{sym|prime}}|''dt''|HTM}} {{=}}
{{frac|''d''{{vec|A}}|''dt''|HTM}} {{op|-}} {{vec|{{Greek|omega}}}} {{op|times}} {{vec|A}}|&}}, or display style
: {{math|{{frac|''d''{{vec|A}}{{sym|prime}}|''dt''|HTM}} {{=}}
{{frac|''d''{{vec|A}}|''dt''|HTM}} {{op|-}} {{vec|{{Greek|omega}}}} {{op|times}} {{vec|A}}|&&}}
yields the HTML+CSS formatted
Vorticity of a fluid with velocity field
: inline as
, or display style
Tangential velocity in rigid body dynamics: inline as
, or display style
Rotating reference frame: inline as
, or display style
-
while the code
Vorticity of a fluid with velocity field {{math|{{vec|u||tex}}|$}}: inline as <!--
-->{{math|{{vec|{{Greek|omega|tex}}||tex}} {{=}} {{vec|{{op|nabla|tex}}|b|tex}} {{op|times|tex}} {{vec|u||tex}}|$}}, or display style
: {{math|{{vec|{{Greek|omega|tex}}||tex}} {{=}} {{vec|{{op|nabla|tex}}|b|tex}} {{op|times|tex}} {{vec|u||tex}}|$$}}
Tangential velocity in rigid body dynamics: inline as <!--
-->{{math|{{vec|v||tex}} {{=}} {{vec|{{Greek|omega|tex}}||tex}} {{op|times|tex}} {{vec|r||tex}}|$}}, or display style
: {{math|{{vec|v||tex}} {{=}} {{vec|{{Greek|omega|tex}}||tex}} {{op|times|tex}} {{vec|r||tex}}|$$}}
Rotating reference frame: inline as <!--
-->{{math|{{frac|''d''{{vec|A||tex}}{{sym|prime|tex}}|''dt''|TEX}} {{=}}
{{frac|''d''{{vec|A||tex}}|''dt''|TEX}} {{op|-|tex}} {{vec|{{Greek|omega|tex}}||tex}} {{op|times|tex}} {{vec|A||tex}}|$}}, or display style
: {{math|{{frac|''d''{{vec|A||tex}}{{sym|prime|tex}}|''dt''|TEX}} {{=}}
{{frac|''d''{{vec|A||tex}}|''dt''|TEX}} {{op|-|tex}} {{vec|{{Greek|omega|tex}}||tex}} {{op|times|tex}} {{vec|A||tex}}|$$}}
yields the LaTeX formatted
Vorticity of a fluid with velocity field: inline as, or display style
Tangential velocity in rigid body dynamics: inline as, or display style
Rotating reference frame: inline as, or display style
See also
- {{overset}} and {{underset}} (for more general templates, allowing arbitrary characters and diacritics set over or under the base character)x→