LaTeX 中空白行上的 \hbox 错误过大?

LaTeX 中空白行上的 \hbox 错误过大?

我对此感到很困惑。在我的代码中,第 39 行完全是空白的,其他地方没有错误,所有内容都适合边距,但我仍然收到错误Overfull \hbox (34.204pt too wide) in paragraph。这与行上的内容无关,因为无论是否为空,错误始终是第 39 行。我在下面附上了我的代码,还有其他人遇到过这个问题吗?

\documentclass[11pt]{article}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{mcode}

\renewcommand{\arraystretch}{1.5}
\renewcommand{\theenumi}{(\roman{enumi})}
\renewcommand{\labelenumi}{\theenumi}

% \mcodelisting{Program/Function descriptor}{Usage}{filename with extension}
\newcommand{\mcodelisting}[3]{\pagebreak
\appendix{\textbf{#1} \mcode{2-3/#3} \textbf{#2}}
\lstinputlisting{C:/Users/******/Documents/MATLAB/2-3/#3}
}


\title{2.3 Continued Fractions}         % used by \maketitle
\author{}
\date{}

\begin{document}
\maketitle

\section*{Rational Numbers}

\subsubsection*{Programming Task}
A program using the given algorithm to compute the partial quotients and convergents of a fraction $u/v$ is shown on page ??.


\begin{enumerate}
\item Taking $u = 112, v = 27$ gives partial quotients $a_n$ as 4,6,1,3 and convergents $p_n/q_n$ as $\frac{4}{1}, \frac{25}{6}, \frac{29}{7}, \frac{112}{27}$
\item Taking $u = 4803, v = 3395$ gives partial quotients 1,2,2,2,3,6 and 13 with convergents $\frac{1}{1}, \frac{3}{2}, \frac{7}{5}, \frac{17}{12}, \frac{58}{41}, \frac{365}{258}, \frac{4803}{3395}$
\item Taking $u = 276272, v = 72159$ gives partial quotients 3,1,4,1,5,9,2,6,5 and 3 with convergents $\frac{3}{1}, \frac{4}{1}, \frac{19}{5}, \frac{23}{6}, \frac{134}{35}, \frac{1229}{321},     \frac{2592}{677}, \frac{16781}{4383}, \frac{86497}{22592}, \frac{276272}{72159}$
\item Finally, if $u = 11683474147$ and $v = 863334886$ then the partial quotients are 13,1,1,7,11,1,2,5,2,3,1,1,9,1,2,12,9,5 and the convergents are $\frac{1}{1}$
\end{enumerate}


% Page break inserted by \mcodelisting
\mcodelisting{Program}{for question 1}{question1.m}

\end{document}             % End of document.

(本例中第 39 行是紧接在 之前的空白行% Page break ...

答案1

问题似乎是你的 m 文件包含太长的行。

相关内容