我有
\documentclass[a4paper]{article}
\begin{document}
\newwrite\myoutfile
\immediate\openout\myoutfile=\jobname-myoutfile.txt
\immediate\write\myoutfile{
aaa
}
\immediate\closeout\myoutfile
\section{Test: Input the Result}
\input{\jobname-myoutfile.txt}
\end{document}
这给了我外部jobname-myoutfile.txt
文件
aaa
里面。
我怎样才能bbb
向输出文件添加新文本(例如(以换行符!))?
这样我就会有
aaa
bbb
答案1
它应该像
\documentclass[a4paper]{article}
\begin{document}
\newwrite\myoutfile
\immediate\openout\myoutfile=\jobname-myoutfile.txt
\immediate\write\myoutfile{
aaa
}
\immediate\write\myoutfile{
bbb
}
\immediate\closeout\myoutfile
\section{Test: Input the Result}
\input{\jobname-myoutfile.txt}
\end{document}