Preparing pretty headings
This recipe will show how to bring some color into document headings.
How to do it...
We will use TikZ for coloring and positioning. Take the following steps:
- Set up a basic document with support for filler text:
\documentclass{scrartcl} \usepackage[automark]{scrlayer-scrpage} \usepackage[english]{babel} \usepackage{blindtext}
- Load TikZ beforehand, and pass a naming option to the implicitly loaded xcolor package for using names for predefined colors:
\PassOptionsToPackage{svgnames}{xcolor} \usepackage{tikz}
- Define a macro that prints the heading given as an argument:
\newcommand{\tikzhead}[1]{% \begin{tikzpicture}[remember picture,overlay] \node[yshift=-2cm] at (current page.north west) {\begin{tikzpicture}[remember picture, overlay] \path[draw=none, fill=LightSkyBlue] (0,0) ...