TransWikia.com

newwrite: Adding text to a existing outfile

TeX - LaTeX Asked on April 19, 2021

enter image description here

I have

documentclass[a4paper]{article}
begin{document}
newwritemyoutfile
immediateopenoutmyoutfile=jobname-myoutfile.txt
immediatewritemyoutfile{
aaa
}
immediatecloseoutmyoutfile

section{Test: Input the Result}
input{jobname-myoutfile.txt}
end{document}

which gives me the external file jobname-myoutfile.txt with

aaa

inside.

How can I add new text, like bbb (in a newline!), to the outfile?

So that I will have

aaa
bbb

One Answer

It should work like

documentclass[a4paper]{article}

begin{document}
newwritemyoutfile
immediateopenoutmyoutfile=jobname-myoutfile.txt
immediatewritemyoutfile{
aaa
}

immediatewritemyoutfile{
bbb
}

immediatecloseoutmyoutfile


section{Test: Input the Result}
input{jobname-myoutfile.txt}
end{document}

Answered by cis on April 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP