
현재 프로젝트 보고서에 대한 문서를 설정하려고 합니다. 머리글과 바닥글에 문제가 있습니다.
나는 그것을 갖고 싶다모든 페이지의 바닥글바닥글은 아래 그림과 같아야 합니다.
이 바닥글을 달성하기 위해 현재fancyhdr
이 바닥글을 얻기 위해 현재 다음과 같은 패키지를멋진 페이지 스타일아래 코드 조각에 표시된 대로.
\pagestyle{fancy}
%% FOOTER
\fancyfoot[C]{\small \thepage} % PAGE NUMBER
\fancyfoot[L]{\small ENEL895 \\ Version 1.0} % PAPER CODE AND VERSION
\fancyfoot[R]{\small \today} % TODAY'S DATE
\renewcommand{\footrulewidth}{1pt} % FOOTER RULE LINE
바닥글에서 내가 겪고 있는 문제는 TOC에 대한 것입니다.\thispagestyle{fancy}
바닥글에서 내가 겪고 있는 문제는 목차에 대한 것입니다( 머리글과 바닥글을 얻으려고 목차와 모든 장 옆에 ). 그만큼목차~이다2페이지에 걸쳐 펼쳐져 있음, 첫 번째 페이지에는 바닥글의 페이지 번호만 있는 반면,두 번째 페이지가지고있다올바른 머리글과 바닥글.
그만큼두 페이지의 TOC 머리글 및 바닥글아래 그림과 같아야 합니다.
헤더가 복잡해지는 곳입니다. 헤더에는 다음이 모두 필요합니다.서문(1장 이전의 모든 것)섹션 제목에오른쪽헤더와 글자의 대소문자는 제목의 대소문자와 정확히 동일해야 합니다(예:대문자로 쓰지 않음그리고이탤릭체로 표시되지 않음). TOC 헤더(위에 표시된)는 제가 의미하는 바의 예입니다. 챕터의 경우 첫 번째 챕터 페이지에 머리글은 없고 위에 지정된 바닥글만 포함하고 싶습니다. 장의 나머지 페이지는 머리글 왼쪽의 장(형식: 장 # - 장 이름)과 오른쪽의 섹션(형식: # 섹션 이름)으로 부탁드립니다.
머리글과 바닥글해당 장의 첫 번째 페이지아래 이미지와 같아야 합니다.
머리글과 바닥글해당 장의 남은 페이지아래 그림과 같아야 합니다(이 장의 첫 번째 페이지를 표시했다는 사실은 무시하십시오).
헤더와 관련하여 제가 겪은 또 다른 어려움은 부록 헤더에 부록 A 대신 A장이 있다는 것입니다. 나는 이것이 헤더의 왼쪽에 있고 부록의 첫 번째 페이지에는 헤더가 없어야 합니다. 장).
부록 헤더 난이도:
다음은 지금까지 내 문서의 MWE입니다(죄송하지만 댓글이 많고 출력이 이 스레드에 표시된 이미지와 동일하지 않습니다).
\documentclass[12pt,a4paper]{report}
%----------------------------------------------------------------------------------------
% PACKAGES
%----------------------------------------------------------------------------------------
%% PAGE MARGINS
\usepackage[margin=1in]{geometry}
%% RANDOM LOREM IPSUM TEXT TO FILL
\usepackage{blindtext}
%% TOC BABEL
\usepackage[english]{babel}
%% HYPERLINKING
\usepackage[colorlinks=true]{hyperref}
\hypersetup{%
colorlinks,
linkcolor={red!50!black},
citecolor={blue!50!black},
urlcolor={blue!80!black}
}
%% HEADERS AND FOOTERS
\usepackage{fancyhdr}
%% HEADING TITLES (TITLE SECTIONS)
\usepackage{titlesec}
%% MAKES THE TOC WORK BETTER IMO (NOT SURE HOW)
\usepackage{tocloft}
%% INCLUDE PDF PAGES
\usepackage{pdfpages}
%----------------------------------------------------------------------------------------
% PAGE STYLE - HEADERS AND FOOTERS SETUP
%----------------------------------------------------------------------------------------
\pagestyle{fancy}
%% HEADER
\fancyhead[L]{\leftmark} % SECTION NAME-FIRST SECTION/PREVIOUS SECTION
\fancyhead[R]{\nouppercase{\rightmark}} % CHAPTER NAME
%--------------------------------------------------------------------------
%% FOOTER
\fancyfoot[C]{\small \thepage} % PAGE NUMBER
\fancyfoot[L]{\small ENEL895 \\ Version 1.0} % PAPER CODE AND VERSION
\fancyfoot[R]{\small \today} % TODAY'S DATE
\renewcommand{\footrulewidth}{1pt} % FOOTER RULE LINE
%--------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
% REDEFINING CHAPTER AND SECTION (LEFT AND RIGHT MARKS) TO BE THE % CHAPTER & SECTION NAMES AND NOT CAPITALISED.
%----------------------------------------------------------------------------------------
%% CHAPTER DEFINED AS RIGHT MARK (Chapter # - Chapter Name)
\renewcommand{\chaptermark}[1]{%
\markboth{}{\chaptername
\ \thechapter ~- #1}}
%% SECTION DEFINED AS LEFT MARK (# Section Name)
\renewcommand{\sectionmark}[1]{\markboth{\thesection\ #1}{}}
%----------------------------------------------------------------------------------------
% REDEFINE THE CHAPTER HEADING FORMAT AND VERTICAL SPACING
%----------------------------------------------------------------------------------------
%% SIZE AND FORMAT OF CHAPTER HEADING TITLE
\titleformat{\chapter}[display]
{\normalfont\Huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
% ALTERS "BEFORE" SPACING (SECOND ARGUMENT) TO 0
\titlespacing*{\chapter}{0pt}{0pt}{20pt}
%----------------------------------------------------------------------------------------
% EDITING THE TOC TITLE AND DOTTED LINE SEGMENTS FOR CHAPTERS
%----------------------------------------------------------------------------------------
%% CHANGE TITLE TO "Table of Contents"
\addto\captionsenglish{% Replace "english" with the language you use
\renewcommand{\contentsname}%
{Table of Contents}%
}
%% ADD DOTTED LINES FOR CHAPTERS IN TOC
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters, if you really want!
%----------------------------------------------------------------------------------------
% CHANGE LINE SPACING TO 1.5
%----------------------------------------------------------------------------------------
\renewcommand{\baselinestretch}{1.5}
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
% END OF PREAMBLE AND START OF DOCUMENT
%----------------------------------------------------------------------------------------
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
\begin{document}
%----------------------------------------------------------------------------------------
% PDF TITLE PAGE (NOT INCLUDED FOR MWE)
%----------------------------------------------------------------------------------------
%-----------------------------PDF PAGE---------------------------------
\pagenumbering{roman}
%----------------------------------------------------------------------------------------
% STATEMENT OF ORIGINALITY
%----------------------------------------------------------------------------------------
\section*{\LARGE\center{Statement of Originality\markboth{}{Statement of Originality}}}
\addcontentsline{toc}{chapter}{{Statement of Originality}}
\thispagestyle{fancy}
\newpage
%----------------------------------------------------------------------------------------
% ACKNOWLEDGEMENTS
%----------------------------------------------------------------------------------------
\section*{\LARGE\center{Acknowledgements (optional)\markboth{}{Acknowledgements}}}
\addcontentsline{toc}{chapter}{{Acknowledgements}}
\thispagestyle{fancy}
\newpage
%----------------------------------------------------------------------------------------
% ABSTRACT
%----------------------------------------------------------------------------------------
\section*{\LARGE\center{Abstract\markboth{}{Abstract}}}
\addcontentsline{toc}{chapter}{{Abstract}}
\thispagestyle{fancy}
\newpage
%----------------------------------------------------------------------------------------
% ACRONYMS (OPTIONAL)
%----------------------------------------------------------------------------------------
\section*{\LARGE\center{Acronyms (optional)\markboth{}{Acronyms}}}
\addcontentsline{toc}{chapter}{{Acronyms}}
\thispagestyle{fancy}
\newpage
%----------------------------------------------------------------------------------------
% SYMBOLS (OPTIONAL)
%----------------------------------------------------------------------------------------
\section*{\LARGE\center{Symbols (optional)\markboth{}{Symbols}}}
\addcontentsline{toc}{chapter}{{Symbols}}
\thispagestyle{fancy}
\newpage
%----------------------------------------------------------------------------------------
% TABLE OF CONTENTS
%----------------------------------------------------------------------------------------
\begin{center}
\hypersetup{linkcolor=black} % Make Links Black
\vspace*{-40pt}
\tableofcontents\thispagestyle{fancy}\markboth{}{Table of Contents}
\addcontentsline{toc}{chapter}{Table of Contents}
\newpage
\vspace*{-40pt}
\listoffigures\thispagestyle{fancy}\markboth{}{}
\addcontentsline{toc}{chapter}{List of Figures}
\newpage
\vspace*{-40pt}
\listoftables\thispagestyle{fancy}\markboth{}{}
\addcontentsline{toc}{chapter}{List of Tables}
\end{center}
\newpage
\pagenumbering{arabic}
%----------------------------------------------------------------------------------------
% MAIN TEXT (CHAPTERS)
%----------------------------------------------------------------------------------------
\chapter{Introduction}
\section{Introduction}\thispagestyle{fancy}
\Blindtext
\blindtext
\chapter{Literature Review}\thispagestyle{fancy}
\section{Background/Problem}
\blindtext
\section{Analysis..}
\Blindtext
\Blindtext
\chapter{Methodology}\thispagestyle{fancy}
\section{Procedure}
\blindtext\\
\blindtext \\
\blindtext\\
\blindtext
\section{Simulation?}
\blindtext\\
\blindtext \\
\blindtext
\chapter{Results and Discussion}\thispagestyle{fancy}
\section{Results Verification?}
\Blindtext
\chapter{Future Developments}\thispagestyle{fancy}
\section{Recommendations for Future Work}
\blindtext\\
\blindtext
\chapter{Conclusion}\thispagestyle{fancy}
\section{Conclusion}
\blindtext
%----------------------------------------------------------------------------------------
% APPENDIX
%----------------------------------------------------------------------------------------
\begin{appendix}
\chapter{Example 1}\thispagestyle{fancy}
\section{Testing}
\Blindtext
\chapter{Example 2}\thispagestyle{fancy}
\section{Extra}
\blindtext
\end{appendix}
%----------------------------------------------------------------------------------------
% BIBLIOGRAPHY/REFERENCES
%----------------------------------------------------------------------------------------
%-------------------------------REFS-----------------------------------
\end{document}
죄송합니다. 스레드가 너무 길어서 문제와 원하는 결과를 철저하게 설명해야 한다고 생각했습니다. 현재 패키지를 사용하고 있지만 fancyhdr
KOMA 스크립트와 동등한 것을 사용해야 한다고 생각하시면 어떻게 사용해야 하는지 의견을 남겨주세요. (저는 KOMA 스크립트를 사용해 본 적이 없습니다.)
감사해요.
답변1
클래스( 및 클래스 memoir
의 상위 집합 )를 사용하려는 경우 원하는 머리글/바닥글을 얻을 수 있습니다. 복잡해 보이지만 다양한 페이지 스타일과 사용 위치를 정의할 수 있습니다.book
report
memoir
제가 보기엔 당신이 여러 가지 다른 페이지 스타일을 원하는 것 같습니다. ToC(아마도 LoT 및 LoF도 가능), 제목 페이지, 장 제목 페이지, 일반 문서 페이지, 색인 또는 참고문헌용일 수 있습니다.
다음 MWE는 ToC 및 LoT, 장 제목 페이지(부록 포함) 및 일반적인 일반 페이지에 대한 페이지 스타일을 제공합니다.
% headersprob.tex SE 562212
\documentclass{memoir}
\usepackage{lipsum}
\usepackage{comment}
% macro for details of the footer style
\newcommand{\enelf}[1]{%
\makeevenfoot{#1}{\small \parbox[t]{1in}{ENEL895 \\ Version 1.0}}{\small \thepage}{\small \today}
\makeoddfoot{#1}{\small \parbox[t]{1in}{ENEL895 \\ Version 1.0}}{\small \thepage}{\small \today}
\makefootrule{#1}{\textwidth}{1pt}{5pt}
}
\makepagestyle{ENELfoot}
\enelf{ENELfoot}
% pagestle for the ToC
\makepagestyle{ENELtoc}
\makeevenhead{ENELtoc}{}{}{Table of Contents}
\makeoddhead{ENELtoc}{}{}{Table of Contents}
\makeheadrule{ENELtoc}{\textwidth}{1pt}
\enelf{ENELtoc}
% pagestyle of the LoT
\makepagestyle{ENELlot}
\makeevenhead{ENELlot}{}{}{List of Tables}
\makeoddhead{ENELlot}{}{}{List of Tables}
\makeheadrule{ENELlot}{\textwidth}{1pt}
\enelf{ENELlot}
% pagestyle for chapter pages
\makepagestyle{chapter}
\enelf{chapter}
% don't uppercase chapter and section titles in headers
% (regular definition uses \MakeUppercase for titles)
\makeatletter
\renewcommand*{\chaptermark}[1]{%
\markboth{\ifnum\c@secnumdepth > \m@ne
\if@mainmatter
\@chapapp\
\thechapter \ %
\fi
\fi
#1}{}}
\renewcommand*{\sectionmark}[1]{%
\markright{\ifnum\c@secnumdepth > \z@
\thesection \ %
\fi
#1}}
\makeatother
% The page style for the bulk of the document
\makepagestyle{ENELmain}
\makeevenhead{ENELmain}{\leftmark}{}{\rightmark}
\makeoddhead{ENELmain}{\leftmark}{}{\rightmark}
\enelf{ENELmain}
\begin{document}
\pagestyle{ENELfoot}
\frontmatter
\pagestyle{ENELtoc}
\copypagestyle{chapter}{ENELtoc} % the first page of the ToC uses the chapter pagestyle
\tableofcontents
\clearpage
\pagestyle{ENELlot}
\copypagestyle{chapter}{ENELlot} % the first page of the LoT uses the chapter page style
\listoftables
\mainmatter
% set the general page style
\pagestyle{ENELmain}
% first page of a chapter uses the chapter page style, so set it to be just the footer
\copypagestyle{chapter}{ENELfoot}
\chapter{One}
\lipsum
\section{A section}
\begin{table}
\centering
TABULATION
\caption{A table}
\end{table}
\lipsum
\addtocontents{toc}{\newpage} % make sure the ToC is more that one page
\section{Another section}
\lipsum
\appendix
\chapter{App}
\lipsum
\section{In appendix}
\lipsum
\end{document}
> texdoc memoir
자세한 내용은 설명서(7장)를 읽어보세요 .
답변2
fancyhdr의 패키지 문서에서 명령 \chapter
문제를 지적합니다 \thispagestyle{plain}
.
나는 \tableofcontents
이것도 그렇다고 믿습니다.
따라서 페이지 스타일을 재정의 plain
해야 할 수도 있습니다. 빈 헤더를 제외하고 페이지 스타일을 페이지 스타일로 설정하는 프리앰블을
추가하여 이를 수행할 수 있습니다 . 이로 인해 새 장이 소개되는 페이지에는 머리글이 없고 바닥글만 있게 됩니다. 새 장을 만들 때마다 제거하는 것을 잊지 마십시오 .\fancypagestyle{plain}{\fancyhead{}\renewcommand{\headrule}{}}
plain
fancy
\thispagestyle{fancy}
모든 페이지에 헤더가 표시되지 않는 것과 관련하여 문제는 정의 \captionmark
및 \sectionmark
.
내가 찾은 것은 재정의를 제거하고 \nouppercase
두 헤더의 정의를 추가하는 것입니다.
\fancyhead[L]{\nouppercase\leftmark} % SECTION NAME-FIRST SECTION/PREVIOUS SECTION
\fancyhead[R]{\nouppercase\rightmark} % CHAPTER NAME