Sublime with Stata

This is an example document to illustrate how it works.

1. Markstat

Insert Stata code block wherever you want as following:

. ssc describe markstat

package markstat from

      'MARKSTAT': module to support literate data analysis using Stata and Markdown

       The markstat command can be used to combine Stata code and
      results with comments and annotations written in Markdown,
      producing by default a web page. If a LaTeX installation is
      available, -markstat- can produce a PDF file from exactly the
      same input script. The command works by separating the code from
      the narrative, running the code through Stata, translating the
      narrative from Markdown to HTML or LaTeX using Pandoc, and then
      weaving the output files together. This avoids tedious cutting
      and pasting, and promotes reproducible research.  The command
      puts a high premium on the simplicity of the input file, which
      emphasizes readability much in the spirit of Markdown itself. It
      supports Stata and Mata inline code, strict code blocks with an
      option to hide the commands, and mathematical equations. It can
      also handle citations, resolving them using a BiBTeX database and
      listing them at the end of the document. The command is described
      in a forthcoming Stata Journal article, and is supported by a
      website at, which
      includes installation instructions, documentation, examples, and
      a comparison with the new tools in Stata 15.
      KW: markdown
      KW: data analysis
      Requires: Stata version 14, whereis from SSC, pandoc
      Distribution-Date: 20191213
      Author:  German Rodriguez, Princeton University
      Support: email

INSTALLATION FILES                             (type net install markstat)
(type ssc install markstat to install)

. local 1 200

. if `1'==200 {
. global mymacro "`1'"
. di $mymacro
. }

. sysuse auto // this is a comment
(1978 Automobile Data)

. gen price2=ln(price)

You can make a quote with > as following:

this is a quote block,

which can be nested!

like this–note that you need a blank line.