3

I am trying to create a document and somehow I want it to be in color, but it has been difficult for me to try to color the top and bottom, for all pages in general

reference image

\documentclass[letterpaper,12pt,oneside]{book}%
\usepackage{mathpazo}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{geometry}%[showframe]

% edit title and header \usepackage{tikz} \usepackage{fancyhdr} \usepackage[explicit]{titlesec}

\begin{document} \chapter{Getting Started}

\section{Preview sect}

\end{document}

So far I have managed to create the structure

royer
  • 361
  • 1
  • 14
  • Do you really want a background for the headers and footers, or just a coloured zone above the header and under the footer? – Bernard Jul 10 '20 at 17:40
  • @Bernard coloured zone above the header and under the footer,I need to fill everything with color – royer Jul 10 '20 at 18:09

1 Answers1

2

If I've well understood, it's easy to do with eso-pic:

\documentclass[letterpaper,12pt,oneside]{book}%
\usepackage{newpxtext, newpxmath}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{geometry}%[showframe]
\usepackage[svgnames]{xcolor}

% edit title and header \usepackage{tikz} \usepackage{fancyhdr} \usepackage[explicit,]{titlesec} \usepackage{eso-pic} \usepackage{lipsum} \AddToShipoutPictureBG{\color{DodgerBlue}% \AtPageUpperLeft{\rule[-20mm]{\paperwidth}{20mm}}% \AtPageLowerLeft{\rule{\paperwidth}{25mm}}}

\begin{document}

\chapter{Getting Started}

\section{Preview sect}

\lipsum[1-20]

\end{document}

Unrelated: You don't have to load amsfonts when you load amssymb. Also, nowadays, you don't have to load inputenc: utf8 is now the default. I recommend to load newpx rather than mathpazo, as it is based on a palatino clone which has more glyphs.

enter image description here

Bernard
  • 271,350