1

Basically same question as this one, which has not been answered.

Base AwesomeCV highlights the first three characters of the section title string using the below code in the macro.

\def\@sectioncolor#1#2#3{%
  \ifbool{acvSectionColorHighlight}{{\color{awesome}#1#2#3}}{#1#2#3}%
}

I would like it to highlight the first word, whatever the input is. So far I've been unable to get it to work, any help is appreciated!

  • To color the entire word "About" in Awesome CV rather than just the first three letters I used this in coverletter.tex: https://tex.stackexchange.com/questions/509756/change-the-color-of-titles-to-include-whole-word-in-awesome-cv/601679#601679 – Jenn Jun 17 '21 at 16:38

2 Answers2

1

You can simply put a space after the macro parameter.

%\makeatletter
\def\@sectioncolor#1 {%
    \ifbool{acvSectionColorHighlight}
        {\textcolor{awesome}{#1}\ }
        {#1\ }
}
\@sectioncolor Hello world!
plante
  • 1,349
0

I managed to find a workaround. Please note that I am not efficient in LaTeX, especially not in making macros. That said, here's a solution for anyone looking into this in the future:

I replaced the original definition of \@sectioncolor (as above) with the following block, which is adapted from this thread:

% Awesome section color
\newcommand\SectionStyle[1]{\@sectionstyle#1 \@nil}
\newcommand\@sectionstyle{}
\def\@sectionstyle#1 #2\@nil{\textcolor{awesome}{#1} #2\unskip}

Then, I also had to replace the \lettersectionstyle command (and for the resume, \sectionstyle) with the following:

\newcommand*{\lettersectionstyle}[1]{{\fontsize{14pt}
{1em}\bodyfont\bfseries\color{text}\SectionStyle{#1}}}

And now the macro works, even with the different awesome colors!