Announcement

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

  • sttex: New dynamic document package for Stata and LaTeX available from SSC

    Thanks to Kit Baum, a new dynamic document package to integrate Stata results into a LaTeX document is available from the SSC Archive. Type

    Code:
    . ssc install sttex, replace
    to install the package. Stata 11 or newer is required. The package is also available from GitHub, see https://github.com/benjann/sttex.

    Description: sttex is a command to process a LaTeX source file containing blocks of Stata code. sttex will extract the Stata commands into a do-file, run the do-file, and then weave the LaTeX source and the Stata output into a target LaTeX document. Optionally, sttex also typesets the LaTeX document and displays the resulting PDF. Various tags can be used within the LaTeX source file to define the information that will be processed by sttex. A main feature of sttex is that it detects whether Stata code changed between calls. If the code did not change, execution of Stata commands will be skipped to save computer time. It is also possible to partition a source file into independent sections, such that only the sections affected by changes will be executed.

    A brief presentation on sttex can be found at https://ideas.repec.org/p/boc/lsug22/14.html.

    Best,
    ben

  • #2
    An update to sttex is available SSC, fixing some bugs and adding some more features (see https://github.com/benjann/sttex/ for details). To install the update, type

    Code:
    . ssc install sttex, replace
    Note that the definition of the database files maintained by sttex changed. Unfortunately, the change is such that it was not possible to provide backward compatibility. This means that sttex will discard any preexisting database and will hence reevaluate all code in a file even if the file has already been processed by the previous version of sttex. For future updates I will try to limit myself to changes that will not break backward compatibility.

    ben

    Comment


    • #3
      Yet another update to sttex is available from SSC, type

      Code:
      . ssc install sttex, replace
      The new version now has functionality to include external files generated by the code. For example, you can type:

      Code:
      \begin{stata*}
         sysuse auto
         regress price foreign weight
         etable, export(example.tex, tableonly)
      \end{stata*}
      \stfile{example.tex}[erase]
      This pastes the table written by etable into the target document and removes the file from disk.

      The functionality is not strictly needed as you could also bind the table into the document using \input{}, but sometimes an automatic function is convenient (an advantage is, for example, that you can use the same filename over and over).

      Furthermore, sttex was not fully functional on Windows (a system I personally do not use; thanks to Paul Lambert for reporting the problem) because it did not replace "" by "/" in file paths written to the LaTeX document (LaTeX always requires "/", even if used on Windows). This is fixed.

      ben

      Comment

      Working...
      X