1

Im quite new to latex, I would like to make either bold or arrow vectors. I found many solutions to this but i cant see where i am doing it wrong, my code is

\documentclass[a4paper,11pt]{report} 
\DeclareMathAlphabet      {\mathbfit}{OML}{cmm}{b}{it}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc} 
\usepackage{lmodern} 
\usepackage{amsmath}
\begin{document}

\newcommand{\vect}[1]{\vec{#1}}

...

\begin{gather}
\rho = \rho _{0}(\vect{x} , t) + \varepsilon \rho _{1}(\vect{x},t) \\
p = p _{0}(\vect{x} , t) + \varepsilon p _{1}(\vect{x},t) \\
\vect{u}=\vect{u} _{0}(\vect{x},t) + \varepsilon\vect{u} _{1}(\vect{x},t)
\end{gather}

...​

this comes out:

enter image description here

when i use the boldsymbol command

\newcommand{\vect}[2]{\boldsymbol{#1}}​

this comes out:

enter image description here

i also used bf symbol:

enter image description here

i am showing in the image below which the vectors are

enter image description here

I have used the \overrightarrow command directly and not as a newcommand for the last one to come out right. I would like this result but with small arrows (vec) or bold vectors, but those commands seem to mess up the following symbols like "=" which does not appear and "_{0} " that does not come out as index to u etc. Problem seems to be with "newcommand", because when i use "\overrightarrow" in new command same thing happens:

enter image description here

Thanks in advance for the help

2
  • Welcome to TeX SX! What you're asking for is not very clear to ma? Could you explain a little more, and give a Minimal Working Example?
    – Bernard
    Oct 19, 2014 at 0:45
  • Do you want the Greek letters bold and that isn't working?
    – dustin
    Oct 19, 2014 at 1:21

1 Answer 1

4

Do you want this?

possible target

\documentclass[a4paper,11pt]{report}
\DeclareMathAlphabet      {\mathbfit}{OML}{cmm}{b}{it}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{lmodern}
\usepackage{amsmath}

% \newcommand{\vect}[1]{\vec{#1}}
\newcommand{\vect}[1]{\boldsymbol{\vec{#1}}}

\begin{document}

  \begin{gather}
\rho = \rho _{0}(\vect{x} , t) + \varepsilon \rho _{1}(\vect{x},t) \\
p = p _{0}(\vect{x} , t) + \varepsilon p _{1}(\vect{x},t) \\
\vect{u}=\vect{u} _{0}(\vect{x},t) + \varepsilon\vect{u} _{1}(\vect{x},t)
\end{gather}

\end{document}

Note that when you say

\newcommand\somecommand[2]{something to do}

you are defining a command with two mandatory arguments so you must write

\somecommand{first argument}{second argument}

If you want one argument to be optional, allowing you to write

\somecommand[first argument]{second argument}

or

\somecommand{second argument only}

you need

\newcommand\somecommand[2][default value for first argument]{something to do}

However, you only seem to be using one argument in your definition which did not try to tell TeX you wanted a vector (no \vec involved) so it did what you asked and just made the argument bold as requested.

Note that this may well fail to answer your question since I am not at all sure I understand it, but it is too much for a comment!

1
  • So simple. Problem was the number of arguments, helped very much thank you!
    – Ourania
    Oct 19, 2014 at 1:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .