Text FormattingInteresting problem i have formating text

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
thedreamshaper
Posts: 44
Joined: Wed Aug 04, 2010 7:00 pm

Interesting problem i have formating text

Post by thedreamshaper »

I am writting alot about statistics, and thereofre also Matrices and Vectors. To get a consistent way of using my notation i want to make some commands i could simply write before and after the expressions which are vectors or Matrices.

rules:
-Matrices and Vectors are both in bold
-Matrices are capital letters, vectors are not

Now i figured i would use the \newcommand command to create these.

Code: Select all

\newcommand{\bm}{}
\newcommand{\bv}{}

bm and bm being "begin matrix" and "begin vector".

Is it possible to put my rules into these commands ?

I havent been able to figure out how to do so.


Thanks!
Last edited by thedreamshaper on Sat Feb 19, 2011 4:03 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Interesting problem i have formating text

Post by Frits »

You were close. I suggest you use something like this:

Code: Select all

\newcommand{\bv}[1]{\ensuremath{\boldsymbol{#1}}}
\newcommand{\bm}[1]{\ensuremath{\boldsymbol{\uppercase{#1}}}}
In your LaTeX code, you can now write \bv{x} to produce a vector x and \bm{a} to produce an uppercase matrix A
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
thedreamshaper
Posts: 44
Joined: Wed Aug 04, 2010 7:00 pm

Interesting problem i have formating text

Post by thedreamshaper »

Thanks Frits, exactly what i needed :)


i modified your code slightly to force vectors to be lower case as well.

Code: Select all

\newcommand{\bv}[1]{\ensuremath{\boldsymbol{\lowercase{#1}}}}
\newcommand{\bm}[1]{\ensuremath{\boldsymbol{\uppercase{#1}}}}
Post Reply