Newby here. I found a great template for technical reports here . .
http://www.latextemplates.com/template/stylish-article
I would like to change the background color of the abstract and section headings to a vertical gradient.
The relevant section of code in the template appears to be here . .
\renewcommand{\@maketitle}{%
\twocolumn[{%
\thispagestyle{empty}%
\vskip-36pt%
{\raggedleft\small\sffamily\bfseries\@JournalInfo\\\@Archive\par}%
\vskip20pt%
{\raggedright\color{color1}\sffamily\bfseries\fontsize{20}{25}\selectfont \@PaperTitle\par}%
\vskip10pt%
{\raggedright\color{color1}\sffamily\fontsize{12}{16}\selectfont \@Authors\par}%
\vskip18pt%
\fcolorbox{color1}{white}{%
\parbox{\textwidth-2\fboxsep-2\fboxrule}{\centering%
% HERE IS THE SECTION I WANT TO CHANGE
\colorbox{Color2!10}{%
\parbox{\textwidth-4\fboxsep-2\fboxrule}{%
\ifx\@Keywords\@empty%
\sffamily\textbf{\abstractname}\\\@Abstract%
\else%
\sffamily\textbf{\abstractname}\\\@Abstract\\[4pt]%
\textbf{\keywordname}\\\@Keywords%
\fi%
}%
}%
Can anyone guide me in the right direction?
Best Answer
One option using the
tcolorbox
package to define a color box with a vertical shading; since the class usestitlesec
to format the titles, the necessary redefinition for sections is quite simplewhere
mybox
is the newly defined box; a redefinition of\maketitle
is also required to use the shading for the box.Change the colors for the shading (inside the
\fill
in the definition ofmybox
) according to your liking: