1

Here is one of my custom colors that is "light blue". Sometimes it comes up very skinny on the text

\definecolor{lb}{RGB}{44, 139, 183}

Is there an easier way to bold or thicken the font of a \definecolor such that I don't have to manually change every \textcolor{lb}{}to \textcolor{lb}{\textbf{text goes here}}?

  • A macro may work here. – user156344 Apr 20 at 17:52
  • 1
    \newcommand{\textboldlb}[1]{\textbf{\textcolor{lb}{#1}}} – egreg Apr 20 at 17:54
1

By "bolding" the color of some text, I assume you mean to give the text thicker strokes but without switching to bold-extended type.

If this assumption is correct, the following solution may be of interest to you.

enter image description here

Note that the bold colored parts have (almost) the same widths that the regular-weight colored parts have.

\documentclass{article}
\usepackage{xcolor}
\definecolor{lb}{RGB}{44, 139, 183}
\newcommand\cl[2]{\textcolor{#1}{#2}}
\newcommand\bcl[2]{\textcolor{#1}{{\fontseries{b}\selectfont #2}}}

\begin{document}
\cl{lb}{Hello World.}

\bcl{lb}{Hello World.}

Hello World.

\cl{red}{Good bye.}

\bcl{red}{Good bye.}
\end{document} 
  • oooh yes this is very relevant for me. What are \cl[2] and \bcl[2]? I see what they do, but I don't know what they are – Evan Kim Apr 20 at 19:38
  • 1
    @EvanKim - Those are parts of macro definitions. The macros’ names are \cl and \bcl, respectively? . Noticed the \newcommand directives that precede them? In both cases, the [2] particles mean that the macros take two arguments — the colt and the string to be colored. – Mico Apr 20 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.