# Command for both bold and colored text

Every time I want a bold text, I want it colored blue. Currently, I am using:

``````\textcolor{blue}{\textbf{some bold and colored text}}
``````

To save time, I can define a command to do both at once. How can I do it?

• `\newcommand\bluebf[1]{\textcolor{blue}{\textbf{#1}}}` ? This is \bluebf{blue bold text} May 6, 2016 at 0:54

Simply

``````\newcommand\boldblue[1]{\textcolor{blue}{\textbf{#1}}}
``````
• Could you explain a little bit how `1` and `#1` works there? Your solution worked for me, but my attept was `\newcommand{\boldblue}{\textcolor{blue}{\textbf{}}` and gave me a compile error and I'm trying to understand how that `1` and `#1` that solves the problem. Jun 21, 2021 at 0:03
• `1` means that the macro `\boldblue` will have one argument*. Later `#1` is a reference for the first argument of `\boldblue`. * by the way: `[1]` means that this is an optional argument of `\newcommand` Jun 21, 2021 at 13:18

Another approach is to use font-switching commands within `\DeclareTextFontCommand`, here:

``````\DeclareTextFontCommand{\bblue}{\color{blue}\bfseries}
``````