This site is supported by donations to The OEIS Foundation.

Template:Vec/doc

From OeisWiki
Jump to: navigation, search

This documentation subpage contains instructions, categories, or other information for Template:Vec. [<Edit> Template:Vec]

[⧼Purge⧽ Template:Vec/doc]

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

  • e.g. E (default is A)

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}} |&&}}
A
{{math| {{vec|A|o}} |&&}}
A
{{math| {{vec|A|u}} |&&}}
A
Right arrow {{math| {{vec|v|->}} |&&}}
v
{{math| {{vec|v|o ->}} |&&}}
v
{{math| {{vec|v|u ->}} |&&}}
v
Left arrow {{math| {{vec|A|<-}} |&&}}
A
{{math| {{vec|A|o <-}} |&&}}
A
{{math| {{vec|A|u <-}} |&&}}
A
Left-right arrow {{math| {{vec|A|<->}} |&&}}
A
{{math| {{vec|A|o <->}} |&&}}
A
{{math| {{vec|A|u <->}} |&&}}
A

Notation Code Result Code Result Code Result
Boldface {{math| {{vec|A|b}} |&&}}
A
{{math| {{vec|v|b}} |&&}}
v
{{math| {{vec|p|b}} |&&}}
p
      " {{math| {{vec|A|bold}} |&&}}
A
{{math| {{vec|v|bold}} |&&}}
v
{{math| {{vec|p|bold}} |&&}}
p
Unit vectors {{math| {{vec|i|^}} |&&}}
𝚤̂
{{math| {{vec|j|^}} |&&}}
𝚥̂
{{math| {{vec|k|^}} |&&}}
k̂
      " {{math| {{vec|i|^}} |&}}
𝚤̂
{{math| {{vec|j|^}} |&}}
𝚥̂
{{math| {{vec|k|^}} |&}}
k̂
      " {{math| {{vec|e|^}}{{sub|1}} |&&}}
ê1
{{math| {{vec|e|^}}{{sub|2}} |&&}}
ê2
{{math| {{vec|e|^}}{{sub|3}} |&&}}
ê3
      " {{math| {{vec|i|unit}} |&&}}
𝚤̂
{{math| {{vec|j|unit}} |&&}}
𝚥̂
{{math| {{vec|k|unit}} |&&}}
k̂

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 
u
: inline as 
ω =  ×  u
, or display style
ω = × u
Tangential velocity in rigid body dynamics: inline as 
v = ω  ×  r
, or display style
v = ω × r
Rotating reference frame: inline as 
d'A
dt
=
d'A
dt
 −  ω  ×  A
, or display style
d'A
dt
=
d'A
dt
ω × A

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)