Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

5 Answers

up vote 2 down vote accepted

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

share|improve this answer
    
Thanks. \frameattitle and \frameattext works but \frameatpage does not. pdflatex complains "a <box> is suppose to the here". Is there a way to increase the space between the text and the box. In my case the box wraps around the text too tightly. –  Godey Aug 13 '11 at 14:46
    
The example above works fine for me. I use TexLive 2011. –  Marco Daniel Aug 13 '11 at 14:53
    
@Godey: I edited my post. I think during the copy-paste process you forgot to copy the commands \makeatletter and \makeatother –  Marco Daniel Aug 13 '11 at 15:02
    
Thanks works perfectly now. –  Godey Aug 13 '11 at 15:31
add comment
\documentclass{article}
\usepackage{fancybox,fancyhdr}
\pagestyle{fancy}
\fancypage*{%
  \setlength{\fboxsep}{8pt}%
  \setlength{\shadowsize}{8pt}%
  \shadowbox}{}
\fancyhead{bar}

\begin{document}
\section{foo}

    Hello world

\end{document}

enter image description here

share|improve this answer
add comment

I actually required something like this yesterday for my appendix pages of my thesis. Use the tikz package and then place the following code somewhere on the title page. This requires two compilation runs to get correct results. Adjust the settings accordantly.

\tikz[remember picture,overlay] {%
    \draw [thick,red!50!black]
    ([shift={(+10mm,-10mm)}]current page.north west)
    rectangle
    ([shift={(-10mm,+10mm)}]current page.south east) 
    ;
}%

See also Use TikZ to draw frontpage and Title page using TikZ as well as Get a "Boxed" page with TeX.

share|improve this answer
    
Thanks. I tried your suggestion and it works great. –  Godey Aug 13 '11 at 15:34
    
@Martin: This could be written a bit more elegantly as \draw [thick,red!50!black] ([shift={(+10mm,-10mm)}]current page.north west) rectangle ([shift={(-10mm,+10mm)}]current page.south east) ; –  Jake Aug 15 '11 at 6:55
1  
@Jake: Indeed! Funny, I should have known that. I'm just in my last week of thesis write-up and don't have much concentration for anything else :-) I updated my code. Thanks! –  Martin Scharrer Aug 15 '11 at 7:01
add comment

This is what I did:

  1. Create a title page by LibreOffice and export it to PDF say, title.pdf
  2. Use package wallpaper and include these lines after \begin{document}:

    \begin{titlepage}
    \ThisLRCornerWallPaper{1}{title.pdf}
    \null
    \vfill
    \end{titlepage}
    
  3. Enjoy :-)

share|improve this answer
add comment

enter image description here

\documentclass[dvipsnames,cmyk]{article}
\usepackage[a4paper,margin=25mm]{geometry}
\usepackage{eso-pic,xcolor,calc}

% #1: border color
% #2: background color
% %3: border width
\newcommand\Border[3]{%
    \pagecolor{#1}%
    \newdimen\borderwidth
    \borderwidth=#3
    \AddToShipoutPictureBG*{%
    \AtPageLowerLeft{%
        \color{#2}\hspace{\borderwidth}%
        \rule[\borderwidth]{\paperwidth-2\borderwidth}{\paperheight-2\borderwidth}}}}


\usepackage{lipsum}

\begin{document}
\Border{red}{yellow!50}{1cm}
\lipsum[1]
\newpage

\Border{Green}{cyan!30}{1cm}
\lipsum[2]
\newpage

\pagecolor{white}
\lipsum
\end{document}
share|improve this answer
1  
Your example works only with latex-ps-pdf but not with pdflatex –  Marco Daniel Aug 13 '11 at 12:01
1  
@Marco: Both latex-dvips-ps2pdf and xelatex can compile it without problem. –  xport Aug 13 '11 at 14:22
1  
yeah but I mean the direct compiling to pdf -- pdflatex foo.tex. –  Marco Daniel Aug 13 '11 at 14:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.