10

This is my first time to try and write documentation by using LaTeX. The generated PDF is quite impressive, but there is one thing I have no idea of how to do it:

I would like to have the left 1/3 of my title page (created by titlepage) filled with color (no left and top, bottom margin), and then put the title text on it. The title will be centered, so its left part could overlap with the colored left 1/3 of the page.

Is it doable? What is the best way? Can the picture environment do this?

(The documentclass is [a4paper]{report}.)

1
13

A simple solution, without complex drawing packages:

\documentclass{report}
\usepackage{xcolor}
\usepackage{eso-pic}

\begin{document}

\begin{titlepage}
\AddToShipoutPictureBG*{\AtPageLowerLeft{%
  \color{blue!20}\rule{.33\paperwidth}{\paperheight}}}
Title
\end{titlepage}

bar
\newpage

blah

\end{document}
4
  • 1
    @Jake: thanks for your suggestion. I updated my solution.
    – Leo Liu
    Feb 8 '11 at 16:47
  • Thank you.I used your way because it does not need extra package ;)
    – murphytalk
    Feb 9 '11 at 13:50
  • Note, however, that this requires a fairly recent (mid-2010?) version of the eso-pic package. Earlier versions did not have \AddToShipoutPictureBG*. Feb 24 '11 at 15:00
  • does this only work in a titlepage scope?
    – Marses
    Jan 12 at 0:38
15

You can use TikZ for this (although I'm almost certain that if all you need is a coloured rectangle, someone else will come up with a solution that does not require a full-fledged graphics package).

The TikZ command needs to be supplied to the \title{} entry to make sure it gets drawn with the title page.

\documentclass[a4paper]{report}
\usepackage{tikz}

\title{\tikz[remember picture,overlay] \draw [fill,red!20] (current page.north west) rectangle +(0.33\paperwidth,-\paperheight);%
Rather Long Document Title to Show that the Colour is Behind the Title}
\author{John Doe}

\begin{document}
\maketitle

\end{document}

Title Page, one third red, with TikZ

2
  • Thank you for your prompt answer! Too bad that the tetex @ cygwin I am using doesn't come with this package,but it is still a elegant way to address my problem.Thank you!
    – murphytalk
    Feb 9 '11 at 13:49
  • 3
    @murphytalk if at all possible you should switch from tetex to a newer distribution like TeXlive
    – Seamus
    Feb 24 '11 at 14:58

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.