2

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}}?

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

1 Answer 1

2

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} 
2
  • 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
    Commented Apr 20, 2019 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
    Commented Apr 20, 2019 at 21:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .