# LaTeX \vec command

#### Janosh89

Can anyone help? What is the convention for inserting the vector symbol?
I have a draft with -(\vec{2.5})^2 which displays correctly in preview
$-(\vec{2.5})^2\\$
why is vec troublesome and underlined in red?? Should I ignore!
I realise that I'm not using a variable.

Related MATLAB, Maple, Mathematica, LaTeX, Etc News on Phys.org

#### Mark44

Mentor
Can anyone help? What is the convention for inserting the vector symbol?
I have a draft with -(\vec{2.5})^2 which displays correctly in preview
$-(\vec{2.5})^2\\$
why is vec troublesome and underlined in red?? Should I ignore!
I realise that I'm not using a variable.
What you have is how this command is used. I don't see any red underlining.

$\vec x$ - Raw script \vec x
$\vec {x_1}$ - Raw script \vec{x_1}
The braces, { }, used in the 2nd example are not required in this and most other commands when what follows the command is a single character. If there are two or more characters, you have to use braces to indicate what is included.

Before anyone else jumps in to comment about 2.5 not being a vector, this post is about LaTeX use, not vectors per se.

#### Janosh89

Thanks for the full description, Mark44

#### FactChecker

Gold Member
2018 Award
The red underlining is probably the spellchecker doing that in the editor. Those are not very sophisticated when it comes to anything that is not a word of the English language.

"\vec command"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving