GeneralLatex symbol for vector magnitude

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
iperten
Posts: 40
Joined: Thu Jul 12, 2007 1:53 pm

Latex symbol for vector magnitude

Post by iperten »

Dear all,

is there anyone who knows the Latex symbol for a vector magnitude/length?

Thank you.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Latex symbol for vector magnitude

Post by localghost »

I'm not sure whether I understand you right. A vector is normally specified by a simple command from standard LaTeX.

Code: Select all

\vec{r}
This puts an arrow atop r which now symbolizes a vector. Another way would be the representation of a vector drawn from an initial point A to a terminal point B. This can be done by typing

Code: Select all

\overrightarrow{\text{AB}}
with the help of amsmath. The last point is the norm of a vector, the square root from the sum of its components. I suggest to define new commands (again with amsmath) in the preamble for an easier workflow.

Code: Select all

\newcommand{\abs}[1]{\lvert#1\rvert}
\newcommand{\norm}[1]{\lVert#1\rVert}
Test them and you will find out what is the right one for you. Examples can be

Code: Select all

\abs{\vec{r}}
\norm{\vec{r}}

Best Regards
Thorsten
iperten
Posts: 40
Joined: Thu Jul 12, 2007 1:53 pm

Re: Latex symbol for vector magnitude

Post by iperten »

Dear localghost,

this is exactly what I wished to hear. :)

Thank you.

Mattia.
Post Reply