How to print a custom header

Added by Carles Sadurní over 3 years ago

I've just learn about this impressive program and I'd like to use it this term.

My school wants every exam has a header. While using LyX/LaTeX I got this header printed using something like

\usepackage{geometry}
\geometry{verbose,tmargin=4cm,bmargin=2cm,headsep=2cm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\parskip}{\smallskipamount}
\setlength{\parindent}{0pt}
\usepackage{icomma}
\usepackage{graphicx}
\usepackage{colortbl}
\definecolor{gray}{rgb}{0.9, 0.9, 0.9}
\lhead{\includegraphics[width=1.5cm]{/home/sadur/Baixades/logo-fundacio.jpg}}
\chead{\Large{Col·legi XXXXXXXXXXXXXXXXXXXXXx \\ Fundació YYYYYYYYYYYYYYYYYYYYYYYYYYYY}}

I've tried to copy these lines in a LaTeX file in Auto Multiple Choice but no header is printed (neither the image nor the the text):
I've got the exam exactly as it is when I don't use these lines...

Is there a way of adding a header? Maybe only an image? If not, I could use preprinted paper: how can I add a 5cm top-margin?

Thanks in advance


Replies (2)

RE: How to print a custom header - Added by Frédéric Bréal over 3 years ago

AMC uses the fancy package to draw the 4 circles and the barcode. Unless you modify the automultiplechoice.sty, i suggest to you a solution which works only with the engine latex (+ dvi + ps2pdf).
— Create a ps image with the standalone class (file Header.ps)

\documentclass[12pt,border=1pt]{standalone}
\usepackage{graphbox,mwe}
\begin{document}
\includegraphics[width=1.5cm]{example-image}
\begin{minipage}[b]{8cm}
\large{Collegi XXXXXXXXXXXXXXXXX \\ Fundació YYYYYYYYYYYYYYYY}
\end{minipage}
\end{document}

— Include this image with everypage ans pst-abspos packages.

\documentclass[a4paper]{article}
\usepackage[francais,bloc,completemulti]{automultiplechoice}    
\usepackage{everypage,graphicx}
\usepackage[PostScript]{pst-abspos}
\begin{document}
\AddEverypageHook{\pstPutAbs(0.5,-1.5){\includegraphics[scale=1]{Header}}}

\exemplaire{10}{ %    
\vspace*{1cm}

%%% debut de l'en-tête des copies :    

\noindent{\bf QCM  \hfill TEST}

\vspace*{.5cm}
\begin{minipage}{.4\linewidth}
\centering\large\bf Test\\ Examen du 01/01/2008\end{minipage}
\champnom{\fbox{    
                \begin{minipage}{.5\linewidth}
                  Nom et prénom :

                  \vspace*{.5cm}\dotfill
                  \vspace*{1mm}
                \end{minipage}
         }}

\begin{center}\em
Durée : 10 minutes.

  Aucun document n'est autorisé.
  L'usage de la calculatrice est interdit.

  Les questions faisant apparaître le symbole \multiSymbole{} peuvent
  présenter zéro, une ou plusieurs bonnes réponses. Les autres ont
  une unique bonne réponse.

  Des points négatifs pourront être affectés à de \emph{très
    mauvaises} réponses.
\end{center}
\vspace{1ex}

\begin{question}{prez}    
  Parmi les personnalités suivantes, laquelle a été présidente
  de la république française~?
  \begin{reponses}
    \bonne{René Coty}
    \mauvaise{Alain Prost}
    \mauvaise{Marcel Proust}
    \mauvaise{Claude Monet}
  \end{reponses}
\end{question}

\begin{questionmult}{pref}    
  Parmi les villes suivantes, lesquelles sont des préfectures~?
  \begin{reponses}
    \bonne{Poitiers}
    \mauvaise{Sainte-Menehould}
    \bonne{Avignon}
  \end{reponses}
\end{questionmult}

}   

\end{document}

RE: How to print a custom header - Added by Carles Sadurní over 3 years ago

I'll try that.

Thank you very much!

(1-2/2)