
次のコードを使用して、ドキュメントの偶数ページに短いタイトルを追加し、奇数ページに著者名を追加してみます。
\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}