Latex Vector Notation: Writing Vectors in Bold and Using Arrows - Tips & Tricks

Click For Summary

Discussion Overview

The discussion focuses on formatting vectors in LaTeX, specifically how to write vectors in bold and use arrows instead. Participants explore various methods for achieving the desired notation within displaymath and frac environments.

Discussion Character

  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant asks how to write vectors bold within displaymath and frac, expressing concern that other variables (like G and M_1) also appear bold when they should not.
  • Another participant suggests using \vec for arrows and \mathbf for bold vectors, but notes that the potential should not be treated as a vector.
  • A participant warns against using \textbf in math mode, stating it leads to unintended formatting issues.
  • It is mentioned that \bf does not work properly for this purpose, and \boldsymbol is recommended if AMSLaTeX macros are available.
  • One participant proposes defining a custom vector macro to easily switch between bold and arrow notation, emphasizing that a global search-and-replace is not advisable.
  • A later reply expresses gratitude for the suggestions and shares a link to a LaTeX guide.

Areas of Agreement / Disagreement

Participants express varying opinions on the best methods for formatting vectors, with no consensus on a single approach. Multiple competing views remain regarding the use of bold versus arrow notation.

Contextual Notes

Some methods discussed may depend on specific LaTeX packages or macros, and there are unresolved issues regarding the formatting of certain variables.

IlyaZ
Messages
15
Reaction score
0

Homework Statement


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?

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} |}
 
Physics news on Phys.org
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:
IlyaZ said:
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.

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 |}

b. How do I use arrows instead of the bold notation?

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.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 10 ·
Replies
10
Views
17K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 17 ·
Replies
17
Views
7K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
3
Views
1K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
14K
  • · Replies 4 ·
Replies
4
Views
2K