I had this idea that would save me a considerable amount of time in writing my thesis. Here's the deal:
I need to typeset lots of equations with vectors and matrices in them. I'd like my vectors in boldface, lowercase and my matrices in boldface, uppercase. For a vectors and matrices I've defined the following in my preamble:
\renewcommand{\v}[1]{\ensuremath{\boldsymbol{#1}}}
\newcommand{\m}[1]{\ensuremath{\boldsymbol{\uppercase{#1}}}}
In context, I use \v{x} to typeset a vector x, etc.
However, wouldn't it be nice to be able to typeset \vx
to create that same vector x. Then, if I'm writing about a vector a, b and c, I can just write \va
, \vb
and \vc
.
Is this possible in LaTeX?
Best Answer
If you use extensively bold math italic for your vectors and matrices, the best solution is to define a new symbol font:
and then doing
(or, in the "macho programmer way",
\renewcommand{\vec}{\mathbmit}
). If a matrix is called "A", there is little sense in inputting it as\matr{a}
, in my opinion.Abbreviations such as
\va
,\vb
and so on can be defined, but the biggest risk is to forget the commands' meaning in a short time. If you really want to follow this path, then here's how:Using
\ensuremath
is, in my opinion, wrong, as these are mathematical entities and so they should always be in explicit math mode.