[Tex/LaTex] Setting background colour for part of a page

backgroundscolor

I am designing a business card using the memoir class and hints given here and am trying out various background effects. Specifically, I would like to change the background for the last third of the card to another colour. Because the colour needs to bleed to the edge, an option involving tables is not suitable. Short of inserting an image and overwriting it, is there a more elegant way to achieve this?

Best Answer

When I understood your requirements correctly you need anyway a 90mm x 52mm PDF as a result. Therefore I would recommend to you to "draw" the card using TikZ. There you can set the background colors as filled rectangles. Use the preview package to minimize the resulting PDF page. The code below uses standalone to do this automatically.

TikZ supports a lot of graphical features like shadings etc., so you shouldn't run into any limitations. See this question if you want to draw on the background of a normal page instead.

\documentclass[border=0mm]{standalone}
\usepackage{tikz}
\begin{document}
\sffamily
\begin{tikzpicture}
    % Define size and default background color of card:
    \useasboundingbox [fill=blue!10] (0,0) rectangle (90mm,52mm);
    % Background of last third
    \fill [red] (60mm,0mm) rectangle (90mm,52mm);
    % Place the text freely. You can also place `tabulars` or `\parbox`es
    \node [right] at (10mm,30mm) {John Doe};
    \node [right] at (10mm,25mm) {Example Cooperation};
    \node [right] at (10mm,20mm) {John.Doe@example.com};
\end{tikzpicture}
\end{document}

Result:

Result