Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Best way to include a dofile into a LaTeX Document?

    Hello,

    I want to append a dofile into my latex file.

    What is the easiest way to do so?

    Thank you very much in advance.

    Even so I have stata on the same mac as latex, it does not work to simply type
    Code:
    \documentclass[6pt]{article}
    \usepackage{amsmath}
    \usepackage{a4}
    \usepackage{graphicx}
    \usepackage{caption}
    \usepackage{setspace}
    \usepackage{booktabs}
    \usepackage[left=.5cm,right=.5cm,top=1cm,bottom=2cm]{geometry}
    \usepackage{longtable}
    \usepackage{float}
    
    \usepackage{calc, ifthen, alltt}
    \usepackage{subcaption}
    \usepackage{stata}
    
    \allowdisplaybreaks
    
    
    
    
    
    \begin{document}
    \catcode`\#=12
    
    \input{tabzus.tex}
    \clearpage
    \newpage
    
    \begin{stata}
    ***Regressionen
    
    cd "..."
    use "data.dta",clear
     
    ...
    
    \end{stata}
    
    
    %\catcode`\#=6
    
    \end{document}
    I always get the error stata.sty not found.

    Any hints or suggestions? Thank you very much in advance.

  • #2
    Andrea,
    This is more a LaTeX issue than a Stata one, so you might not find many answers here.
    However, I guess the error comes from the \usepackage{stata} in Latex, which makes Latex find for a Stata.sty package and doesn't find it.
    Make sure the stata.sty package exists, and is stored in the good repertory.

    I don't exactly know what display do you want, but why not simply copy paste your do-file in the Latex file?
    Or you could try \input{do-file.do} but I've never tested such a thing. Perhaps you would have to save your do-file into txt file before.
    Best,
    Charlie

    Comment


    • #3
      Okay, thank's Charlie.

      Comment


      • #4
        You can use the Statax package, which also provides syntax highlighter in your LaTeX document. The do-file can be automatically included as is.
        ——————————————
        E. F. Haghish, IMBI, University of Freiburg
        [email protected]
        http://www.haghish.com/

        Comment

        Working...
        X