Announcement

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

  • MarkDoc 3.9.3 : Dynamic text made easier

    MarkDoc has a new release (3.9.3), with modified document layouts, providing a syntax highlighter in LaTeX documents in addition to HTML and PDF, and above all, a modified way for writing dynamic text in do-file, which greatly simplifies writing dynamic text in Stata. You can read about the new feature for writing dynamic text on GitHub WiKi.

    Basically, with the new feature, you can display values of Scalars, Macros, Matrices, and also observations from the data set inside the documentation, without using the txt command. A new marker was developed to display the values dynamically, which is <!*!> where * is a scalar, `numericLocal' or $numericGlobal, "`stringLocal'", "$stringGlobal", Matrix[r,c], or variable[n] which is an observation from the nth row of a variable.

    Here is an example:

    Code:
    local macro a = 1
    scalar b = 2
    matrix define A = (20,30\40,50)  
    
    /*** This is heading <!`a'!>
    =======================  
    
    The values of a matrix can be displayed within the text. For example,  you can write <!A[1,1]!> which
    shows the scalar of the first row and  first column of the matrix in your documentation. This feature
    makes  writing dynamic text much more convenient compared to the previous procedure.  
    
    This is heading <!b!>
    ---------------------  
    
    REMEMBER, that this procedure only works if you execute a do-file with markdoc, that is, using the
    `markdoc filename.do, export(format)` syntax.  
    ***/
    Read more here...

    If you are using MarkDoc on daily basis, you can "watch" (subscribe) to the package updates on GitHub.

    To update your MarkDoc to the current version, use the github package:

    Code:
    github install haghish/markdoc
    Last edited by haghish; 01 Dec 2016, 04:39.
    ——————————————
    E. F. Haghish, IMBI, University of Freiburg
    [email protected]
    http://www.haghish.com/

  • #2
    Having a small problem, with the embedded code block in the last sentence, it cuts off the word "syntax" and adds a bunch of end of line characters.

    (note also the original example above has the command "local macro a=1" which I think is not correct syntax and does not work)

    ============== html output of above example

    . local a = 1
    . scalar b = 2
    . matrix define A = (20,30\40,50)

    This is heading 1

    The values of a matrix can be displayed within the text. For example, you can write 20 which shows the scalar of the first row and first column of the matrix in your documentation. This feature makes writing dynamic text much more convenient compared to the previous procedure.

    This is heading 2

    REMEMBER, that this procedure only works if you execute a do-file with markdoc, that is, using the markdoc filename.do, export(format) _n"> "' n `"> "' n


    ==============end html
    Actual html file output available here


    ( uninstalled all earlier markdoc/statax/weaver versions and installed using github.ado as instructed. using markdoc 3.9.3)
    Stata/MP 14.2 for Mac (64-bit Intel)
    Revision 16 Nov 2016
    Last edited by Tim Hofer; 03 Dec 2016, 22:03.

    Comment


    • #3
      thanks for this. yes, the local macro was a typo. could you reinstall MarkDoc and check if the error remains? I have updated the package to 3.9.4 but I failed to reproduce your error. I hope the new update solves it though.

      ——————————————
      E. F. Haghish, IMBI, University of Freiburg
      [email protected]
      http://www.haghish.com/

      Comment

      Working...
      X