使用组合类时出现 Tex 容量错误

使用组合类时出现 Tex 容量错误

使用组合类和主文件的以下模拟示例:

\documentclass[11pt,a4paper]{combine}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsthm,amsmath,mathrsfs}
\usepackage{amssymb,amsthm,amsmath}
\usepackage{tikz-cd}

\title{ABC-116 Journal}
\author{A. M. Editor}
\date{2016.2}
\begin{document}
\pagestyle{combine} % use the combine page style
\maketitle % main title
\tableofcontents % main ToC
\clearpage
\section{Editor’s introduction} \label{intro} % into main ToC (section 1)
In the article by A.~N.~Author on page ...
\begin{papers} % start of individual articles/papers
\coltoctitle{An article} % first article title into main ToC
\coltocauthor{A.~N.~Author} % first authors into main ToC
\import{paper1}
\clearpage

\end{papers}

\end{document}

与论文1一起:

\documentclass{amsart}

\usepackage[utf8]{inputenc}
\usepackage{amsthm,amsmath,mathrsfs}
\usepackage{amssymb,amsthm,amsmath}
\usepackage{tikz-cd}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{xca}[theorem]{Exercise}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}



\numberwithin{equation}{section}


\title{Different Ways to Differentiate $x^n$}
\author{A}

\begin{document}

\maketitle

\begin{abstract}
We present distinct ways of proving that $(x^n)'=nx^{n-1}$. 
\end{abstract}



The identity $(x^n)'=nx^{n-1}$ is one of the most used in a Calculus course.  It immediately allows the differentiation of any polynomial by a simple formula. Being an equation of utmost importance, it is desirable to have different proofs of the fact (this is a recurrent trend in mathematics; take the Pythagorean Theorem as a prime example, \cite{pyth} alone being a webpage having 118 proofs of it).

\end{document}

导致我出现以下错误:“!Tex 容量超出,抱歉 [输入堆栈大小=5000]。t \end{document}”

为什么会发生这种情况?我该如何解决这个问题?也许重要的一点是,当我尝试单独加载 paper1 时没有出现错误。

编辑:感谢 David Carlisle,上述错误已得到纠正。但是,使用完整代码时,错误又出现了。下面是完整代码。我认为应该注意的是,如果我删除“第一证明”子部分下面的所有内容,则不会弹出任何错误。

\section{The Formula.}

\begin{theorem}
Let $f:\mathbb{R} \to \mathbb{R}$ be given by $f(x)=x^n$, where $n \in \mathbb{N}$. Then
$$f'(x)=nx^{n-1}$$
for all $x$.
\end{theorem}

\subsection{First proof.}

\begin{proof} This is an application of the binomial theorem. Indeed, we have
\begin{align*}
f'(x)&=\lim_{h \to 0}\frac{f(x+h)-f(x)}{h} \\
&=\lim_{h \to 0}\frac{(x+h)^n-x^n}{h} \\
&=\lim_{h \to 0}\frac{\sum\limits_{i=0}^n \binom{n}{i} x^{n-i}h^i - x^n}{h}  \\
&=\lim_{h \to 0}\frac{\sum\limits_{i=1}^n \binom{n}{i} x^{n-i}h^i}{h} \\
&=\lim_{h \to 0} \sum\limits_{i=1}^n \binom{n}{i} x^{n-i}h^{i-1}  \\
&=\binom{n}{1} x^{n-1}=n x^{n-1}.
\end{align*} 
\end{proof}

\subsection{Second proof.}

\begin{proof} This is an application of the well-known equality $t^n-x^n=(t-x)(t^{n-1}+xt^{n-2}+\cdots+x^{n-2}t+x^{n-1})$.
\begin{align*}
f'(x)&=\lim_{t \to x}\frac{f(t)-f(x)}{t-x} \\
&=\lim_{t \to x}\frac{t^n-x^n}{t-x} \\
&=\lim_{t \to x}\frac{(t-x)(t^{n-1}+xt^{n-2}+\cdots+x^{n-2}t+x^{n-1})}{t-x}  \\
&=\lim_{t \to x} t^{n-1}+xt^{n-2}+\cdots+x^{n-2}t+x^{n-1} \\
&=\lim_{t \to x} x^{n-1}+\cdots+x^{n-1}  \\
&=n x^{n-1}.
\end{align*} 

