1

I am currently making exam papers using latex exam class. I would like to have the page frame with the word `Answer written in the margins will not be marked' on both margins, and the header or footer outside the frame like in the image below.

page frame sample http://image.slidesharecdn.com/lsintrotest-131015190449-phpapp02/95/liberal-studies-practice-paper-for-beginners-5-638.jpg?cb=1381881942

Here's some code of mine. Appreciate your great help.

\documentclass[a4paper,addpoints]{exam}
\usepackage{lipsum}
\pagestyle{headandfoot}
\header{Prepared by Dexter}{}{Page \thepage}
\begin{document}
\begin{questions}
\question[3] Thanks for your help.
\question[2] \lipsum
\end{questions}
\end{document}
  • 3
    Just look at one of the many packages that can place things globally on the page. textpos, eso-pic (low level) even tikz can do this. – daleif Mar 18 '15 at 8:43
7

Something like this?

enter image description here

Code:

\documentclass[a4paper,addpoints]{exam}
\usepackage{tikzpagenodes}
\usetikzlibrary{calc}
\usepackage{eso-pic}

\AddToShipoutPictureBG{%
\begin{tikzpicture}[overlay,remember picture]
\draw[line width=1.5pt]
      ($ (current page text area.north west) + (-3mm,3mm) $)
      rectangle
      ($ (current page text area.south east) + (3mm,-3mm) $);
\node[rotate=90]
      at ([xshift=15mm] current page.west)
      {Answer written in the margins will not be marked};
\node[rotate=-90]
      at ([xshift=-15mm] current page.east)
      {Answer written in the margins will not be marked};
\end{tikzpicture}
}

\usepackage{lipsum}
\pagestyle{headandfoot}
\header{Prepared by Dexter}{}{Page \thepage}
\footer{Answer written in the margins will not be marked}{}{}
\begin{document}
\begin{questions}
\question[3] Thanks for your help.
\question[2] \lipsum
\end{questions}
\end{document} 
  • Nice one. A little problem here is that the words in the end of the lines are too close to the tikz box. I have tried to adjust the textwidth but it also reduces the size of the frame box. Can you do me a favour again? – Dexter Wong Mar 18 '15 at 11:46
  • 2
    @DexterWong Adjusted as per your comment. – karlkoeller Mar 18 '15 at 11:53

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.