[Tex/LaTex] Place framed text at top of page


I have chapters (using the standard "report" class), and I would like to place a frame of text – which gives succinct meta-details on the chapter – at the top of the first page of the chapter.

What I have succeeded in doing do far is this:

enter image description here

My problem is that the only way I've managed to do things is with TikZ absolute positioning (I know about various packages, such as textpos, and I have not been able to get them to work satisfyingly).

What is lacking with solution is that I have not been able to precisely control where the frame is – or rather, I must specify too precisely where it must be (using absolute coordinates), whereas I would just like it to be exactly vertically aligned with the body of the text, and just have to give the absolute distance from the top.

I.e., something like:


puts a framed box of text of the same width as the body of the text, and aligned with the body of the text, at 1cm from the top.

How could I do that? I have tried combining raisebox with pagetotal but to no avail…

EDIT: and I'd like to avoid using TikZ (or any unstable solution that requires I compile multiple times).

Best Answer

You can easily achieve what you want using tikz placing a node at current page.north with anchor=north and a yshift specified through an argument, controlling the vertical separation between the top border of the page and the top border of the node:


\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north,draw,yshift=-#1] at (current page.north) {\parbox[t][3cm][c]{\linewidth}{#2}};


\chapter{Test Chapter One}
\chapter{Test Chapter Two}


enter image description here