
저는 대학의 논문 형식 요구 사항에 맞는 문서 클래스 템플릿을 사용하고 있습니다(utexastheses.cls). 몇 년 전에 한 학생이 만든 것인데, 대학에서 관리를 안 해요. 템플릿을 만든 사람은 부록이 없었습니다(또는 몇 년 전에 만든 이후로 부록 형식이 변경되었습니다). 왜냐하면 부록을 만들려고 할 때 형식이 현재 형식 요구 사항을 따르지 않기 때문입니다. 부록을 만드는 표준 접근 방식은 작동하지 않으며 수십 개의 다른 질문/포스트/블로그 등에서 찾은 많은 제안도 작동하지 않습니다.
Rmarkdown을 사용하고 Sweave를 통해 .Rnw 파일에서 PDF를 컴파일하고 있습니다.
아래는 기존 템플릿으로 생성된 내용입니다. 두 가지 버전을 포함했습니다. 하나는 \chapter{}가 비어 있고 다른 하나는 \chapter{Appendices}를 사용합니다.
내가 사용할 때
\appendix
\chapter{}
\section{The CATE as a ratio of covariances}
내가 사용할 때 :
\appendix
\chapter{Appendices}
\section{The CATE as a ratio of covariances}
나에게 필요한 것은 TOC를 다음과 같이 만드는 것입니다.
Appendices 128
Appendix A The CATE as a ratio of covariances .............. 128
Appendix B CATE in Morgan and Winship (2014) ............... 130
Appendix C Data-Generating Syntax .......................... 132
Appendix D Estimator Syntax ................................ 136
그리고 페이지 상단 중앙에 정렬된 "부록 A"로 시작하는 텍스트가 필요합니다(다른 부록에 대해서도 마찬가지입니다). "부록"을 헤더로 사용할 수 없습니다. 개별 부록 이름을 표시하도록 바로 이동해야 합니다.
문서 클래스 템플릿에서 관련 비트라고 생각되는 부분을 붙여넣었습니다.전체 템플릿은 여기에서 찾을 수 있습니다. 중요한 정보를 포함하지 않은 경우 알려주시면 해당 정보를 포함하도록 질문을 편집하겠습니다.
% table of contents configuration
\RequirePackage[nottoc]{tocbibind}
\RequirePackage{tocloft}
\renewcommand{\contentsname}{Table of Contents} % default: Contents
\renewcommand{\cftdotsep}{0.25} % default: 4.5
% Prefix chapter numbers with "Chapter " and add space as needed
\renewcommand{\cftchappresnum}{\@chapapp\ }
\newlength{\cftchappresnum@width}
\settowidth{\cftchappresnum@width}{\cftchappresnum}
\addtolength{\cftchapnumwidth}{\cftchappresnum@width}
% chapter heading configuration
% simplified version of the original from report.cls
\def\@makechapterhead#1{{%
\centering\headingsize
% print "Chapter N"
\@chapapp\space\thechapter
\par\nobreak
\vskip.25\baselineskip
\@makeschapterhead{#1}
}}
% star-chapter variation
\def\@makeschapterhead#1{{
\centering\headingsize
% prevent page break between following lines at all costs
\interlinepenalty=10000
\bfseries #1\par\nobreak
\vskip\baselineskip
}}
% toc/lot/lof heading configuration
\setlength{\cftbeforetoctitleskip}{\z@}
\setlength{\cftaftertoctitleskip}{.25\baselineskip}
\renewcommand{\cfttoctitlefont}{\headingsize\bfseries\hspace*{\fill}}
\renewcommand{\cftaftertoctitle}{\hspace*{\fill}}
% copy toc to lot
\setlength{\cftbeforelottitleskip}{\cftbeforetoctitleskip}
\setlength{\cftafterlottitleskip}{\cftaftertoctitleskip}
\renewcommand{\cftlottitlefont}{\cfttoctitlefont}
\renewcommand{\cftafterlottitle}{\cftaftertoctitle}
% copy toc to lof
\setlength{\cftbeforeloftitleskip}{\cftbeforetoctitleskip}
\setlength{\cftafterloftitleskip}{\cftaftertoctitleskip}
\renewcommand{\cftloftitlefont}{\cfttoctitlefont}
\renewcommand{\cftafterloftitle}{\cftaftertoctitle}
\newcommand{\maketableofcontents}{%
\clearpage
\tableofcontents
\clearpage
\listoftables
\clearpage
\listoffigures
\clearpage\pagenumbering{arabic}
}
\newcommand{\makeappendix}{%
\appendix
% ensure that the TOC picks up the redefined value of \@chapapp
\addtocontents{toc}{\protect\renewcommand\protect\cftchappresnum{\@chapapp\ }}
}
나는 무차별적인 솔루션을 사용하는 것이 좋습니다(존재하는 경우). 미래의 모든 석사/박사 과정 학생이 부록을 포함할 수 있도록 누군가 템플릿의 형식을 지정할 수 있다면 기꺼이 템플릿을 가져와 분기하고 노트에 이 질문에 대한 링크를 연결하겠습니다.
답변1
여기에서 필요한 솔루션을 찾았습니다.부록에 대한 사용자 정의 ToC
꼭 필요한 것은 아니었지만 몇 가지 작은 변경만으로 내가 해야 할 일이 무엇인지 알 수 있을 만큼 충분히 가깝습니다.