未包含章节

未包含章节

您好,我正在尝试撰写包含不同章节的论文,我的主 tex 文档如下所示:

\documentclass[11pt a4paper]{report}

\usepackage[left=4.0cm, right=1.5cm, top=1.5cm, bottom=2.5cm]{geometry}
\usepackage{graphicx}
\usepackage{float}
\usepackage{grffile}
\usepackage{amsmath}
\usepackage{fixltx2e}
\usepackage{textgreek}
\usepackage{setspace}
\onehalfspacing

\usepackage[nottoc,notlof,notlot]{tocbibind} 
\renewcommand\bibname{References}

\graphicspath{ {./Thesis pictures/} }

\includeonly{Chapter3_content1}

\begin{document}
\title{
\huge{\textbf{Luminescent properties of semiconductor materials}}\\[1.2cm]
\Large{A thesis submitted to the University of Manchester \\ for the degree of Doctor     of Philosophy in the Facultly of Engineering and Physical Science} \\[1cm]
\Large{2015} \\
\Large{Rachel Southern-Holland} } 
\author{} 
\date{}
\maketitle

\newpage

\include{F:/Rachel_thesis/Chapters/Chapter3_content1}


\addcontentsline{toc}{chapter}{References}
\bibliography{PhD_Library}
\end{document}

tex 文件 Chapter3_content1 如下所示

\chapter

this is my methods chapter

但是,当我编译主文档时,我只得到了标题页,而没有得到 Chapter3_content1 文件中的内容。有人知道我做错了什么吗?非常感谢

答案1

以下有效。请注意,您在\includeonly和中输入的内容\include应该一致。我还修剪了代码,使其更像 MWE。

\documentclass{report}
\usepackage{filecontents}
\begin{filecontents}{Chapter3_content1}
\setcounter{chapter}{2}
\chapter{My third chapter}
The content of the third chapter is here.

Also, this is my methods chapter.
\end{filecontents}
\begin{filecontents}{Chapter4_content1}
\chapter{My fourth chapter}
\end{filecontents}
\includeonly{Chapter3_content1}
\begin{document}
\title{Luminescent properties of semiconductor materials}
\author{Rachel Southern-Holland}
\maketitle
\include{Chapter3_content1}
\include{Chapter4_content1}
\end{document}

相关内容