
다음 코드를 사용하여 문서의 짝수 페이지에 실행되는 짧은 제목과 홀수 페이지에 실행되는 작성자를 추가하려고 합니다.
\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
다음은 . 대신 및 O
옵션을 사용하는 Werner 솔루션의 단순화된 버전입니다 \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}