\end{proof}

\subsection{Third proof.}

\begin{proof} This proof follows induction and Leibniz's Rule. First, the theorem is trivial for $n=1$. For $n+1$, we have
$$ f(x)=x \cdot x^n$$
\begin{align*}
\implies f'(x)&=1 \cdot x^n+ x \cdot n x^{n-1} \\
&=x^n+nx^n \\
&=(n+1)x^n.
\end{align*} 

\end{proof}

\subsection{Fourth proof.}

\begin{proof} We have 
$$x^n=e^{\log(x^n)}=e^{n \log x}.$$
Therefore, the chain rule implies
\begin{align*}
f'(x)&=e^{n \log{x}}\frac{1}{x} \\
&=x^n  \cdot \frac{n}{x} \\
&=n x^{n-1}.
\end{align*} 

\end{proof}

\section{About the fourth proof.}

The attentive reader may have noticed some issues on this last proof. Firstly, the proof assumes $x>0$. That is really a non-issue, as one can take $(-x)^n$ and use the chain rule for this case. For $x=0$, one could use the fact that if $\lim\limits_{x \to 0} f'(x)=L$ and $f$ is continuous at $0$, then $f'(0)=L$ (this is a nice Real Analysis exercise. Maybe one of the most important parts of this exercise is realizing why it is not trivial). 

However, one glaring issue is the apparent circularity. How can one use $\exp$ and $\log$ and not have passed through the derivative of $x^n$ before? Of course, if one defines $\exp$ by its well-known series, then the proof is obviously circular. However, if one defines $\exp$ as the unique solution of $f'=f; \quad f(0)=1$, then the proof is not circular, as we will show.

\subsection{Non-circularity.}

First, the existence and uniqueness of a solution to $f'=f; \quad f(0)=1$ can be seen to follow from Picard-Lindelof. However, this ODE is so particular that a more elementary way to the solution is available. For that, define $\log: \mathbb{R}^+ \to \mathbb{R}$ by
$$\log(x):=\int_1^x \frac{1}{t} dt.$$
Since $\log'(x)=\frac{1}{x}$ by the Fundamental Theorem of Calculus, we have that $\log$ is strictly increasing. We also have that, fixing $y>0$, $f(x)=\log(xy)$ and $g(x)=\log(x)+\log(y)$ are such that $f'(x)=\frac{1}{x}=g'(x)$. Since $f(1)=g(1)$, we have that $f(x)=g(x)$ for all $x$, and it follows that
\begin{equation} \label{eq1}
\log(xy)=\log(x)+\log(y)
\end{equation}
for all $x,y>0$. It follows now that
$$\log(2^n)=n\log(2),$$
and we have that $\log(x) \to \infty$ as $x \to \infty$ (since obviously $\log(2)>0$, and $\log$ is strictly increasing as we have seen). Equation (\ref{eq1}) also implies
$$\log(1)=\log(x)+\log(1/x),$$
from which we have that $\log(x) \to -\infty$ as $x \to 0^+$. Putting together all this, we have that $\log: \mathbb{R}^+ \to \mathbb{R}$ is a bijection. We define $\exp:=\log^{-1}$. It now follows from the chain rule that $\exp'=\exp$, since
$$\log(\exp(x))=x \implies \frac{1}{\exp(x)} \cdot \exp'(x)=1 \implies \exp'(x)=\exp(x).$$
It is also trivial that $\exp(0)=1$, so we have arrived at our solution for $f'=f; \quad f(0)=1$ (Note that nowhere did we need $(x^n)'$). Now, induction on equation (\ref{eq1}) also implies 
$$\log(x^n)=n \log(x)$$
for $n$ a natural number. Therefore,
$$x^n=\exp(\log(x^n))=\exp(n \log(x)),$$
and this is what we used in the fourth proof, together with the chain rule and the derivatives of $\exp$ and $\log$.

