9

How do I make a symbol for the length of a line or vector? I intend the following notation: |AD| is the length of AD. I can't find this symbol anywhere. (When I use shift+backslash in LaTeX, it gives a horizontal line).

For some reason the \cdot also doesn't seem to work, when I write it down like this:

&|AD| \cdot |BD|& = ...

So can anyone please tell me what I am doing wrong?

egreg
  • 1,121,712

2 Answers2

7

Usually you use \[ \lvert AD \rvert \cdot \lvert BD \rvert \] relying on the amsmath package for this task. Often people wrap this into a macro called \abs or \norm like this:

\documentclass{article}
\usepackage{amsmath}

\newcommand{\norm}[1]{\lvert #1 \rvert}

\begin{document}
\[
    \norm{AD}\cdot\norm{BD}
\]
\[
    \lvert AD \rvert \cdot \lvert BD \rvert
\]
\end{document}
Ruben
  • 13,448
3

You can use |, as you wish, but in the math mode: $|AD|\cdot|CD|$. The same character from a keyboard gives in text mode horizontal line (em dash, in fact).

  • Ow!! I've just discovered that the vertical bar in text mode produces an em dash line... lol – Sigur Nov 07 '13 at 15:36