[Tex/LaTex] How to draw a border around a title page

colorfancyhdrframedtitles

I want to draw a red page border only on the title page and signature page of my thesis.
How can I achieve this. I tried the fancybox package but it has some conflict with fancyhdr package and displayed some of the page headings out of place.

Best Answer

Without a graphic-package like tikz or pstrick you can use eso-pic

    \documentclass{scrreprt}

    \usepackage{xcolor}
    \usepackage{eso-pic}
    \usepackage{lipsum}
    \title{Title}
    \author{Name}
    \newcommand{\frameattitle}[1][red]{%
      \AddToShipoutPictureBG*{\AtTextLowerLeft{%
          \color{#1}%
          \linethickness{5pt}%
         \framebox(\LenToUnit{\textwidth},\LenToUnit{\textheight}){}}%
         }%
    }

    \begin{document}
    \frameattitle
    \maketitle
    \clearpage
    \frameattitle
    \null\vfill
    \begin{center}
    \bfseries
    Signature
    \end{center}
    \vfill
    \clearpage
    \chapter{foo}
    \lipsum


    \end{document}

In relation to the idea of xport here an example with allows a frame around the text size and the paper size.

EDIT:

I modified my code. Now you can stretch the frame around the text with the setting of the lengths extraxsep and extraysep.

\documentclass{scrreprt}

\usepackage{xcolor}
\usepackage{eso-pic}
\usepackage{lipsum,showframe}
\title{Title}
\author{Name}
\makeatletter
%\frameattext{<backgroundcolor>}{linecolor}{<linewidth>}
\newdimen\extraxsep
\newdimen\extraysep
\extraxsep=20mm
\extraysep=20mm
\newcommand\frameattext[3]{%
  \linethickness{#3}%
  \AddToShipoutPicture*{%
    \AtTextLowerLeft{%%text-boder
       \put(\LenToUnit{-,5\extraxsep},\LenToUnit{-0.5\extraysep}){\color{#1}%
             \rule{\dimexpr\textwidth+\extraxsep\relax}{\dimexpr\textheight+\extraysep\relax}}%
       \put(\LenToUnit{-,5\extraxsep},\LenToUnit{-0.5\extraysep}){\color{#2}%
       \framebox(\LenToUnit{\dimexpr\textwidth+\extraxsep\relax},%
                 \LenToUnit{\dimexpr\textheight+\extraysep\relax}){}
       }
    }%
  }%
}
%\frameatpage{<backgroundcolor>}{linecolor}{<linewidth>}
\newcommand\frameatpage[3]{%
  \linethickness{#3}%
  \AddToShipoutPicture*{%
    \AtPageLowerLeft{%%page-border
      \put(0,0){\color{#1}\rule{\paperwidth}{\paperheight}}%
      \put(\LenToUnit{\@wholewidth},\LenToUnit{\@wholewidth}){%
       \color{#2}\framebox(\LenToUnit{\dimexpr\paperwidth-2\@wholewidth\relax},%
                  \LenToUnit{\dimexpr\paperheight-2\@wholewidth\relax}){}%
      }%
    }%
  }%
}

\makeatother
\begin{document}
\frameattext{green}{blue}{10pt}
\maketitle
\clearpage
\frameatpage{yellow}{red}{6pt}
\null\vfill
\begin{center}
\bfseries
Signature
\end{center}
\vfill
\clearpage
\frameatpage{yellow}{red}{6pt}
\chapter{foo}
\lipsum
\end{document}

enter image description here

enter image description here