Latex 在代码中的某个点之后停止在 PDF 上显示文本(Texmaker)

Latex 在代码中的某个点之后停止在 PDF 上显示文本(Texmaker)

这是我第一次使用 latex。在我列出条目之前,代码运行良好,但之后无论我输入什么,它都不会显示在 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}

相关内容