
이 문제는 내가 좋아하지 않는 크고 굵고 뻔뻔스러운 기본 장 제목 글꼴(다음 코드의 "INTRODUCTION")을 기본 일반 텍스트 글꼴로 설정하기 위해 서문에 다음 코드를 추가한 후에 시작되었습니다.
\usepackage[rm,tiny]{titlesec} %added this to change the chapter title's font as default regular text font.
\titleformat{\chapter}{\normalfont\centering}{}{0pt}{}
\titlelabel{}
\titlespacing*{\chapter}{0pt}{-20pt}{4pt}
무슨 일이 일어났는지, 내 장의 글꼴을 변경할 수 있었지만 "소개" 페이지 앞에 빈 페이지(헤더에 페이지 번호 1이 있음)가 나타났습니다. 이제 소개 페이지에 페이지 번호가 있습니다. 2 표시되도록 형식을 지정한 헤더가 아닌 바닥글에 있습니다. 다른 모든 페이지 번호는 헤더에 있습니다.
이러한 경향은 명령을 사용하여 다른 장(문헌 검토, 방법론 등)을 구성할 때마다 계속됩니다 \chapter{}
. 빈 페이지가 생성되고 새 섹션이 한 페이지 아래로 밀려나며 페이지 번호는 머리글이 아닌 바닥글에 표시됩니다.
더 완전한 코드는 다음과 같습니다.
\documentclass[12pt]{report}
\usepackage[left=1.5in, right=1in, top=1in, bottom=1.5in]{geometry}
\usepackage{setspace}
\usepackage{amsbsy}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{textcomp}
\usepackage{lscape}
\usepackage{amsmath}
\usepackage{calc}
\newlength{\depthofsumsign}
\setlength{\depthofsumsign}{\depthof{$\sum$}}
\newlength{\totalheightofsumsign}
\newlength{\heightanddepthofargument}
\usepackage[rm,tiny]{titlesec} %added this to change the chapter title's font as default regular text font.
\usepackage{pdflscape,booktabs}
\usepackage[flushleft]{threeparttable}
\renewcommand\TPTtagStyle{\textit}
\usepackage[font=it,skip=0.5\baselineskip]{caption}
%to put page numbers in the header
\fancyhf{}
\fancyhead[C]{\thepage}
\pagestyle{fancy}
\titleformat{\chapter}{\normalfont\centering}{}{0pt}{}
\titlelabel{}
\titlespacing*{\chapter}{0pt}{-20pt}{4pt}
\begin{document}
\setlength{\headheight}{50pt} %to note where the header lies.
\setlength{\headsep}{15pt} %to set the distance between header and the first line after it.
\renewcommand{\headrulewidth}{0pt}
\doublespacing
\thispagestyle{empty}
\begin{center}
\vspace*{0.2in}
MY TITLE\\
\vspace*{0.4in}
by\\
My name\\\
\vspace*{1.4in}
\singlespacing
A thesis submitted in partial fulfillment\\
of the requirements for the degree\\
\doublespacing
of\\
My degree\\
in\\
My discipline\\\
\vspace*{1in}
MY UNIVERSITY\\
University, Location\\
\vspace*{0.2in}
April 2019
\end{center}
\pagebreak
\pagenumbering{gobble}
\begin{center}
\vspace*{1in}
\textcopyright COPYRIGHT\\
by\\
My name\\
2019\\
All Rights Reserved
\end{center}
\pagebreak
\pagenumbering{arabic}
\setcounter{page}{1}
\begin{center}
\chapter{INTRODUCTION}
\end{center}
My introduction section's first paragraph...
\end{document}
처음 두 페이지는 괜찮습니다(첫 번째 페이지는 논문 이름 등이 포함된 표지이고 두 번째 페이지는 저작권 섹션). 이 페이지에는 페이지 번호가 없습니다(따라서 \pagenumbering{gobble}
두 번째 페이지에 코드도 있습니다).
편집: 코드를 제거하여 빈 페이지 문제를 처리했지만 \begin{center} ... \end{center}
해당 장이 포함된 페이지의 페이지 번호가 여전히 머리글이 아닌 바닥글에 표시됩니다. 다른 모든 페이지에는 헤더에 숫자가 있습니다. 이 문제를 해결할 수 있는 방법이 있나요?
답변1
장 페이지는 plain
기본적으로 페이지 스타일을 사용합니다. 두 스타일을 모두 조정 plain
하고 대신 fancy
페이지 스타일을 사용 하려면 . 일부 머리글 및/또는 바닥글 필드의 내용이 달라야 하는 경우 를 사용하세요 .fancyplain
fancy
\fancyplain{<content for plain style>}{<content for fancy style>}
\documentclass[12pt]{report}
\usepackage[left=1.5in, right=1in, top=1in, bottom=1.5in]{geometry}
\usepackage{setspace}
\usepackage{amsbsy}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{textcomp}
\usepackage{lscape}
\usepackage{amsmath}
\usepackage{calc}
\newlength{\depthofsumsign}
\setlength{\depthofsumsign}{\depthof{$\sum$}}
\newlength{\totalheightofsumsign}
\newlength{\heightanddepthofargument}
\usepackage[rm,tiny]{titlesec} %added this to change the chapter title's font as default regular text font.
\usepackage{pdflscape,booktabs}
\usepackage[flushleft]{threeparttable}
\renewcommand\TPTtagStyle{\textit}
\usepackage[font=it,skip=0.5\baselineskip]{caption}
%to put page numbers in the header
\fancyhf{}
\fancyhead[C]{\thepage}
%\fancyfoot[C]{\fancyplain{plain style}{fancy style}}% <- to show the usage of \fancyplain
\pagestyle{fancyplain}% <- changed
\titleformat{\chapter}{\normalfont\centering}{}{0pt}{}
\titlelabel{}
\titlespacing*{\chapter}{0pt}{-20pt}{4pt}
\setlength{\headheight}{50pt} %to note where the header lies.
\setlength{\headsep}{15pt} %to set the distance between header and the first line after it.
\renewcommand{\headrulewidth}{0pt}
\begin{document}
\doublespacing
\thispagestyle{empty}
\begin{center}
\vspace*{0.2in}
MY TITLE\\
\vspace*{0.4in}
by\\
My name\\\
\vspace*{1.4in}
\singlespacing
A thesis submitted in partial fulfillment\\
of the requirements for the degree\\
\doublespacing
of\\
My degree\\
in\\
My discipline\\\
\vspace*{1in}
MY UNIVERSITY\\
University, Location\\
\vspace*{0.2in}
April 2019
\end{center}
\clearpage
\thispagestyle{empty}
\begin{center}
\vspace*{1in}
\textcopyright COPYRIGHT\\
by\\
My name\\
2019\\
All Rights Reserved
\end{center}
\cleardoublepage
\pagenumbering{arabic}
\setcounter{page}{1}
\chapter{INTRODUCTION}
\lipsum
\end{document}
결과
답변2
\chapter
다음은 명령을 재정의하고 \thispagestyle{fancy}
(모든 버전의) 챕터 명령의 각 호출에 추가하는 코드를 사용하여 수정한 것입니다 .
\documentclass[12pt]{report}
\usepackage[left=1.5in, right=1in, top=1in, bottom=1.5in]{geometry}
\usepackage{setspace}
\usepackage{amsbsy}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{textcomp}
\usepackage{lscape}
\usepackage{amsmath}
\usepackage{calc}
\newlength{\depthofsumsign}
\setlength{\depthofsumsign}{\depthof{$\sum$}}
\newlength{\totalheightofsumsign}
\newlength{\heightanddepthofargument}
\usepackage[rm,tiny]{titlesec} %added this to change the chapter title's font as default regular text font.
\usepackage{lipsum}
\usepackage{pdflscape,booktabs}
\usepackage[flushleft]{threeparttable}
\renewcommand\TPTtagStyle{\textit}
\usepackage[font=it,skip=0.5\baselineskip]{caption}
%to put page numbers in the header
\fancyhf{}
\fancyhead[C]{\thepage}
\fancyfoot{}
\pagestyle{fancy}
\titleformat{\chapter}{\normalfont\centering}{}{0pt}{}
\titlelabel{}
\titlespacing*{\chapter}{0pt}{-20pt}{4pt}
%koleygr: Redefining chapter to include \thispagestyle{fancy}
\let\oldchapter\chapter
\makeatletter
\def\chapter{%
\@ifstar{\@Starred}{\@nonStarred}%
}
\def\@Starred{%
\@ifnextchar[%
{\GenericWarning{}{Warning: A starred section can not have parameters. I am going to ignore them!}\@StarredWith}%
{\@StarredWithout}%
}
\def\@StarredWith[#1]#2{%
\oldchapter*{#2}%
\thispagestyle{fancy}
}
\def\@StarredWithout#1{
\oldchapter*{#1}%
\thispagestyle{fancy}
}
\def\@nonStarred{%
\@ifnextchar[%
{\@nonStarredWith}%
{\@nonStarredWithout}%
}
\def\@nonStarredWith[#1]#2{%
\oldchapter[#1]{#2}%
\thispagestyle{fancy}
}
\def\@nonStarredWithout#1{%
\oldchapter{#1}%
\thispagestyle{fancy}
}
\makeatother
\begin{document}
\setlength{\headheight}{50pt} %to note where the header lies.
\setlength{\headsep}{15pt} %to set the distance between header and the first line after it.
\renewcommand{\headrulewidth}{0pt}
\doublespacing
\thispagestyle{empty}
\begin{center}
\vspace*{0.2in}
MY TITLE\\
\vspace*{0.4in}
by\\
My name\\\
\vspace*{1.4in}
\singlespacing
A thesis submitted in partial fulfillment\\
of the requirements for the degree\\
\doublespacing
of\\
My degree\\
in\\
My discipline\\\
\vspace*{1in}
MY UNIVERSITY\\
University, Location\\
\vspace*{0.2in}
April 2019
\end{center}
\pagebreak
\pagenumbering{gobble}
\begin{center}
\vspace*{1in}
\textcopyright COPYRIGHT\\
by\\
My name\\
2019\\
All Rights Reserved
\end{center}
\pagebreak
\pagenumbering{arabic}
\setcounter{page}{1}
%\begin{center}
\chapter{INTRODUCTION}
%\end{center}
My introduction section's first paragraph...
\lipsum[1-5]
\chapter{Another Chapter}
\lipsum[1-5]
\end{document}
추신: 나는 이전 답변을 사용했습니다.여기장 명령을 재정의하려면 @GonzaloMedina의 답변을 사용할 수 있습니다.여기대신 내 코드가 마음에 들지 않으면 ...