記事クラスでの短いタイトルの実行と著者の実行

記事クラスでの短いタイトルの実行と著者の実行

次のコードを使用して、ドキュメントの偶数ページに短いタイトルを追加し、奇数ページに著者名を追加してみます。

\documentclass[11pt]{article}
\usepackage{lipsum}

\title{\bf THE TITLE}

\author{FIRST AUTHOR\footnote{{\tt [email protected]} Address} 
       \and SECOND AUTHOR\footnote{second author address}
       \and THIRD AUTHOR\footnote{third author address}}
\date{~}
\begin{document}

\maketitle

\pagestyle{myheadings}
\markboth{The short title}{F. Author S. Author T. Author}

\lipsum
\lipsum

\end{document}

出力は次のようになります。 ここに画像の説明を入力してください ここに画像の説明を入力してください ここに画像の説明を入力してください

ご覧のとおり、著者名は(奇数ページと同様に)偶数ページの上部に挿入されており、私が望んでいる短いタイトルは挿入されていません。

ドキュメントのレイアウト (余白、幅、長さなど) をクラスと同じままにして、これを修正する方法が本当にわかりませんarticle

ご協力いただければ幸いです。

答え1

見出しを設定するにはfancyhdr、そして含めることができますifoddpage奇数ページか偶数ページかを確認します (runningheads以下で説明します)。

\documentclass{article}
\usepackage{lipsum}

\title{\bfseries THE TITLE}

\author{FIRST AUTHOR\footnote{\texttt{[email protected]} Address} 
       \and SECOND AUTHOR\footnote{second author address}
       \and THIRD AUTHOR\footnote{third author address}}
\date{~}

\usepackage{fancyhdr,ifoddpage}
\fancypagestyle{runningheads}{%
  \fancyhf{}% Clear header/footer
  \renewcommand{\headrulewidth}{0pt}% Remove header rule
  %\renewcommand{\footrulewidth}{0pt}% Remove footer rule (default)
  \fancyhead[L]{% Left header
    \checkoddpage% Update \ifoddpage
    \ifoddpage
      F.~Author, S.~Author, T.~Author% Odd pages
    \else
      The short title% Even pages
    \fi
  }%
  \fancyhead[R]{\thepage}% Right header
}

\pagestyle{runningheads}

\begin{document}

\maketitle

\lipsum
\lipsum

\end{document}

答え2

以下は、 の代わりにfancyhdr Eとオプションを使用した、Werner のソリューションの簡略版です。また、この例では必要ないため、新しいページスタイルは定義されません。O\ifoddpage

\documentclass{article}
\usepackage{lipsum}

\title{\bfseries THE TITLE}

\author{FIRST AUTHOR\footnote{\texttt{[email protected]} Address} 
       \and SECOND AUTHOR\footnote{second author address}
       \and THIRD AUTHOR\footnote{third author address}}
\date{~}

\usepackage[twoside]{fancyhdr}
  \fancyhf{}% Clear header/footer
  \renewcommand{\headrulewidth}{0pt}% Remove header rule
  %\renewcommand{\footrulewidth}{0pt}% Remove footer rule (default)
  \fancyhead[LO]{F.~Author, S.~Author, T.~Author} % Left header
  \fancyhead[LE]{The short title} % Left header
  \fancyhead[R]{\thepage}% Right header

\pagestyle{fancy}

\begin{document}

\maketitle

\lipsum
\lipsum

\end{document}

関連情報