# Latex vector notation.

1. Sep 20, 2007

### IlyaZ

1. The problem statement, all variables and given/known data
a. How do I write vectors bold within displaymath and frac. I want Phi, r and r_1 bold. But get G M_1 bold as well = bad.
b. How do I use arrows instead of the bold notation?

3. The attempt at a solution
\begin{displaymath}
a1. textbf{\Phi(r)} = -\frac{G M_1}{| textbf{r}-textbf{r_1} |}
\end{displaymath}
a2. \bf{\Phi}(\bf{r}) = -\frac{G M_1}{| \bf{r}-\bf{r_1} |}

2. Sep 20, 2007

### Timo

Arrows: \vec : $$\vec \Phi ( \vec r) = -\frac{G M_1}{| \vec{r}-\vec r_1 |}$$
Bold: \mathbf : $$\mathbf{\Phi}( \mathbf{r}) = -\frac{G M_1}{| \mathbf{r}-\mathbf{r_1} |}$$

I don't think you really want the potential to be a vector, but that's what your code implied, so I kept it.

Last edited: Sep 20, 2007
3. Sep 20, 2007

### D H

Staff Emeritus
You get other bad stuff as well using \textbf. Don't use it in math mode.

\textbf{\Phi(r)} = -\frac{G M_1}{| \textbf{r}-\textbf{r_1} |}
$$\textbf{\Phi(r)} = -\frac{G M_1}{| \textbf{r}-\textbf{r_1} |}$$

\bf doesn't work at all:
\bf{\Phi}(\bf{r}) = -\frac{G M_1}{| \bf{r}-\bf{r_1} |}
$$\bf{\Phi}(\bf{r}) = -\frac{G M_1}{| \bf{r}-\bf{r_1} |}$$

Timo suggested \mathbf, but that doesn't work on some things.
If you have access to the AMSLaTeX macros, (and you should), use \boldsymbol.

\boldsymbol{\Phi}(\boldsymbol{r}) = -\frac{G M_1}{| \boldsymbol{r}-\boldsymbol{r}_1 |}
$$\boldsymbol{\Phi}(\boldsymbol{r}) = -\frac{G M_1}{| \boldsymbol{r}-\boldsymbol{r}_1 |}$$

Use \vec.

An even better solution is to define your own vector macro that formats vectors the way you want them to appear. For example,
\newcommand{\vect}[1]{\boldsymbol{#1}}

Then when someone tells you to format your vectors with arrows instead you can simply change that one macro.
\newcommand{\vect}[1]{\vec{#1}}
Bold symbols are used for things other than vectors (matrices, for example). A global search-and-replace is not a good idea.

4. Sep 20, 2007

### IlyaZ

Thanks, that works great!

Similar Discussions: Latex vector notation.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9230793118476868, "perplexity": 7837.3819564487}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-30/segments/1500549427749.61/warc/CC-MAIN-20170727062229-20170727082229-00084.warc.gz"}