[Tex/LaTex] Size and position of boxes in title page

boxestcolorboxtitles

I am trying to create a front cover in a document (class article) and I have decided to 'decorate' it with boxes.

The first problem I have is that I am not sure why the title appears on the top of the box and not in the center.

The second problem I have is that the box is as large as the margins of the document whereas I would like it to cover the page from the one side to the other (like the picture at the end of this post).

The third problem is that I would like to have multiple boxes (each one has a different colour and space in the page) and I am not sure how I should make multiple boxes in latex and shuffle them in the page. An example of this is the last photo of the front covers that can be made easily in Word.

I would be grateful if you direct me to any resources on this with examples apart from the manual of the tcolorbox package.

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}

\usepackage{xcolor} % to colour the front cover
\usepackage{afterpage} % needed to colour only front cover and no other page
\usepackage{graphicx} % to be able to embed graphical content
\usepackage{tcolorbox} % needed for the text boxes
\usepackage{color} % needed to recognise hex colour

\definecolor{pink}{HTML}{FDDBC7}
\definecolor{red}{HTML}{B2182B}
\definecolor{blue}{HTML}{4393C3}

% define boxes 
%\%\%\%\%\ Title Box - box that will receive the title text
\makeatletter
\newcommand{\titlebox}[1]{%
  \setbox0=\hbox{#1}%
  \setlength{\@tempdima}{\dimexpr\wd0+13pt}%
  \begin{tcolorbox}[    colframe=red, colback=red, boxrule=0.5pt, arc=0pt, % 90degrees corners
    width=1\textwidth, height=0.5\textwidth, halign=flush center ] #1
  \end{tcolorbox}
}
\makeatother

\title{An awsome report}
\author{An awsome person}
\makeindex

\title{An awsome report}
\author{An awsome person}
\makeindex

%graphicspath{{computer/folder/}} % for the inclusion of logos

\begin{document} % - - - - - - - - - - - - - - - - - - - - - - - - - - 

% The title page
\makeatletter
\begin{titlepage}
\centering \titlebox{\huge\bfseries \@title \par}   
\vspace{2cm}
{\Large \@author \par}
\begin{tcolorbox}
[colframe=white, colback=white, halign=flush center]
%\includegraphics[width=0.3\textwidth]{myawsomelogo1}%
\end{tcolorbox}

% color front cover and no other page
\pagecolor{pink}\afterpage{\nopagecolor}

\end{titlepage}
\makeatother

The rest of the document

\end{document}

Possible front-covers:

enter image description here
enter image description here

Best Answer

If you want to shuffle multiple boxes around the page, use tikz.

\documentclass[12pt,a4paper]{article}
%\usepackage[utf8]{inputenc}% not with my editor
\usepackage{graphicx} % to be able to embed graphical content
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{color}

\definecolor{pink}{HTML}{FDDBC7}
\definecolor{red}{HTML}{B2182B}
\definecolor{blue}{HTML}{4393C3}

\newlength{\tempwidth}

\begin{document}
\thispagestyle{empty}
\begin{tikzpicture}[overlay,remember picture,font=\huge]
\node[below,minimum width={\paperwidth},minimum height={0.5\textwidth},
  fill=red,text=white] at (current page.north) {An awesome report};
\node[minimum width={\paperwidth},minimum height={0.5\textwidth},
  fill=red,text=white] at (current page.center) {An awesome person};
\node[above right,minimum width={0.5\paperwidth},minimum height={0.25\paperwidth},
  draw=blue,line width=5mm,fill=red,text=white] at (current page.south west) {\today};
\node[above left,minimum width={0.5\paperwidth},minimum height={0.25\paperwidth},
  draw=blue,line width=5mm,fill=red,text=white] at (current page.south east)
  {\includegraphics[height=4cm]{example-image}};
\end{tikzpicture}
\newpage
The rest of the document

\end{document}

enter image description here

Related Question