latex

Header and Footer

Using fancyhdr and titleps packages

\documentclass[12pt]{article}

\usepackage{titleps}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{lipsum} % for dummy text

\pagestyle{myheadings}
\pagestyle{fancy}
\fancyhf{}

\setlength{\headheight}{30pt}

\renewcommand{\headrulewidth}{4pt}
\renewcommand{\footrulewidth}{2pt}

\fancyhead[L]{\includegraphics[width=1cm]{example-image-a}}
\fancyhead[C]{}
\fancyhead[R]{\rightmark}
\fancyfoot[L]{ABC}
\fancyfoot[C]{\textcopyright xyz}
\fancyfoot[R]{\thepage}



\begin{document}

\section{First section}
\subsection{One}
 \lipsum[1-3]
\subsection{Two} 
 \lipsum[4-6]
 
\end{document}

enter image description here

enter image description here

Page number as CurrPage/TotalPages in footer

\documentclass[12pt]{article}

\usepackage{lastpage}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{lipsum} % for dummy text

\pagestyle{myheadings}
\pagestyle{fancy}
\fancyhf{}

\setlength{\headheight}{30pt}

\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{2pt}

\lhead{\includegraphics[width=1cm]{example-image-a}}
\rhead{}

\lfoot{ABC}
\rfoot{\thepage/\pageref{LastPage}}

\begin{document}

\section{First section}
\subsection{One}
 \lipsum[1-3]
 
\end{document}

enter image description here


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow