I am trying to create a command in order to achieve this:
I would like to write:
\ver{x}
, \ver{y}
, \ver{z}
, \ver{r}
, etc…
And I would like to get:
\hat{\mathbf{x}}
, \hat{\mathbf{y}}
, \hat{\mathbf{z}}
, \hat{\mathbf{r}}
… respectively.
I need a command capable of doing this for every letter I put between {}.
I have tried \newcommand{\ver}{\hat\mathbf}
but I am getting error: extra or forgotten }.
I have also tried \newcommand{\ver}{\hat{\mathbf{•}}}
or \newcommand{\ver{•}{\hat{\mathbf{•}}}
but I get no result.
If anyone knows how can I solve this problem I will appreciate it.
Best Answer
You might do
but the result of
\ver{i}
would not be nice, because the i should lose the dot.A version that also works with Greek letters.
Remember to add
\usepackage{xparse}
if this seems not to work (and update your TeX system).