7.2 inputting Latex files into SW document

This is tricky. But just do this and do not follow any other instructions given in other places, they are all very confusing. Here is the deal.

When you write input{file.txt} in SW document main.tex, then it will not find file.txt becuase SW process main.tex is some other temporary folder. The easiest way to do this, is to make main.tex as a master document, then it will use the current folder.

To make main.tex as master document, create a file called empty.tex in the same folder and type in it exactly the following (using a text editor)

%TCIDATA{LaTeXparent=0,0,main.tex}
 

That is all, the one line above. Now go back to main.tex, and open that in a text editor (not in SW) and go to the end of the file just before end of the document, and add these lines, including the comments! this is important.

%TCIMACRO{\QSubDoc{Include empty}{\input{empty.tex}}}% 
%BeginExpansion 
\input{empty.tex}% 
%EndExpansion
 

Now, close everything. Now main.tex is a master document. Now you can write \input{file.txt} in master.tex and SW will now inlcude the file.txt (assuming of course the file is in the same folder as master.tex).

So, for each latex file that is meant to include input files, we must have an empty.tex file there, and add it at the bottom of the document itself as shown above.