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 need to make questionnaire template for automatic processing with queXF. To do this I need to produce pages like this:

Example of page with frame

The queXF requirements for the pages are

  • unique barcode for each page (done by using barcode as page number with help of packages fancyhdr, pst-barcode, pstricks-add)
  • page frame for orientation

I need to draw the frame on each page like on the example page above (note that the frame is related to page, but not to text).

I see two ways for achieving this:

  • to set an image background
  • to draw separate lines (preferred)

Is it possible to do using LaTeX?

share|improve this question
    
Found a hint in answer to different question for using background image: \documentclass{article} \usepackage{wallpaper} \ULCornerWallPaper{1}{background.pdf} \begin{document} Your text \end{document} But the solution without using additional files is still preferred. –  Yuriy Petrovskiy Aug 30 '11 at 12:05
1  
You can draw the frame / lines with pstricks. To get the same position ate every site you can use the package atbegshi or the package fancyhdr which do you use. –  Marco Daniel Aug 30 '11 at 12:17
    
I had tried using fancyhdr for this, but it moves text down, below frame. (Maybe I had done something wrong) –  Yuriy Petrovskiy Aug 30 '11 at 12:31
1  
add comment

2 Answers

up vote 8 down vote accepted

You can use the background package:

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage{background}
\usetikzlibrary{calc}
\usepackage{lipsum}% just to generate some text

\SetBgScale{1}
\SetBgColor{black}
\SetBgAngle{0}
\SetBgOpacity{1}
\SetBgVshift{-4}
\SetBgContents{
\begin{tikzpicture}[thick]
\draw (0.55\textwidth,10) -- (0.55\textwidth,0.52\textheight) -- (0.4\textwidth,0.52\textheight);
\draw (-0.55\textwidth,10) -- (-0.55\textwidth,0.52\textheight) -- (-0.4\textwidth,0.52\textheight);
\draw (-0.55\textwidth,-10) -- (-0.55\textwidth,-0.52\textheight) -- (-0.4\textwidth,-0.52\textheight);
\draw (0.55\textwidth,-10) -- (0.55\textwidth,-0.52\textheight) -- (0.4\textwidth,-0.52\textheight);
\end{tikzpicture}
}

\pagestyle{empty}

\begin{document}

\lipsum[1-4]\newpage

\end{document}

enter image description here

share|improve this answer
add comment

In relation to my comment here the adapted example with pstricks:

\documentclass[12pt,a4paper]{report}
\usepackage{eso-pic}
\usepackage{pstricks}

\definecolor{myGray}{rgb}{0.9,0.9,0.9}
\newdimen\BorderWidth \BorderWidth=\paperwidth
\newdimen\BorderHeight \BorderHeight=\paperheight
\newdimen\BorderSep \BorderSep=30pt
\advance\BorderWidth by -2\BorderSep

\makeatletter
\newcommand\Border{%
  \psset{unit=1pt}
  \put(\strip@pt\BorderSep,\strip@pt\BorderHeight){%
    \advance\BorderHeight by -\BorderSep
%    \psframe[linewidth=3pt]%
%     (0,-\BorderHeight)(\BorderWidth, -\BorderSep)
    \psline(0,-0.25\BorderWidth)(0,-\BorderSep)(0.25\BorderWidth,-\BorderSep)
    \psline(0.75\BorderWidth,-\BorderSep)(\BorderWidth,-\BorderSep)(\BorderWidth,-.25\BorderWidth)
    \@tempdima -\BorderHeight
    \advance\@tempdima .25\BorderWidth
    \psline(0,\@tempdima)(0,-\BorderHeight)(.25\BorderWidth,-\BorderHeight)
    \psline(0.75\BorderWidth,-\BorderHeight)(\BorderWidth,-\BorderHeight)(\BorderWidth,\@tempdima)
}}
\makeatother
\AddToShipoutPicture{\Border}
\usepackage{lipsum}
\begin{document}
\lipsum
\end{document}
share|improve this answer
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.