2

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

enter image description here

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}

enter image description here

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
2

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

https://tex.stackexchange.com/a/311031 .

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.

enter image description here

Your example:

\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}
2

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} 

enter image description here

0

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.