Как прочитать несколько файлов и записать содержимое в один файл в Tex? - PullRequest
1 голос
/ 02 мая 2019

У меня есть задача, первым шагом которой является чтение нескольких отдельных файлов и реорганизация содержимого в новый отдельный файл в 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!

Это похоже на бесконечную рекурсию, но я не знаю, откуда это получается. Заранее спасибо за любую помощь.

...