3

Minimal example:

\documentclass{memoir}
\usepackage[utf8]{inputenc}
\thispagestyle{empty}
\begin{document}

\begingroup
\color{blue}
\rule{\paperwidth}{7.5cm}
\endgroup
\end{document}

I just want to make a box which is blue, has paperwidth and is placed at the bottom and is 7.5cm high. How to do that?

Thank you very much in advance :)

PS! It would be nice if I also could write a text which begins 7 cm from the right edge and goes to maximum 2 cm of the right edge and starts two centimeters under the blue beginning and ends to cm before bottom (white text) :D

And a picture which is 2 cms from each edge of the paper (also in the blue box) and is 9 cm long.

Example picture

  • 2
    By "placed at the bottom" are you referring to the bottom of the page? Or the bottom of the text block? Perhaps you can provide us with a graphic of the output... even if you were to draw it on a piece of paper with a pen and include it in your post. – Werner Apr 29 '14 at 21:06
  • I am refering to the bottom of the page :) – Conrad Kopernikus Apr 29 '14 at 21:22
1

try this:

load these packs in the preamble

\usepackage{fancybox}
\usepackage{color}
\usepackage{calc}

then:

\colorbox{blue}{
\parbox[b][7.5cm][t]{\textwidth}{\hspace*{7cm}
\parbox[t][5.5cm][t]{\textwidth-9cm}{\textcolor{red}{\\[2cm]
 Some text that non makes sense\hfill at all,\vfill just for practicing\ldots\hfill the example }}
%\makebox[0.5\textwidth-9cm][l]{ \textcolor{white}{Some text that non makes sense at all, just for practicing the example }} 
 }
}

this will produce this output : enter image description here

2

Based on my answer at What are the ways to position things absolutely on the page?

REVISED to make solution with nested \stackinsets. Note: The text will be vertically centered in the white box.

\documentclass{memoir}
\usepackage[utf8]{inputenc}
\thispagestyle{empty}
\usepackage{graphicx}
\usepackage{everypage}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage{stackengine}
% THESE ARE LaTeX DEFAULTS; CAN CHANGE IF NEEDED.
\def\PageTopMargin{1in}
\def\PageLeftMargin{1in}
\newcommand\atxy[3]{%
 \AddThispageHook{\smash{\hspace*{\dimexpr-\PageLeftMargin-\hoffset+#1\relax}%
  \raisebox{\dimexpr\PageTopMargin+\voffset-#2\relax}{#3}}}}
\begin{document}
\def\blocktext{%
  This is a test of text in my parbox. Will it wrap properly?  I think it will.}
\atxy{0in}{11in}{%
  \stackinset{r}{2.5cm}{c}{0cm}{\parbox[c]{4cm}{\blocktext}}{%
  \stackinset{l}{2cm}{b}{2cm}{\includegraphics[width=9cm,height=3.5cm]{example-image-a}}{%
  \stackinset{r}{2cm}{b}{2cm}{\textcolor{white}{\rule{5cm}{3.5cm}}}{%
    \textcolor{blue}{\rule{\paperwidth}{7.5cm}}%
  }}}%
}
\lipsum[1-4]\clearpage
\end{document}

enter image description here


ORIGINAL SOLUTION (without stacks):

I draw the blue with a big \rule, and then overlay a white block for the future text, and an image, and finally a \parbox for the text.

\documentclass{memoir}
\usepackage[utf8]{inputenc}
\thispagestyle{empty}
\usepackage{graphicx}
\usepackage{everypage}
\usepackage{xcolor}
\usepackage{lipsum}
% THESE ARE LaTeX DEFAULTS; CAN CHANGE IF NEEDED.
\def\PageTopMargin{1in}
\def\PageLeftMargin{1in}
\newcommand\atxy[3]{%
 \AddThispageHook{\smash{\hspace*{\dimexpr-\PageLeftMargin-\hoffset+#1\relax}%
  \raisebox{\dimexpr\PageTopMargin+\voffset-#2\relax}{#3}}}}
\begin{document}
\atxy{0in}{11in}{\textcolor{blue}{\rule{\paperwidth}{7.5cm}}}
\atxy{\dimexpr\paperwidth-7cm}{\dimexpr11in-2cm}{\textcolor{white}{%
  \rule{5cm}{3.5cm}}}
\atxy{2cm}{\dimexpr11in-2cm}{%
  \includegraphics[width=9cm,height=3.5cm]{example-image-a}}
\atxy{\dimexpr\paperwidth-6.5cm}{\dimexpr11in-4.8cm}{\parbox[t]{4cm}{%
  This is a test of text in my parbox. Will it wrap properly?  I think it will.}}

\lipsum[1-4]\clearpage
\end{document}

enter image description here

1

Here is an option with tikz.

\documentclass{memoir}

\usepackage{tikz}
\usetikzlibrary{calc}
\thispagestyle{empty}

\begin{document}

\begin{tikzpicture}[remember picture, overlay]
    \fill[blue] (current page.south west) rectangle ($(current page.south east)+(0,7)$);
    \fill[white] ($(current page.south west)+(2,2)$) rectangle ($(current page.south west)+(2,2)+(9,3)$);
    \fill[white] ($(current page.south east)+(-2,2)$) rectangle ($(current page.south east)+(-2,2)+(-7,3)$);
\end{tikzpicture}

\end{document}

If you want to add some text, you can use \node[text width = 9cm, text height = 2.5cm, align = left] at ($(current page.south west)+(6.5,4.5)$) {text goes here}; or something like that.

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.