# How to split latex page horizontally, and have a different colour background to the two halves?

I am writing a book and would like each page to be cut in half with red at the top and blue at the bottom (not including front page of initial front book matter). and then add separate text to each of the half of the page (was thinking minipage might be able to do this? - imagine bad advice top half and good advice bottom half of the page. Is this possible?

You could use eso-pic.

The following assumes, that the half of the text field is at the same height as the half of the paper. This is not necessarily true (and is false for default book page layout, roughly half of the last line of the first half of the text field lies in the second half of the page).

We first define an environment (advisepage in the following) for a coloured page. This environment does only colour a single page (top half red, bottom half blue). In this environment we use another environment (advise in the following) that is essentially just a minipage of fixed height .5\textheight and width \textwidth.

Code:

\documentclass[]{book}

\usepackage{xcolor}
\usepackage{environ}
\usepackage{eso-pic}

\makeatletter
{%
\clearpage
{%
\AtPageUpperLeft
{%
\raisebox{-.5\paperheight}{\rule{\paperwidth}{.5\paperheight}}%
}%
\rule{\paperwidth}{.5\paperheight}%
}%
}
{%
\clearpage
}
{%
\noindent
\begin{minipage}[t][.5\textheight]{\textwidth}
}
{%
\end{minipage}%
}
\usepackage{duckuments}
%\expandafter\show\csname set@page@color\endcsname

\begin{document}
Another page
\end{document}


An option using the package background and tikz shadings, code derived from: How to change the background color of a page?.

RESULT:

MWE:

% arara: pdflatex: {synctex: yes, action: nonstopmode}
% arara: pdflatex: {synctex: yes, action: nonstopmode}

\documentclass{article}
\usepackage[bottom=2cm,top=2cm]{geometry}
\usepackage{fontawesome}
\usepackage{graphicx}
\usepackage[
pages=some,
firstpage=false,
opacity=0.8,
scale=1,
placement=center,
angle=0,
hshift=0,
vshift=0
]{background}
\usepackage{lipsum}
\usepackage{tikz}

\begin{document}
\backgroundsetup{contents={}}
\section{First page}
\lipsum[1-4]

%Second page
\newpage
\backgroundsetup{contents={
\begin{tikzpicture}
\fill[bottom color=black!90, top color=blue!20,middle color=blue!70] (current page.west) rectangle (current page.south east);
\fill[bottom color=red!50, top color=black!90,middle color=red] (current page.west) rectangle (current page.north east);
\end{tikzpicture}
}
}
\vbox{
\begin{minipage}[t][0.5\textheight][t]{\textwidth}
\begin{tikzpicture}
\draw[
draw=white,fill=white, line width =1.5pt,
path picture={
\node at (path picture bounding box.center){
\includegraphics[height=6cm]{example-image-A}
};
}
] (0,0) circle (3);
\end{tikzpicture} \par
\vspace{2\baselineskip}
\lipsum[5]
\end{minipage}

\nointerlineskip
\begin{minipage}[b][0.5\textheight][t]{\textwidth}
\vspace{3\baselineskip}
\section{Bottom page}
\lipsum[6-7]

\textcolor{blue!20}{\section{Change text color} \lipsum[8]}

\end{minipage}
}

\newpage

\vbox{
\begin{minipage}[t][0.5\textheight][t]{\textwidth}
\vspace{3\baselineskip}
\lipsum[5-7]
\end{minipage}

\nointerlineskip
\begin{minipage}[b][0.5\textheight][t]{\textwidth}
\vspace{3\baselineskip}
\lipsum[8-9]
\end{minipage}
}
\newpage

\vbox{
\begin{minipage}[t][0.5\textheight][t]{\textwidth}
\vspace{3\baselineskip}
\lipsum[5-7]
\end{minipage}

\nointerlineskip
\begin{minipage}[b][0.5\textheight][t]{\textwidth}
\vspace{3\baselineskip}
\lipsum[8-9]
\end{minipage}
}
\end{document}