我有一个任务,第一步是读取几个单独的文件,然后将内容重新组织到Tex中的一个新文件中。我尝试使用以下命令:
\newwrite\myfile
\immediate\openout\myfile=10solutions.tex
\def\temp{\Input{inputFile}}
\let\newtxt\temp
\temp
\newtxt
\immediate\write\myfile{\newtxt}
\immediate\closeout\myfile
我可以看到\ temp和\ newtxt的输出正确。但是,当我尝试写入“ myfile”时,它报告以下错误:
! TeX capacity exceeded, sorry [input stack size=5000].
\reserved@a ->\def \reserved@a
*{\@vspacer }\reserved@a
l.60 \immediate\write\myfile{\newtxt}
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.
Here is how much of TeX's memory you used:
14143 strings out of 492902
197654 string characters out of 3140037
354467 words of memory out of 3000000
17607 multiletter control sequences out of 15000+200000
109263 words of font info for 149 fonts, out of 3000000 for 9000
1141 hyphenation exceptions out of 8191
5000i,18n,77p,3236b,486s stack positions out of 5000i,500n,10000p,200000b,50000s
! ==> Fatal error occurred, no output PDF file produced!
它看起来像是无限递归,但我不知道它从何而来。预先感谢您的帮助。