*! version 1.0.3 22jan2018

stpandoc -- Convert file in one markup format to another using pandoc

Syntax

stpandoc 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

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

stpandoc converts file in one markup format to another using pandoc.

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.

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

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

stpandoc 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.

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.

Examples

Convert example.md to example.html.

. stpandoc example.md, saving(example.html)

Convert example.md to example.docx.

. stpandoc example.md, saving(example.docx) to(docx)

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