짧은 제목 실행 및 기사 수업에서 저자 실행

짧은 제목 실행 및 기사 수업에서 저자 실행

다음 코드를 사용하여 문서의 짝수 페이지에 실행되는 짧은 제목과 홀수 페이지에 실행되는 작성자를 추가하려고 합니다.

\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}

관련 정보