# Replicate the title of this CV: \colorbox outside the margins and words of the same length

I would like to replicate the title "Katie Smalls" of this CV

Here is my code:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[]{xcolor}
\usepackage[top=0cm]{geometry}

\begin{document}
\centering
\colorbox{pink}{
\begin{minipage}[t]{0.3\textwidth}
\centering
\vspace{3cm}
\textcolor{white}{\Huge \textbf{KATIE}}\\
\textcolor{white}{\Huge \textbf{SMALLS}}
\end{minipage}}
\end{document}


There are three main problems with this attempt:

• I need a top margin in the rest of the document, so top=0cm have to be changed
• There's still a white space at the top of the document
• Name and surname are not alligned
• Why do you use the article class (\documentclass{article}) for a CV ? A lot of packages are specially designed for CV ... – Jérôme Dequeker Jun 28 '16 at 7:57
• @JérômeDequeker I want to replicate the title of this CV, but then I want to use it in another document, not a CV. – Andrea Jun 28 '16 at 7:59
• @ebo Thank you for your suggestion: what is more important to me is the creation of that \colorbox, let's say, outside the margins – Andrea Jun 28 '16 at 8:09
• @Andrea : so you could have a look at How to locate figures with x,y specified location in a presentation – ebosi Jun 28 '16 at 8:11
• – ebosi Jun 28 '16 at 8:41

The TikZ-based method can be wrapped into a macro as shown here:

The given macro allows the specification of an anchor point of the box and uses fractions of the page dimensions for accurate positioning. There is no need for setting margins or additional calculations.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[]{xcolor}

\usepackage{tikz}
\usetikzlibrary{calc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% absolute positioning of typeset material
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\placetextbox}[4][center]{%
% [#1]: box anchor: center (default) |
%                 south west | west | north west | north |
%                 north east | east | south east | south |
%                 mid west | mid | mid east |
%                 base west | base | base east
% #2: horizontal position (fraction of page width)
% #3: vertical position (fraction of page height)
% #4: content
%
\tikz[remember picture,overlay,x=\paperwidth,y=\paperheight]{%
\node[anchor=#1,inner sep=0pt]
at ($(current page.south west)+(#2,#3)$) {#4};
}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\placetextbox[north]{0.5}{1.0}{%
\colorbox{pink}{%
\begin{minipage}[t][0.3\textwidth][b]{0.3\textwidth}
\sffamily
\resizebox{\linewidth}{!}{\textcolor{white}{\Huge \textbf{KATIE}}}\\[0.5ex]
\resizebox{\linewidth}{!}{\textcolor{white}{\Huge \textbf{SMALLS}}}
\end{minipage}}%
}
\end{document}


Here is a simple solution, using \raisebox, resizebox and the optional parameter height of \parbox. The trick is to declare to \raisebox that the \parbox has height 0:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{gillius2}
\usepackage[x11names]{xcolor}
\usepackage{graphicx}

\usepackage[showframe, top = 3cm]{geometry}

\begin{document}

\begin{center}
\raisebox{\dimexpr 3cm + 7pt\relax}[0pt]{\colorbox{HotPink2!90!OrangeRed1}
{\parbox[t][4.5cm][c]{0.3\textwidth}
{\centering\color{white}\bfseries\sffamily\Huge\vskip1.2cm
\resizebox{0.25\textwidth}{!}{KATIE}\\[-0.5ex]
\resizebox{0.25\textwidth}{!}{SMALLS}}}
}
\end{center}

\end{document}


Solved the first two problems:

\documentclass{article}
\usepackage[absolute,overlay]{textpos}
\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{1mm}
\usepackage[T1]{fontenc}
\usepackage[]{xcolor}

\begin{document}

\begin{textblock}{130}(30,0)
\colorbox{pink}{
\begin{minipage}[t]{0.3\textwidth}
\centering
\vspace{3cm}
\textcolor{white}{\Huge \textbf{KATIE}}\\
\textcolor{white}{\Huge \textbf{SMALLS}}
\end{minipage}}
\end{textblock}

\end{document}


Thanks to ebo for all the help!