0

I want to create the following (See the picture). After some horizontal and vertical margin, a border around the page is needed. Within the bordered region, two logos (shown with boxes) with a title sandwiched between the two followed by a rule should be there. At the bottom, a line needs to be drawn below which a reference text with page no is required (kind of footer). This has to be on every page of the article. The content will come in the remaining white space.enter image description here

1
  • Mostly you are talking fancy headers or footers, so fancyhdr could do most of it. However, the border will require something like tikz, so I would use \AddToHook and tikzpagenodes instead. Dec 7, 2020 at 15:15

1 Answer 1

1

You need the help of fancyhdr for the header and footer plus tikz for the framing of the page. atbegshi will frame the first and subsequent pages.

\documentclass{article}

\usepackage{fancyhdr}
\usepackage{kantlipsum} % dummy text
\usepackage{graphicx}
\usepackage{tikz}   
\usepackage[top=3cm, bottom=3cm, left=4cm, right=4cm, headheight=1.5cm]{geometry}   
\usepackage{atbegshi}   
\AtBeginShipout{\AtBeginShipoutUpperLeft{\borders}}
\AtBeginShipoutFirst{\borders}

\pagestyle{fancy}{%
\fancyhead[L,R,C]{}
\fancyfoot[L,R,C]{}
\fancyhead[L]{\includegraphics[height=0.10\textwidth,width=0.10\textwidth]{example-image-a} }
\fancyhead[R]{\includegraphics[height=0.10\textwidth,width=0.10\textwidth]{example-image-b} }
\fancyhead[C]{ Course--XXX \\ University xxx\vspace{0.02\textwidth}}
\fancyfoot[L]{Course--XXX, year -- 2020}
\fancyfoot[R]{Page -- \thepage}
}

\renewcommand{\headrulewidth}{2pt} % width of line bellow the header
\renewcommand{\footrulewidth}{2pt}

\newcommand{\borders}{
\begin{tikzpicture}[remember picture, overlay]
    \node [anchor=north west, inner sep=0pt]
    at (current page.north west)
    {%
    \begin{tikzpicture}[every node/.append style = {anchor=center}]
        \draw[%
        anchor=north,
        line width=2.pt, % width of the frame
        color=blue] (0,0) rectangle (\paperwidth-4pt,\paperheight-4pt);
    \end{tikzpicture}
    };
\end{tikzpicture}
}

\begin{document}    

1. \kant[1]

\bigskip

a

b

c

d

e

f

g

\bigskip

Select the right option.

\bigskip    

Solution:

\clearpage


2. \kant[2]

\bigskip

a

b

c

d

e

f

g

\bigskip

Select the right option.

\bigskip    

Solution:
    
\end{document}

nnn

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .