
こんにちは。これは私の最初の投稿なので、どこかが十分に明確でなかったら申し訳ありません。私は Revtex 4.2 を使用してラボ レポートを作成しようとしています。また、fancyhdr パッケージを使用して、テキストを含む見出しを生成しました。これは、最初のページを除くすべてのページで正常に機能しました。コードをいじっているうちに、これが\maketitle
fancyhdr と競合していることが原因であることに気付きました。
\documentclass[aps,prl,twocolumn,groupedaddress]{revtex4-2}
\usepackage{fancyhdr}
\usepackage{hyperref}
\pagestyle{fancy}
\fancyhf{}
\rhead{text 1}
\lhead{text 2}
\chead{\large{text 3}}
\begin{document}
\title{Title}
\author{Author}
\begin{abstract}
Abstract
\end{abstract}
\maketitle
\section{section}
\end{document}
ただし、\maketitleコマンドをコメントアウトすると動作します
\documentclass[aps,prl,twocolumn,groupedaddress]{revtex4-2}
\usepackage{fancyhdr}
\usepackage{hyperref}
\pagestyle{fancy}
\fancyhf{}
\rhead{text 1}
\lhead{text 2}
\chead{\large{text 3}}
\begin{document}
\title{Title}
\author{Author}
\begin{abstract}
Abstract
\end{abstract}
%\maketitle
\section{section}
\end{document}
これを修正して、タイトル+概要と見出しの両方をページに表示するにはどうすればよいですか? よろしくお願いします。
答え1
ページplain
スタイルは、 を使用したページで使用されます。コマンドの直後に\maketitle
を追加することでこれを回避できます。\thispagestyle{fancy}
\maketitle
\documentclass[aps,prl,twocolumn,groupedaddress]{revtex4-2}
\usepackage{fancyhdr}
\usepackage{hyperref}
\pagestyle{fancy}
\fancyhf{}
\rhead{text 1}
\lhead{text 2}
\chead{\large{text 3}}
\begin{document}
\title{Title}
\author{Author}
\begin{abstract}
Abstract
\end{abstract}
\maketitle
\thispagestyle{fancy}
\section{section}
\end{document}