![Latex 在代码中的某个点之后停止在 PDF 上显示文本(Texmaker)](https://linux22.com/image/405653/Latex%20%E5%9C%A8%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9A%84%E6%9F%90%E4%B8%AA%E7%82%B9%E4%B9%8B%E5%90%8E%E5%81%9C%E6%AD%A2%E5%9C%A8%20PDF%20%E4%B8%8A%E6%98%BE%E7%A4%BA%E6%96%87%E6%9C%AC%EF%BC%88Texmaker%EF%BC%89.png)
这是我第一次使用 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}