TransWikia.com

Logos and text at the top with a border around on each page of article

TeX - LaTeX Asked by Gaurang on July 22, 2021

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

One Answer

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.10textwidth,width=0.10textwidth]{example-image-a} }
fancyhead[R]{includegraphics[height=0.10textwidth,width=0.10textwidth]{example-image-b} }
fancyhead[C]{ Course--XXX  University xxxvspace{0.02textwidth}}
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

Answered by Simon Dispa on July 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP