*! version 1.0 4 May 2020

Title

do2docs -- A quick way of building different documents from your
do file specified by the using modifier.

Syntax

do2docs
using/
[,
options]

Standard options
doctype(string) Specify standard output document type.
Standard types are: beamer1 - slide level 1; beamer2 - slide level 2;
html - with mathjax; pdf; tex or latex; word; ppt or powerpoint

timeout(#) To see possible errors from pandoc specify time i
seconds different than 0. Default value is 0

cleanup Automatically delete temporary (log and markdown) files

datestamp Add datestamp in output document name

bibliography(string) Specify path and name for bibtex library

savein(string) Specify path for output

show Show (if possible) output document

Non-standard output documents
extension(string) Specify a non-standard document type.
See eg pandoc examples for types

pandocstring(string) To style the non-standard output document.
See pandoc user guide

Different pandoc path
pandocpath(string) Specify alternative path to pandoc.
Default is the pandoc default: "C:/Program Files/Pandoc/pandoc.exe"

From log2markup
codestart set your markdown coding for code start, eg
\begin if the document is intended for the Stata Journal.

Works best with html or latex

codeend set your markdown coding for code end, eg
\end if the document is intended for the Stata Journal.

Works best with html or latex

samplestart set your markdown coding for sample start, eg
{\smallskip}\begin if the document is intended for the Stata Journal.

Works best with html or latex

sampleend set your markdown coding for sample end, eg
\begin if the document is intended for the Stata Journal.

Works best with html or latex

Description

A quick way of building different documents from your do file specified by
the using modifier. It uses log2markup and requires that
pandoc is installed.

Examples

One can choose to change directory to where the do-file is placed:

cd "C:\my\path\to\the\do\file"

Otherwise specify full path and name to do-file.

To generate a word output document (named "my do file name.docx") from the do-file
"my do file name.do".

The word file is saved in subfolder Output.

There is a 30 seconds timeout to see possible pandoc errors.

The log and markdown file is deleted at the end.

do2docs using `"my do file name.do"', doctype(word) savein(Output) timeout(30) cleanup

To use a word template use options extension and pandocstring
instead of option doctype with the following arguments (works also for
eg powerpoint presentations):

do2docs using `"my do file name.do"', extension(docx) pandocstring(--reference-doc="folder/my-reference.docx")

The command to create eg a word template template in a dos or
powershell is:

pandoc -o folder/my-reference.docx --print-default-data-file reference.docx

Edit only a limited set of styles.

See pandoc
for more information. Search on --reference-doc=FILE.

Authors and support

Author:

Niels Henrik Bruun,

Aalborg University Hospital

Support:

niels.henrik.bruun@gmail.com