Latex 在程式碼中的某一點後停止在 PDF 上顯示文字 (Texmaker)

Latex 在程式碼中的某一點後停止在 PDF 上顯示文字 (Texmaker)

這是我第一次接觸乳膠。在我逐項列出之前,程式碼運行良好,但之後無論我輸入什麼,它都不會顯示在 pdf 中。

\documentclass[12pt,a4paper]{report}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage[utf8]{inputenc} 

\usepackage[T1]{fontenc} 
\usepackage[english]{babel} 
\usepackage[toc, page, header]{appendix} 
\usepackage{fancyhdr} 
\usepackage[plain]{fancyref} 
\usepackage{amsmath}
%\DeclareUnicodeCharacter{FB01}{fi}
\author{Mohammad Bilal}
\usepackage{cite}

\begin{document}
\title{hello}
\maketitle
\let\cleardoublepage\relax 
\let\clearpage\relax
\begin{flushleft}
\chapter {Introduction}
\section {Intrdodution}
\subsection {Background Information}

\end{flushleft}
\subsection {Application}
\subsection {Known Knowledge}
\subsection {Problem}

\section{Research motives}
\section{Objectives}
\section{Structure of thesis }
\chapter{Literature Review}
\section{Laboratory tests}
\subsection{Uniaxial Compression test }
\subsection{Brazilian tensile test}
\section{Relevant Rock Mechanics}


\section{Cracking process}
\subsection{Characteristics}
\subsection{aaaaa}
\subsection{Crack propagation}
\subsection{Quantification}
\section{techniques}

\section{Numerical techniques}
The most commonly applied numerical methods 

\begin{itemize}
\item Continuum methods
\item Discrete methods 
\item Hybrid
\end{itemize}
% Code stops working from here and I see the pdf genrated till the above line
\subsection{methods}
\subsection{ methods}
\section{FEM}
\section{FDEM}
\section{ Method }
\subsection{Background}
\subsection{Theory}
\subsection{Models}
\section{Calibration}
\subsection{Uniaxial Test}
\subsection{Brazilian test}


\bibliography{library} 
\bibliographystyle{Apalike}

\end{document}

答案1

正如我在評論中提到的,這些行\let\cleardoublepage\relax和使得聲明新頁面\let\clearpage\relax變得困難(不可能) ;LaTeX我強烈建議不要重新定義此類基本命令。若要刪除標題頁後的額外頁面,請不要使用該flushleft環境。預設情況下,一切都已左齊平。因此,不要使用這部分程式碼:

\title{hello}
\maketitle
\let\cleardoublepage\relax 
\let\clearpage\relax
\begin{flushleft}
\chapter {Introduction}
\section {Intrdodution}
\subsection {Background Information}

\end{flushleft}
\subsection {Application}
\subsection {Known Knowledge}
\subsection {Problem}

你的程式碼應該有這個:

\title{hello}
\maketitle
\chapter {Introduction}
\section {Intrdodution}
\subsection {Background Information}

\subsection {Application}
\subsection {Known Knowledge}
\subsection {Problem}

相關內容