Announcement

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

  • Import do-file in LaTeX

    Hi all,

    How can I import my do-file from Stata into LaTeX? Maybe this is more a question for experts in LaTeX than for experts in Stata, but at least I could try it

    Best regards,
    Nouschka Snijders


  • #2
    Nouschka,

    Stata Journal provides a number of examples and its own style for LaTeX publications:
    http://www.stata-journal.com/author/

    You can also try including with \verb for verbatim text.

    Best, Sergiy

    Comment


    • #3
      Hi all,

      I regularly use LaTeX's package -listings- to achieve embedded Stata code in LaTeX documents. Its LaTeX-command \lstinputlisting{filename} includes a do-file into a LaTeX-document output and typesets it as verbatim.

      listings can also (by defining syntax highlighting styles) highlight comments and keywords. Several syntax definition rules (such as C, R or C+) are delivered with the package. Unfortunately, you have to define a style on your own to achieve Stata syntax highlighting.

      You also may want to have a look at this thread here on Statalist, where a similar issue has been discussed.

      Regards
      Bela
      Last edited by Daniel Bela; 07 Mar 2017, 05:26. Reason: added link to older thread

      Comment


      • #4
        I recommend texdoc.
        Code:
        search texdoc

        Comment


        • #5
          Daniel Bela \lstinputlisting[]{dofile.do} indeed worked, thankyou!

          Comment

          Working...
          X