Announcement

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

  • markstat's syntax of include html

    Dear Stata users,

    In using -markstat- (from SSC) written by German Rodriguez, I encounter a question about inserting .html file into markdown document. In the following link http://data.princeton.edu/stata/markdown/tabout,
    German Rodriguez suggests that
    we use tabout to generate table34.html and then simply .include table34.html in the document.
    However, it seems can not work well with the .include mark. Below is what I get after runing tabout.stmd in Stata.
    Code:
    markstat using tabout, docx
    Click image for larger version

Name:	markstat.png
Views:	1
Size:	13.9 KB
ID:	1473668

    Last edited by Chen Samulsion; 06 Dec 2018, 05:14.

  • #2
    PS. -markstat- in my computer is updated, and runs well (tabout.stmd defined in the second code).
    Code:
    . which markstat
    c:\ado\plus\m\markstat.ado
    *! v 2.2.0 <[email protected]> 26oct2016 last rev 7may2018
    . markstat using tabout, docx
    Code:
    The quietly running part
    ----------------------------
    ```s/
        quietly sysuse auto, clear
        quietly sum weight
        local meanwt = r(mean)
        quietly sum length
        local meanlen = r(mean)
        local obs = r(N)
    ```
    
    The title of my short report
    ----------------------------
    
    This is an excerpt of the report to focus on the dynamic parts.
    And now we have an important result: __`s %3.2f `meanwt'`__ is
    the average weight of all vehicles. And a second important 
    result: __`s %3.2f `meanlen'`__ is the average length.
    
    ```s/
        tabout3 rep78 foreign using table34.xls, replace ///
        font(italic) c(mean weight) f(0c) sum ///
        twidth(9) h1(Car type (mean weight in lbs.)) h3(nil) ///
        title(Table 34: Short report example) fn(auto.dta)
    ```
    Report is over.
    Click image for larger version

Name:	tabout.png
Views:	1
Size:	23.6 KB
ID:	1473674

    Comment


    • #3
      I think you may need to use the "strict" option - so
      Code:
       markstat using tabout, docx strict
      as opposed to what you have above.

      Comment


      • #4
        Hi Isaac Maddow-Zimet, adding option -strict- is not a right solution. Problem is as same as that in #1.
        Ps. We can install -tabout- version 3 beta which is required by German Rodriguez from http://tabout.net.au/docs/home.php
        Last edited by Chen Samulsion; 06 Dec 2018, 23:09.

        Comment


        • #5
          The problem is discussed in post 1424404 on January 4.

          Comment


          • #6
            Thank you Anders Alexandersson, After reviewing the introduction again I get that German Rodriguez using the following
            Code:
            markstat using tabout, strict
            intents to produce a html file, not a docx file.

            Comment


            • #7
              Glad to see that Anders Alexandersson and Chen Samulsion sorted this out already. The .include syntax is indeed intended to be used only when the target output format is html. I have modified the -markstat- example page using -tabout- at http://data.princeton.edu/stata/markdown/tabout to indicate this fact more clearly.As noted in the earlier discussion that Anders referred to, if the target is docx you can always generate html and open the resulting file in Word. If you use -tabout- to generate LaTeX you can include the output using LaTeX's \input{filename} command.

              Comment


              • #8
                Thank you German Rodriguez, -markstat- is a very powerful package which makes Stata partly catch up with R in literate programming. I would have more good experience if I had mind myself to set it carefully using -whereis-.

                Comment

                Working...
                X