Tex 容量超出,抱歉输入堆栈大小=5000

Tex 容量超出,抱歉输入堆栈大小=5000

我正在将我的 latex 文件转换为 pdf,当我\end \end在终端输入时,弹出以下错误消息:

! Tex capacity exceeded, sorry [input stack size=5000].
\end #1->\csname end#1

我的文件代码是:

\documentclass[11pt]{article}
\usepackage[demo]{graphicx}
\usepackage{amsmath}
\graphicspath{ {~/ITCourse/2018/CSC2408/Assignment2/} }
\title{Addison Sells, 22 December 2017}

\begin{document}

\maketitle

\tableofcontents

\section{Introduction}

Hi, my name is Addison Sells. The courses I have enrolled in are CSC2408 - Software Development Tools, CIS1000 - Information Systems Concepts, CMS1000 - Communication and Scholarship and CSC1401 - Foundation Programming 

\section{Verbatim Text}
\begin{verbatim*}
#!/bin/bash

# example of using arguments to a script
echo "My first name is $1"
echo "My surname is $2"
echo "Total number of arguments is $#"
\end{verbatim*}

\section{Formulae}

\begin{equation}
x= \frac {-b \pm \sqrt {b^2 - 4ac}}{2a} 
\end{equation} 

\begin{equation}
\triangle (x)=
\left \{
 \begin{tabular}{ccc}
 1 if x > 0
 -1 if x < 0
 0 otherwise 
 \end{tabular}
 \right.
\end{equation}

\section{Table} 

\begin{table}[h!] 
\begin{tabular}{ |l|c|r|} 
\hline
Category & \multicolumn{2} {|c|} {Tools} \\
 & Command & Description \\
\hline
Editor & emacs & Emacs extensible text editor \\
\hline
 & vi & Visual Editor \\
\hline
Scripting & bash & GNU Bourne-Again SHell \\
\hline
 & perl & Pratical Extraction and Report Language \\ 
\hline
Document & rcs & Revision Control System \\
\hline
Managment & LaTeX & Document Typesetting Package \\
\hline`
 & make & Managing Project Utility \\
\hline
\end{tabular}
\caption{Table of some Unix utilities}
\end{table} 

\section{Biography}
\begin{figure}
\includegraphics[width=8cm,height=8cm]{IMG0390.PNG}
\end{figure}

Addison Sells was born on the 6th of April 1998 to parents Emily Swann and Adam Sells. Addison lived in Brisbane until the age of 4, when he moved to Toowoomba, where he has lived since. Addison attended Toowoomb East State School and Toowoomba State High School where he graduated with an OP of 16. After finishing high school Addison attended the University of Southern Queensland Toowoomba campus where he has completed 1 semester of Bachelor of Commerce and 1 semester of Bachelor of Information Technology



\section{Bash Script 1}
\#!/bin/bash 
name=\${0\#\#*}
Usage="Usage: {script name} {target file}"
if [ \$\# -eq 0 ]; then 
    echo \$Usage
    exit 1
fi
until [ \$\# -eq 0 ]
do 
    case \$1 in
        -h) echo \$Usage
            exit 0;;
        *) FILE=\$1
            shift;;
    esac
done
if [ ! -f \$FILE ]; then
    echo "'\$FILE' does not exist"
else 
    sed -i '\verb|/^\s*\/\*.*\*\/\s*\$/g'| \$FILE
fi

\section{Bash Script 2}
\#!/bin/bash  
name=\${0\#\#*}
Usage="Usage: {script name} {target file}"
if [ \$\# -eq 0 ]; then 
    echo \$Usage
    exit 1
fi
until [ \$\# -eq 0 ]
do 
    case \$1 in
        -h) echo \$Usage
            exit 0;;
        *) FILE=\$1
            shift;;
    esac
done
if [ ! -f \$FILE ]; then
    echo '\$FILE' does not exist
else 
     egrep -v \verb|'\S\s+\S'| \$FILE
fi

我删除了部分代码并进行了测试,试图找出问题所在,但没有成功。

答案1

你没有

\end{document}

在文件中,因此 tex 运行到文件末尾并开始使用其交互*提示从终端获取输入。

*
(Please type a command or say `\end')

如果你\end在 latex 中输入,你会得到错误的内容,因为\end已被重新定义为结束环境,你可以输入,\stop但如果你输入\end两次,你会得到相当于\end{\end}和您显示的错误。

(Please type a command or say `\end')
*\end

*\end
! TeX capacity exceeded, sorry [input stack size=5000].
\end #1->\csname end#1
                      \endcsname \@checkend {#1}\expandafter \endgroup \if@e...
<*> \end

!  ==> Fatal error occurred, no output PDF file produced!

解决方案是添加\end{document}到文件末尾。

相关内容