I am working on an econometric thesis, and I need to import my stata regression output to LaTeX. I have saved the results as a .tex
file on my desktop, but the \include
or \import
commands don't seem to get the data into my LaTeX doc. Is there any alternate command that I should be using instead?
1 Answer
According to your question, you have saved the regression results as a .tex
file on your desktop. However, it is not clear if the result is Latex source code or another data representation. You must check what is the content of the file.
As mentioned by David Beauchemin, you can produce Latex files inside Stata using the texdoc
module/command. You may check many websites and slides explaining how to produce latex content using that module.
- in a page the Unibe website
- in a paper of the Stata Journal
- in a working paper of the Universitat Bern
Once you have a file in Latex, you may "import" that file using \input
. There is an import latex module that adds supports for the mentioned commands \import
and \subimport
. However, if you are not creating very complex documents, you may import the file without using this module.
If you have a file in another format, you must find which it is. Depending on the format, you may find other Latex modules to include the content in your documents.
\include{foo.tex}
the filefoo.tex
is in the root directory of your project folder?\import
isn't provided by the LaTeX kernel (so you'd need to say which package you tried to use it with). If you simply want the contents of the.tex
file inserted into the document, then\input
is more appropriate than\include
. (See When should I use \input vs. \include?.) If your results file is on the desktop, are you trying to add the full path to it? (I'm guessing your document code isn't also on the desktop.) Do you get any error messages?\input
not\include
(assuming the file is in fact tex syntax)