ヘッダーとフッターをカスタマイズする

ヘッダーとフッターをカスタマイズする

私は学士論文を書いていますが、最初のページの要件は次のとおりです。

  • ヘッダーに機関名
  • 中央に論文のタイトル
  • フッターに - 町と年

これどうやってするの?

パッケージを使用してfancyhdrヘッダーを変更しようとしましたが、それは論文のページにのみ適用され、最初のページには適用されません。ヘッダーに下線を引く必要はありません。また、次のページにはヘッダーが表示されないようにします。

これまでのところ、次のものがあります:

\documentclass[a4paper,10pt]{report}
\usepackage{fancyhdr}

\pagestyle{fancy}
\lhead{}
\chead{Institution}
\rhead{}
\title{Title}
\author{Author}

\begin{document}
\end{document}

答え1

これを試して:

\documentclass[a4paper,10pt]{report}
\usepackage{fancyhdr}

% \pagestyle{fancy}
\fancypagestyle{empty}{%
    \fancyhf{}% removes h/f
    \fancyhead[c]{\Huge{Instituion}}% Your inst name
    \fancyfoot[r]{Town and year}
}
\renewcommand{\headrulewidth}{0pt}% removes header line

\title{Title}
\author{Author}

\begin{document}
\maketitle
    
\begin{abstract}
\thispagestyle{plain}
    Here goes your abstract
\end{abstract}
\end{document}

答え2

あるいはこのように

\pagestyle{fancy} % options: empty , plain , fancy

\renewcommand{\headrulewidth}{0} % remove the line

\lhead{}\chead{Institution}\rhead{}
\lfoot{}\cfoot{}\rfoot{Town \& Year}

関連情報