*! version 1.0.3 22jan2018

dynpandoc -- Convert file with dynamic tags in one markup format to another using pandoc

Syntax

dynpandoc srcfile,
saving(filename:targetfile)
[options]

srcfile is the file to be converted.

* saving(filename:targetfile) specify the target file to
be saved

replace replace the target file if it already exists

nomsg suppress message of a link to targetfile

nostop do not stop when an error occurs

from(markup_format) specify the markup format of srcfile

to(markup_format) specify the markup format of targetfile

path(path) specify the directory where the pandoc executable is located

pargs(extra_args) specify the extra arguments for pandoc

* saving(targetfile) is required.

Description

dynpandoc converts a file in one markup format containing Stata dynamic
tags (see [P] dynamic tags) to a file in another markup
format with dynamic tags replaced with Stata results, outputs, and graphs.

Options

saving(filename:targetfile) specifies the target file to be saved.
saving() is required.

replace specifies that the target file be replaced if it already exists.

nomsg suppresses the message that contains a link to the target file.

nostop allows the document to continue being processed even if an error
occurs.

from(markup_format) specifies the markup format of the srcfile.

to(markup_format) specifies the markup format of the targetfile.

path(path) specifies the directory where the pandoc executable is located.

pargs(extra_args) specifies the extra arguments for pandoc.

Remarks

dynpandoc converts file in one markup format to another using pandoc.
pandoc must be installed before use dynpandoc. You can install
pandoc follow the instructions.

dynpandoc uses dyntext to process dynamic tags, see [P] dynamic tags
for details.

Options from and to specify the format of srcfile and
targetfile. For examples, the combination may be
from markdown to HTML, from markdown to latex, or
from HTML to docx. Note that pandoc uses LaTex to
generate pdf output which requires a LaTex process engine. See
pandoc options
for details of supported formats.

dynpandoc calls stpandoc which calls pandoc using shell command.
On Mac OS X, since the applications launched from Finder do not respect the $PATH
environment variable set by .bash_profile, Stata launched from Finder usually will not
be able to locate pandoc even it is installed in the usual place as
/usr/local/bin/pandoc. You may use the path(path) to specify the location of the
pandoc if it can not be located through shell.

Examples

Convert example.smd to example.html.

. dynpandoc example.smd, saving(example.html)

Convert example.smd to example.docx.

. dynpandoc example.smd, saving(example.docx) to(docx)

Several complete examples with source files can be found at
dynpandoc github page.