Note that we did not justify (nor did we need) the fact that $\exp$ is the unique solution to our differential equation. For the sake of completeness, the proof of such fact is immediate by assuming the existence of another solution $g$ and analysing $h:=\frac{g}{\exp}$ (that is, showing it is constant and equal to $1$). We leave this as an exercise. 

\subsection{More on the fourth proof.}

The fourth proof may be (unfairly) taken as an \emph{ad hoc} proof. However, this isn't the case. Logarithms take products and convert them into sums. Derivatives of sums are trivial. It is only natural to try to convert a problem to something trivial. The price we pay, of course, is the development of the theory (existence of $\log$, chain rule etc).

In fact, this property of logarithms is quite useful. Consider the following commutative diagram, which is a rewording of equation (\ref{eq1}).
\begin{center}
\begin{tikzcd}
\mathbb{R}^+ \oplus \mathbb{R}^+ \arrow[d, "\times"] \arrow[r,"\log \oplus \log"] & \mathbb{R} \oplus \mathbb{R}  \arrow[d,"+"]\\
\mathbb{R}^+  \arrow[r, "\log"] &  \mathbb{R}.
\end{tikzcd}
\end{center}
Since $\exp=\log^{-1}$, we have the equivalent diagram
\begin{center}
\begin{tikzcd}
\mathbb{R}^+ \oplus \mathbb{R}^+ \arrow[d, "\times"] \arrow[r,"\log \oplus \log"] & \mathbb{R} \oplus \mathbb{R}  \arrow[d,"+"]\\
\mathbb{R}^+   &  \arrow[l, "\exp"] \mathbb{R}.
\end{tikzcd}
\end{center}
And this is (allegedly) how old calculators did multiplication: through sums and tables of logarithms and exponentials. Indeed, the above commutative diagram transfers a multiplication to doing an exponentiation of a sum of logarithms.


\section{Final commentary.}

Not only the fourth proof has the theoretical insight given in the last subsection, but it also provides an unified and simple proof for the case $f(x)=x^r$, $x>0$, since $x^r=\exp(r \log(x))$. Indeed, depending on the text, this is the very definition of $x^r$.



%\begin{acknowledgment}{Acknowledgment.}
%The authors wish to thank the Greek polymath Anonymous, whose prolific works are an endless source of inspiration.
%\end{acknowledgment}

\begin{thebibliography}{1}
\bibitem{pyth} http://www.cut-the-knot.org/pythagoras/

\end{thebibliography}

%\begin{biog}
%\item[Aloizio Macedo]
%\end{biog}

\makeatletter
\def\@EveryShipout@Org@Shipout{\pdfprimitive\shipout}
\makeatother
\end{document}

明确地说,错误如下:

"! TeX 容量超出,抱歉 [输入堆栈大小=5000]。t l.57 \end{align*} 如果你确实需要更多容量,

你可以请一位巫师来把我放大。

以下是您使用的 TeX 内存量:

493921 个字符串中有 13551 个

3144867 个字符串字符中有 275897 个

记忆单词 3000000 中的 359751 个

15000+200000 个多字母控制序列中有 16570 个

72 种字体的字体信息有 23489 个字,共 3000000 个字,其中 9000 个

8191 条连字例外,共 841 条

5000i、10n、82p、457b、10290s 堆栈位置,位于 5000i、500n、10000p、200000b、50000s 之外

!==> 发生致命错误,未生成输出 PDF 文件!“

答案1

everyshi(pout) 包本身陷入了循环。这可以使其脱离循环,但并不是真正正确的解决方法。

您可以paper1.tex按如下方式结束

\makeatletter
\def\@EveryShipout@Org@Shipout{\pdfprimitive\shipout}
\makeatother
\end{document}

相关内容