|
29 | 29 | \definecolor{dfetchCoverBottom}{HTML}{c2620a} |
30 | 30 | \definecolor{dfetchCoverAccent}{HTML}{4e7fa0} |
31 | 31 | \definecolor{dfetchCoverLight}{HTML}{fef8f0} |
| 32 | +% Diataxis section accent (mutable; updated by \dfpart* commands below) |
| 33 | +\newcommand{\dxtcolor}{dftextmuted} |
| 34 | +\newcommand{\setdxtcolor}[1]{\renewcommand{\dxtcolor}{#1}} |
32 | 35 |
|
33 | 36 | % ---- Cover page ------------------------------------------------------------- |
34 | 37 | \usepackage{tikz} |
|
43 | 46 | \MakeUppercase{\chaptertitlename}~\thechapter} |
44 | 47 | {4pt} |
45 | 48 | {\color{dfnearblack}\fontsize{22}{26}\selectfont\bfseries} |
46 | | - [\vspace{6pt}{\color{dfprimary}\rule{\linewidth}{1.5pt}}] |
| 49 | + [\vspace{6pt}{\color{\dxtcolor}\rule{\linewidth}{1.5pt}}] |
47 | 50 | \titlespacing*{\chapter}{0pt}{-6pt}{18pt} |
48 | | -% Section: amber number pip + near-black title text |
| 51 | +% Section: section-accent number pip + near-black title text |
49 | 52 | \titleformat{\section} |
50 | 53 | {\normalfont\sffamily\Large\bfseries\color{dfnearblack}} |
51 | | - {\textcolor{dfprimary}{\thesection}} |
| 54 | + {\textcolor{\dxtcolor}{\thesection}} |
52 | 55 | {0.75em}{} |
53 | 56 | % Subsection: muted number + near-black title text |
54 | 57 | \titleformat{\subsection} |
|
59 | 62 | {\normalfont\sffamily\normalsize\bfseries\color{dfnearblack}} |
60 | 63 | {\textcolor{dftextmuted}{\thesubsubsection}} |
61 | 64 | {0.75em}{} |
| 65 | +% Part: large right-aligned number + coloured title + coloured rule |
| 66 | +\titleformat{\part}[display] |
| 67 | + {\normalfont\sffamily} |
| 68 | + {\color{\dxtcolor}\fontsize{72}{72}\selectfont\bfseries\hfill\thepart} |
| 69 | + {-4pt} |
| 70 | + {\color{\dxtcolor}\fontsize{28}{34}\selectfont\bfseries} |
| 71 | + [\vspace{10pt}{\color{\dxtcolor}\rule{\linewidth}{2pt}}] |
| 72 | +\titlespacing*{\part}{0pt}{60pt}{80pt} |
| 73 | +% Named Diataxis part commands — set the section accent then open the part |
| 74 | +\newcommand{\dfpartTutorials}{\setdxtcolor{dfprimary}\part{Tutorials}} |
| 75 | +\newcommand{\dfpartHowto}{\setdxtcolor{dfaccent}\part{How-to Guides}} |
| 76 | +\newcommand{\dfpartReference}{\setdxtcolor{dfsage}\part{Reference}} |
| 77 | +\newcommand{\dfpartExplanation}{\setdxtcolor{dfpurple}\part{Explanation}} |
| 78 | +\newcommand{\dfpartAppendix}{\setdxtcolor{dftextmuted}\part{Appendix}} |
62 | 79 |
|
63 | 80 | % ---- Tables: match website style ------------------------------------------- |
64 | 81 | % Rules: thin border colour, no vertical separators (horizontal-only, like site). |
|
0 commit comments