[Tex/LaTex] Two columns with different background color and height of whole page

heightmarginsminipagetwo-column

I want to create page with two columns with different background color and height of whole page. What I was able to do is two columns with different background color but I can't set proper height and there is small gap between two columns and another gap between top of the page and top of the columns. I want to remove these gaps. Also I want to create vertical line between two columns. Right now I have minipages packed inside \colorbox which allows me to create all four borders but I only want one.

Final effect should look like this:

Final effect

This is what I figured out for now:

\documentclass{article}
\usepackage{blindtext}
\usepackage{xcolor}
\usepackage{geometry}
\geometry{margin=0in}

\begin{document}
\noindent
\fcolorbox{black}{red}{
\begin{minipage}{.3\textwidth}
  test
\end{minipage}
}
\fcolorbox{yellow}{yellow}{
\begin{minipage}{.7\textwidth}
  test
\end{minipage}
}
\end{document}

Best Answer

If there should be nothing else than a splitted background, this can be done with tcolorbox package quite easily.

\documentclass{article}
\usepackage{blindtext}
\usepackage{xcolor}
\usepackage{geometry}
\usepackage[most]{tcolorbox}
\geometry{margin=0pt}

\newtcolorbox{bgbox}[1][]{nobeforeafter,leftright skip=0pt,boxrule=0pt,enhanced jigsaw,sharp corners,#1}

\begin{document}
\noindent
\begin{bgbox}[height=\paperheight,colback=red,width=0.3\textwidth,rightrule=10pt,colframe=black]
\end{bgbox}%
\begin{bgbox}[height=\paperheight,colback=yellow,width=0.7\textwidth]
\end{bgbox}
\end{document}

enter image description here

Related Question