帮助创建此类自定义页眉和页脚

帮助创建此类自定义页眉和页脚

我曾尝试创建这样的自定义页眉和页脚,它们应该只出现在“简介”章节之后(包含连续章节和页面)。但是我不仅无法生成它们,而且它们还出现在所有地方(目录、表格列表、图表列表等)。希望有

预期模板

MWE 如下

\documentclass[listof=totoc,chapterprefix,sfdefaults=false]{scrbook}
\usepackage{lipsum}
\usepackage{hyperref}
\usepackage{titletoc}
\usepackage{ragged2e}
%%%%%%%%%Header Footer
\usepackage[automark,ilines]{scrlayer-scrpage}
\automark{chapter}
\pagestyle{scrheadings}
\ohead[]{}
\ihead[]{}
\chead[]{}
\cfoot[]{-~\pagemark~-}
\ofoot[MAKAUT,WB]{}
\ifoot[]{}
%%%%%%%%%Header Footer
\hypersetup{
  colorlinks   = true, %Colours links instead of ugly boxes
  urlcolor     = blue, %Colour for external hyperlinks
  linkcolor    = blue, %Colour of internal links
  citecolor   = red %Colour of citations
}
\begin{document}
\frontmatter
\addchap{Acknowledgment}
\lipsum[1-3]
\addchap{Abstract}
\lipsum[1-3]
{\pagestyle{empty}
\tableofcontents
\listoftables
\listoffigures
}
\mainmatter
\pagestyle{scrheadings}
\begin{justify}
\chapter{Introduction}
\lipsum[1-3]
\section{Motivation}
\lipsum[3-5]
Write Motivation of the research work
\section{Contribution}
\lipsum[5-6]
Write the thesis contribution
\section{Organization of thesis}
\lipsum[2-3]
Brief description of chapters in the thesis.
\subsection{Chapter 2: Literature Survey}
\lipsum[1-2]
\subsection{Chapter 3:}
\lipsum[1-2]
\subsection{Chapter 4:}
\lipsum[1-2]
\subsection{Chapter 5:}
\lipsum[1-2]
\subsection{Chapter 6:}
\lipsum[1-2]
\subsection{Chapter 7:}
\lipsum[1-2]
\end{justify}
\end{document}

另外如果你认为任何其他包花式高清可以做得更好,请指导。

答案1

首先,您的示例没有显示任何页眉。因此,它也没有显示与图像类似的页眉,例如在目录中。请注意,您发布的示例代码应该始终显示问题。

您也没有真正指定 ToC、LoF、LoT 等的页眉(和页脚)。从代码来看,我预计页眉应该是空的。但我不确定页脚应该是什么。但是,请注意,这\listoffigures只会在列表的开头而不是结尾开始一个新页面。因此,如果您使用组来修改页面样式,则必须注意不要让组过早结束。

\documentclass[listof=totoc,chapterprefix,sfdefaults=false,numbers=enddot,headsepline,footsepline,plainfootsepline]{scrbook}
\usepackage{lipsum}
\usepackage{hyperref}
%\usepackage{titletoc}% Not really compatible with KOMA-Script. See the
                      % KOMA-Script manual for alternative user interface.
\usepackage{ragged2e}
%%%%%%%%%Header Footer
\usepackage[automark,headsepline,markcase=upper]{scrlayer-scrpage}
\automark[chapter]{chapter}
\clearpairofpagestyles
\setkomafont{pageheadfoot}{}
\setkomafont{pagefoot}{\bfseries\small}
\ohead{\headmark}
\lefoot*{\pagemark{} \rule[-\dp\strutbox]{1pt}{\baselineskip} Page}
\rofoot*{Page \rule[-\dp\strutbox]{1pt}{\baselineskip} \pagemark}
\ifoot*{Jadavpur University}
\AddToHook{cmd/frontmatter/after}{%
  \renewcommand*{\chapterpagestyle}{empty}% instead of plain → manual
  \pagestyle{empty}%
}
\AddToHook{cmd/mainmatter/after}{%
  \renewcommand*{\chapterpagestyle}{plain}%
  \pagestyle{headings}%
}
%%%%%%%%%Header Footer
\hypersetup{
  colorlinks   = true, %Colours links instead of ugly boxes
  urlcolor     = blue, %Colour for external hyperlinks
  linkcolor    = blue, %Colour of internal links
  citecolor   = red %Colour of citations
}
\begin{document}
\frontmatter
\tableofcontents

\listoftables
\listoffigures
\addchap{Acknowledgment}
\lipsum[1-3]
\addchap{Abstract}
\lipsum[1-3]
\mainmatter
\chapter{Introduction}
\pagestyle{headings}
\lipsum[1-3]
\section{Motivation}
\lipsum[3-5]
Write Motivation of the research work
\section{Contribution}
\lipsum[5-6]
Write the thesis contribution
\section{Organization of thesis}
\lipsum[2-3]
Brief description of chapters in the thesis.
\subsection{Chapter 2: Literature Survey}
\lipsum[1-2]
\subsection{Chapter 3:}
\lipsum[1-2]
\subsection{Chapter 4:}
\lipsum[1-2]
\subsection{Chapter 5:}
\lipsum[1-2]
\subsection{Chapter 6:}
\lipsum[1-2]
\subsection{Chapter 7:}
\lipsum[1-2]
\end{document}

在此处输入图片描述

相关内容