Discussion:
Matrix element coloring/Highlighting
(too old to reply)
Kaci Tizi Ouzou
2004-08-03 18:52:27 UTC
Permalink
Hi all,

Is there a trick to play so to be able to color an element in a matrix
or highlight it some how (something more sophisticated than \bf{x}

Cheers,

Kaci
Georgios Tagalakis
2004-08-03 19:28:52 UTC
Permalink
Post by Kaci Tizi Ouzou
Hi all,
Is there a trick to play so to be able to color an element in a matrix
or highlight it some how (something more sophisticated than \bf{x}
Cheers,
Kaci
\usepackage{color}
.....................
{\textcolor{red}{matrix element}}

--- Georgios Tagalakis
Rolf Niepraschk
2004-08-04 06:44:25 UTC
Permalink
Post by Kaci Tizi Ouzou
Hi all,
Is there a trick to play so to be able to color an element in a matrix
or highlight it some how (something more sophisticated than \bf{x}
\bf{x}

is an wrong syntax! Use instead

\textbf{x}

or

\bfseries x

...Rolf
--
|| Rolf Niepraschk c/o Physikalisch-Technische Bundesanstalt ||
|| Abbestr. 2-12; D-10587 Berlin, Germany ||
|| Tel/Fax: ++49-30-3481-316/490, email: ***@ptb.de ||
Brooks Moses
2004-08-04 20:33:07 UTC
Permalink
Post by Kaci Tizi Ouzou
Post by Kaci Tizi Ouzou
Is there a trick to play so to be able to color an element in a matrix
or highlight it some how (something more sophisticated than \bf{x}
\bf{x}
is an wrong syntax! Use instead
\textbf{x}
or
\bfseries x
The latter is also (in most cases) wrong. You mean:

{\bfseries x}

Also, if you are going to be explaining that "\bf{x} is wrong", you
should explain why. There are in fact two reasons why it's not
recommended:

First is that \bf does not take an argument; it sets all following text
to boldface until the end of the current group or until the text style
is reset. Thus, "\bf x" and "\bf{x}" do exactly the same thing;
further, when one types (for example) "\bf{x} y", both x and y are
boldface. One should thus type "{\bf x} y" to limit the boldface to the
x. Since matrix elements are put within groups, the original poster
probably hasn't noticed this problem.

Second is that \bf is the unadorned-TeX version, while in LaTeX there
are improved versions that handle some other aspects of the font
switching -- these are "\bfseries" and such. The most notable
distinction between \bf and \bfseries is that, if you use them in (for
example) italic text, \bf will switch to normal boldface, whereas
\bfseries will recognize that it's in italic text and give you italic
boldface.

Note that this means that, in TeX, {\bf x} is the _right_ way to do
things. And further note that the original poster did not mention
whether he was using TeX or LaTeX; without knowing that, you should at
least put in the caveat that your correction only applies to LaTeX.

- Brooks
--
The "bmoses-nospam" address is valid; no unmunging needed.
Jean-Come Charpentier
2004-08-05 04:26:03 UTC
Permalink
Post by Brooks Moses
Post by Kaci Tizi Ouzou
Post by Kaci Tizi Ouzou
Is there a trick to play so to be able to color an element in a matrix
or highlight it some how (something more sophisticated than \bf{x}
\bf{x}
is an wrong syntax! Use instead
\textbf{x}
or
\bfseries x
{\bfseries x}
In case of tabular, that is not wrong: & ...& "create" a group.
In case of matrix, that is wrong because "Command \bfseries is invalid
in math mode".
\textbf{x} is wrong in matrix for the same reason. \mathbf{x} is right!

Jean-C\^ome Charpentier

Loading...