如何在表格、目录等列表的第一页中添加页眉

如何在表格、目录等列表的第一页中添加页眉
\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{fullpage}
\usepackage{sectsty}
\usepackage{tocloft}
\usepackage{epstopdf}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage[export]{adjustbox}
\usepackage{mathptmx}% Times Roman font
\usepackage{titlesec}% Times Roman font
\usepackage[english]{babel}
 \setlength{\parindent}{4em}
\usepackage[doublespacing]{setspace}

\renewcommand{\cfttoctitlefont}{\hspace{2.5in}\Huge\bfseries}
\renewcommand{\cftloftitlefont}{\hspace{2in}\Huge\bfseries}
\renewcommand{\cftlottitlefont}{\hspace{2in}\Huge\bfseries}
%\renewcommand{\cftaftertoctitle}{\hfill}
\renewcommand{\contentsname}{\Huge Contents}
\sectionfont{\LARGE}
\subsectionfont{\Large}
\subsubsectionfont{\large}
\paragraphfont{\large}
\chapterfont{\centering}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\pagestyle{fancy}
\graphicspath{ {images/} }
\usepackage{etoolbox}
\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}
\titleformat{\chapter}[display]
  {\fontsize{12}{15}\centering\huge\bfseries}
  {\chaptertitlename\ \thechapter}{25pt}{\Huge}
\titleformat{\section}
  {\centering\Huge\bfseries}
  {\thesection}{14pt}{}


\begin{document}
\begin{spacing}{1}
\begin{titlepage}

    \begin{center}
        \Huge
                \textbf{A Study and Validation of APSO for the tracking control of 2 Dof helicopter}



        \vspace{1cm}
       \begin{flushleft}
       \Large
         \textbf{\hspace{1.5in}G. Raaja\hspace{1.5in}11U232}
      \end{flushleft}
        \vspace{0.5cm}
        \large
       Dissertation submitted in partial fulfilment of the requirements for the degree of\\
       \vspace{.5cm}
       \large
        \textbf {BACHELOR OF ENGINEERING}\\
        \vspace{0.2cm}
\textbf {BRANCH: INSTRUMENTATION AND CONTROL\\}
of Anna University\\
%\begin{figure}[H]
\includegraphics[width=.25\textwidth]{v}
 %\fbox{\includegraphics{img-1.eps}}
 %\adjincludegraphics[height=5cm,trim={0 0 {.5\width} 0},clip]{img-1.eps}
%\end{figure}
        \vspace{0.8cm}  


        \large
       \textbf{April 2015\\} 
        \vspace{0.8cm}
        \textbf{DEPARTMENT OF INSTRUMENTATION AND CONTROL SYSTEMS ENGINEERING\\}
        \vspace{0.8cm}
        \textbf{PSG COLLEGE OF TECHNOLOGY\\}
        (Autonomous Institution)\\
        \textbf{COIMBATORE – 641004\\}  


    \end{center}
 \begin{center}
 \clearpage
        \pagenumbering{gobble}
        \Huge
         \textbf{A Study and Validation of APSO for the tracking control of 2 Dof helicopter}

        \vspace{1cm}

        \large
        Bonafide record of work done by\\
       \begin{flushleft}
       \Large

         \textbf{\hspace{1.5in}G. Raaja\hspace{1.5in}11U232}
      \end{flushleft}
        \vspace{0.5cm}
        \large
       Dissertation submitted in partial fulfilment of the requirements for the degree of\\
       \vspace{.5cm}
       \large
        \textbf {BACHELOR OF ENGINEERING}\\
        \vspace{0.2cm}
\textbf {BRANCH: INSTRUMENTATION AND CONTROL\\}
of Anna University

        \large
       \textbf{April 2014\\} 

\vspace{2.25in}
    \noindent\begin{tabular}{ll}
    \makebox[3.1in]{\dotfill}  & \makebox[3.1in]{\dotfill}\\
    \textbf{Mr. K. Selva Kumar} &     \textbf{Dr. Jovitha Jerome}\\

    Faculty Guide & Head of Department\\
    \end{tabular}
    \hrule
    \vspace{1mm}
    \hrule height 4pt
    \vspace{1.5in}
     \noindent\begin{tabular}{ll}
        \makebox[3.1in]{\dotfill}  & \makebox[3.1in]{\dotfill}\\
        \textbf{[Internal Examiner]} &     \textbf{[External Examiner]}\\

        \end{tabular} 
    \end{center}
\end{titlepage}
\end{spacing}
\pagenumbering{roman}

\tableofcontents  

\clearpage
\addcontentsline{toc}{section}{\textbf{\listfigurename}}
\listoffigures
  \clearpage
\listoftables
\addcontentsline{toc}{section}{\textbf{\listtablename}}

\clearpage
\begin{spacing}{1.5}
\section*{\centering Acknowledgement} 

\addcontentsline{toc}{section}{\textbf{Acknowledgement}}\par

\end{spacing}
\fancyhead[L]{Acknowledgemnt}
\fancyhead[R]{}


\large
\par I would like to acknowledge many people who have helped me complete the project described in this dissertation. First and foremost, I express my sincere gratitude to \textbf{Dr.~R.~Rudramoorthy}, Principal, PSG College of Technology, for his kind patronage.\par
\vspace{.5cm}
I profusely thank and express my sincere gratitude to \textbf{Dr.~Jovitha~Jerome}, Professor and Head of the Department, Instrumentation and Control Systems Engineering, who has greatly inspired me through her powerful and motivational words and providing the necessary lab facilities.\par

\vspace{.5cm}
I am also grateful to have \textbf{Dr.~S.~Esakkirajan}, Associate Professor, \textbf{Mrs.~R.~Latha}, Assistant Professor (Senior Grade), \textbf{Mr.~D.~Jayaprasanth}, Assistant Professor and \textbf{Mr.~S.~ Natarajan}, Assistant Professor as my project co-ordinators whose inspirational words of guidance at all times prompted me to strive persistently.\par
\vspace{.5cm}
I express my sincere thanks to my supervisor \textbf{Mr.~K.~Selva~Kumar}, Assistant Professor, Department, Instrumentation and Control Systems Engineering, for his constant motivation and support during the course of my project. I truly appreciate and value his esteemed guidance and encouragement from the beginning to the end of this project. I am indebted to him for having helped me shape the problem and providing insights towards the solution.\par
\vspace{.5cm}
I also thank all the teaching and non-teaching staff for their cooperation to the students. My special thanks to all my friends for providing me good company in the lab. And I would like to thank all whose direct and indirect support helped me completing my project in time. I wish to express my gratitude to my parents, whose love and encouragement have supported me throughout my education.\par
\clearpage
\begin{spacing}{1.5}
\section*{\centering Abstract} 

\addcontentsline{toc}{section}{\textbf{Abstract}}\par
\end{spacing}
\fancyhead[L]{Abstract}
\fancyhead[R]{}
\begin{spacing}{1}
\chapter{INTRODUCTION}
\end{spacing}
\label{c1}
\fancyhead[R]{Chapter 1}
\fancyhead[L]{Introduction}
\pagenumbering{arabic}

\begin{spacing}{1}
\chapter{Particle Swarm Optimization}
\end{spacing}
\label{c2}

\fancyhead[R]{Chapter 2}
\fancyhead[L]{Particle Swarm Optimization}

\begin{spacing}{1}
\chapter{Linear Quadratic Regulator}
\end{spacing}
\label{c3}
\fancyhead[R]{Chapter 3}
\fancyhead[L]{Linear Quadratic Regulator}

\begin{spacing}{1}
\chapter{Mathematical Modelling}
\end{spacing}
\label{c4}
\fancyhead[R]{Chapter 4}
\fancyhead[L]{Mathematical Modelling}

\begin{spacing}{1}
\chapter{Experimental~Results}
\end{spacing}
\label{c5}
\fancyhead[R]{Chapter 5}
\fancyhead[L]{Experimental~Results}

\begin{spacing}{1}
\chapter{Conclusion}
\end{spacing}
\label{c6}
\fancyhead[R]{Chapter 6}
\fancyhead[L]{Conclusion}
\cleardoublepage
\addcontentsline{toc}{section}{\textbf{Bibliography}}
\bibliographystyle{plain}
\bibliography{science,s}

\fancyhead[R]{}
\fancyhead[L]{Bibliography}

\end{document}

答案1

我把你的代码简化为最小工作示例(MWE)

为了获得您想要的内容,请在序言中添加以下几行:

\makeatletter
\let\ps@plain\ps@fancy
\makeatother

这样plain样式就声明为与fancy样式相同。

fancyhdr然后像其他章节一样添加ToC、LoF 和 LoT。

平均能量损失

\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}

\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\pagestyle{fancy}

\makeatletter
\let\ps@plain\ps@fancy
\makeatother

\begin{document}

\pagenumbering{roman}
\fancyhead[L]{\contentsname}
\fancyhead[R]{}
\tableofcontents

\clearpage
\addcontentsline{toc}{section}{\textbf{\listfigurename}}
\fancyhead[L]{\listfigurename}
\fancyhead[R]{}
\listoffigures

\clearpage
\addcontentsline{toc}{section}{\textbf{\listtablename}}
\fancyhead[L]{\listtablename}
\fancyhead[R]{}
\listoftables

\clearpage
\chapter{INTRODUCTION}
\fancyhead[R]{Chapter 1}
\fancyhead[L]{Introduction}

\pagenumbering{arabic}

\chapter{Particle Swarm Optimization}
\fancyhead[R]{Chapter 2}
\fancyhead[L]{Particle Swarm Optimization}

\end{document}

输出

在此处输入图片描述

相关内容