TeX - LaTeX Asked by begginer on August 15, 2021
I need to define a specific header and footer for the first page and modified header and footer for rest pages. I am familiar with fancyhdr
package but from my understanding, I can only define not complicated headers and footers the same for all document by commands:
fancyhead[LO,RE]{}
fancyhead[RO,LE]{}
cfoot{}
fancyfoot[LO,RE]{}
fancyfoot[RO,LE]{}
I need to provide a template for the first page as follow:
And for the rest pages without Logo and Table.
The problems that I have:
fancyfoot
and cfoot
I got everything in the same lineEDIT:
Here is simple code:
documentclass[a4paper]{article}
usepackage[left=1.25cm, right=1.25cm,top=15mm, bottom=20mm,includehead,includefoot]{geometry}
usepackage{graphicx}
usepackage{fancyhdr} % fancy headers/footers
% Use fancyheadings stuff
pagestyle{fancyplain}{
% Definition of the header
renewcommand{headrulewidth}{0.6pt}
fancyhead[LO,RE]{bf Number}
fancyhead[RO,LE]{bf TEXT}
renewcommand{footrulewidth}{1.2pt}
fancyfoot[LO,RE]{small Title}
cfoot{vspace{0pt} smallbf Page thepage of pageref{END}}
fancyfoot[RO,LE]{Version number}
}
fancypagestyle{mypagestyle}{
% Definition of the header
renewcommand{headrulewidth}{0.6pt}
fancyhead[L]{bf Number}
fancyhead[R]{includegraphics[scale=0.2]{logo}}
renewcommand{footrulewidth}{1pt}
fancyfoot[L]{small number}
fancyfoot[C]{vspace{0pt} smallbf Page thepage of pageref{END}}
fancyfoot[R]{TEXT}
}
begin{document}
thispagestyle{mypagestyle}
setcounter{page}{1}
Title page
newpage
pagestyle{fancyplain}
section{The First Section}
Text text text text text text text text text text text text text text text text text text text text text text text text text.
newpage
section{The Next Section}
Text text text text text text text text text text text text text text text text text text text text text text text text text.
label{END}
end{document}
Problems:
Based on geometry package the footer and header should “start” after margins:
first change --- icon in header tool large reduce size to 0.1 scale
second change -- vspace in the foote not required since its 0pt and gives white space on top
Now have alook at first page
documentclass[a4paper]{article}
usepackage{geometry}
usepackage{graphicx}
usepackage{fancyhdr} % fancy headers/footers
% Use fancyheadings stuff
pagestyle{fancyplain}{
% Definition of the header
%renewcommand{headrulewidth}{0.6pt}
%fancyhead[LO,RE]{bf Number}
%fancyhead[RO,LE]{bf TEXT}
%
%renewcommand{footrulewidth}{1.2pt}
%fancyfoot[LO,RE]{small Title}
%cfoot{vspace{0pt} smallbf Page thepage of pageref{END}}
%fancyfoot[RO,LE]{Version number}
%}
fancypagestyle{mypagestyle}{
% Definition of the header
renewcommand{headrulewidth}{0.6pt}
fancyhead[L]{bf Number}
fancyhead[R]{includegraphics[scale=0.1]{example-image-a}}
renewcommand{footrulewidth}{1pt}
fancyfoot[L]{small number}
fancyfoot[C]{ smallbf Page thepage of pageref{END}}
fancyfoot[R]{TEXT}
}
begin{document}
thispagestyle{mypagestyle}
setcounter{page}{1}
Title page
newpage
pagestyle{fancyplain}
section{The First Section}
Text text text text text text text text text text text text text text text text text text text text text text text text text.
newpage
section{The Next Section}
Text text text text text text text text text text text text text text text text text text text text text text text text text.
label{END}
end{document}
For the second page
Redefine pagestyle as mypagestylea rather than interfere with pagestyle fancy which is the default
now have alook at second page
documentclass[a4paper]{article}
usepackage{geometry}
usepackage{graphicx}
usepackage{fancyhdr} % fancy headers/footers
% Use fancyheadings stuff
%pagestyle{fancyplain}{
% Definition of the header
%renewcommand{headrulewidth}{0.6pt}
%fancyhead[LO,RE]{bf Number}
%fancyhead[RO,LE]{bf TEXT}
%
%renewcommand{footrulewidth}{1.2pt}
%fancyfoot[LO,RE]{small Title}
%cfoot{vspace{0pt} smallbf Page thepage of pageref{END}}
%fancyfoot[RO,LE]{Version number}
%}
fancypagestyle{mypagestyle}{
% Definition of the header
renewcommand{headrulewidth}{0.6pt}
fancyhead[L]{bf Number}
fancyhead[R]{includegraphics[scale=0.1]{example-image-a}}
%defn of footer
renewcommand{footrulewidth}{1pt}
fancyfoot[L]{small number}
fancyfoot[C]{ smallbf Page thepage of pageref{END}}
fancyfoot[R]{TEXT}
}
fancypagestyle{mypagestylea}{
% Definition of the header
renewcommand{headrulewidth}{0.6pt}
fancyhead[LO,RE]{bf Number}
fancyhead[RO,LE]{bf TEXT}
%
renewcommand{footrulewidth}{1.2pt}
fancyfoot[LO,RE]{small Title}
cfoot{smallbf Page thepage of pageref{END}}
fancyfoot[RO,LE]{Version number}
}
begin{document}
thispagestyle{mypagestyle}
setcounter{page}{1}
Title page
newpage
pagestyle{mypagestylea}
section{The First Section}
Text text text text text text text text text text text text text text text text text text text text text text text text text.
newpage
section{The Next Section}
Text text text text text text text text text text text text text text text text text text text text text text text text text.
label{END}
end{document}
Answered by js bibra on August 15, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP