Hello,
I was wondering if someone could help me with the following problem. I am trying to define a new command \bf so that \bf{a} gives \textcolor{red}{\textbf{a}}. So far I have defined
\renewcommand{\bf}{\textbf} so that \bf{a} gives \textbf{a}.
but i don't know how to incorporate the \textcolor into this. Since I used \bf{a} extensively throughout my document already, i was hoping someone knows a way to incorporate the \textcolor into this without me having to chance \bf{a} to something else througout my document.
Thank you in advance,
Jong-il
Text Formatting ⇒ Defining new commands
NEW: TikZ book now 40% off at Amazon.com for a short time.

Defining new commands
\textbf, unlike \bf, has an argument. Thus, you should use the following syntax:
\renewcommand{\bf}[1]{\textbf{#1}}
I think you'd be better served, however, by using a new name, to avoid conflicts... pick any name you haven't used yet:
\newcommand{\mybf}[1]{\textbf{#1}}
Color is not hard. Load the xcolor package:
\usepackage{xcolor}
And then you can use:
\newcommand{\redbf}[1]{\textcolor{red}{\textbf{#1}}}
(Or use renewcommand if needed, etc.)
I'm using red, but change that to whatever, as specified in the xcolor documentation.
I don't see the problem with your having already used \bf throughout the document. Doesn't your editor have a Find and Replace command?
\renewcommand{\bf}[1]{\textbf{#1}}
I think you'd be better served, however, by using a new name, to avoid conflicts... pick any name you haven't used yet:
\newcommand{\mybf}[1]{\textbf{#1}}
Color is not hard. Load the xcolor package:
\usepackage{xcolor}
And then you can use:
\newcommand{\redbf}[1]{\textcolor{red}{\textbf{#1}}}
(Or use renewcommand if needed, etc.)
I'm using red, but change that to whatever, as specified in the xcolor documentation.
I don't see the problem with your having already used \bf throughout the document. Doesn't your editor have a Find and Replace command?