5

In my MWE below, developed from the template found here, how do I change the position of the minipage? Say for example that I wanted to move the minipage further down the page, how do I do that?

Here is my code:

\documentclass[11pt]{book}
\usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,a4paper]{geometry}
\usepackage{booktabs}
\usepackage[demo]{graphicx}
\usepackage{mwe}
\usepackage{tikz}
\usepackage{xcolor}
\definecolor{ultramarine}{RGB}{0,45,97}
\definecolor{cpiOrange}{RGB}{241,85,44}
\definecolor{cpiGray}{RGB}{106,100,100}
\definecolor{myred}{RGB}{177,14,35}

\begin{document}

\begingroup

\setlength{\parskip}{1.2ex plus 0.5ex minus 0.2ex}
\setlength{\parindent}{0in}

\thispagestyle{empty}
\newgeometry{margin = 0in}
\setlength{\fboxsep}{0pt}
\hfill \colorbox{ultramarine}{\makebox[3.22in][r]{\shortstack[r]{\vspace{2.75in}}}}%
\vspace{-0.25pt}
\setlength{\fboxsep}{10pt}
\setlength{\fboxrule}{0pt}
\colorbox{myred}{\makebox[8.05in][l]{\hfill \shortstack[r]{\fontsize{36}{36}\rmfamily\color{white} Very Cool Topic\\%
\fontsize{24}{24}\rmfamily\color{white} Assignment I}}}%
\setlength{\fboxsep}{0pt}
\vspace{-8.5pt}
\hfill {\begin{minipage}{3.22in} {\fontsize{36}{36}\rmfamily{This is the name of the Topic to be discussed}}\vspace{1cm} \\
\includegraphics[width=2.75in]{Fig_P4-6}
\end{minipage}}
\hfill \colorbox{ultramarine}{\hspace{.25in} \parbox{2.97in}{\vspace{7.5in} \color{white} \textbf{Author:{ \scshape Cooler Duder}\\Testing\\ Here we go}}}%
\restoregeometry
\endgroup

\end{document}
Gonzalo Medina
  • 505,128
Joe
  • 9,080
  • The alignment of a minipage is controlled with \begin{minipage}[*]{....} ... where * can be t, c or b, i.e. top, center or bottom. c is the default value –  Oct 12 '15 at 21:21
  • @ChristianHupfer, is there a way to place the minipage at a specific position, i.e. a specific (x,y) position on the page? – Joe Oct 12 '15 at 21:32
  • In principle: Yes. You need some knowledge of spacings of course.Alternatively give eso-pic package a chance –  Oct 12 '15 at 21:34

1 Answers1

8

One option to easily control the position of elements is to use the textpos package with its absolute option; a little example:

\documentclass[11pt]{book}
\usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,a4paper]{geometry}
\usepackage{booktabs}
\usepackage[absolute]{textpos}
\usepackage[demo]{graphicx}
\usepackage{mwe}
\usepackage{tikz}
\usepackage{xcolor}
\definecolor{ultramarine}{RGB}{0,45,97}
\definecolor{cpiOrange}{RGB}{241,85,44}
\definecolor{cpiGray}{RGB}{106,100,100}
\definecolor{myred}{RGB}{177,14,35}

\begin{document}

\begingroup

\setlength{\parskip}{1.2ex plus 0.5ex minus 0.2ex}
\setlength{\parindent}{0in}

\thispagestyle{empty}
\newgeometry{margin = 0in}
\setlength{\fboxsep}{0pt}
\hfill \colorbox{ultramarine}{\makebox[3.22in][r]{\shortstack[r]{\vspace{2.75in}}}}%
\vspace{-0.25pt}
\setlength{\fboxsep}{10pt}
\setlength{\fboxrule}{0pt}
\colorbox{myred}{\makebox[8.05in][l]{\hfill \shortstack[r]{\fontsize{36}{36}\rmfamily\color{white} Very Cool Topic\\%
\fontsize{24}{24}\rmfamily\color{white} Assignment I}}}%
\setlength{\fboxsep}{0pt}
\vspace{-8.5pt}\hfill 
{%
\begin{textblock*}{3.22in}(3cm,14cm)%
    \begin{minipage}{3.22in} 
    {\fontsize{36}{36}\rmfamily This is the name of the Topic to be discussed\par}
    \vspace{1cm}
  \includegraphics[width=2.75in]{Fig_P4-6}
  \end{minipage}%
  \end{textblock*}%
}
\hfill\colorbox{ultramarine}{\hspace{.25in} \parbox{2.97in}{\vspace{7.5in} \color{white} \textbf{Author:{ \scshape Cooler Duder}\\Testing\\ Here we go}}}%
\restoregeometry
\endgroup

\end{document}

Change the values inside parentheses in

\begin{textblock*}{3.22in}(3cm,14cm)

to move the element to the desired position.

enter image description here

Another option, since you are already loading TikZ would be to place the minipage inside a \node and use the remember picture,overlay options to tikzpicture and the special current page.<anchor> family of anchors.

As a side note, notice that I changed the code for the minipage to

{\fontsize{36}{36}\rmfamily This is the name of the Topic to be discussed\par}

otherwise, with your settings the wrong \baselineskip value was being applied.

Gonzalo Medina
  • 505,128