Background
Writing a manual using KOMA Script. The default fonts are perfect and should not be changed.
Problem
KOMA Script produces the following section outline:
The desired outline looks similar to the following (gradient extended to left and right margins):
The troubles I have encountered:
- The fount for numerals and text changes.
- Retaining the text spacing.
- Expanding or extending the gradient box to:
- the left and right margins (
\textwidth
?); and - a bit larger than the section (or subsection) text's top and bottom margins.
- the left and right margins (
Source Code
My first attempt resembles:
\let\oldsection\section
\renewcommand{\section}[1]{%
\oldsection[#1]{
\setlength\fboxrule{0pt}%
\setlength\fboxsep{0pt}%
\tikz[background rectangle/.style={left color=blue!20,right color=white},
show background rectangle]
\node [inner sep=0pt] (0,0) {#1};%
}
}
This produces:
Update
Changing the text width for the node helps:
\node [text width=\textwidth, inner sep=0pt] (0,0) {#1};%
This produces:
Related
Question
How would you implement a margin-to-margin gradient (preferably using TikZ) that is slightly larger than the text?