Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65044

MarkDoc (GitHub) bug on Windows: Cannot output tables in Stata Journal style

$
0
0
The user-written program markdoc (GitHub) version 3.9.5 on Windows cannot output tables in Stata Journal style, which is a bug for the option style("stata"). I am using Stata 14.2 on Windows 7 and TeXworks version 0.4.5 r.1280 (MikTeX 2.9 64-bit).

I am a user of markdoc but the program often changes faster than I can report bugs. The biggest problem that I think should be solved first is the lack of a reproducible example in the documentation that addresses the features and limitations of the option style("stata"). I have reported this problem on Statalist since markdoc version 3.8.7 as part of another bug thread. Here is a more formal bug report.

The Stata Journal style is defined by the commands sjlatex and sjlog. The sjlatex command reports on the current release of the package of LaTeX files developed for the Stata Journal and installs/updates this package. The command sjlog is for creating and managing logs for Stata Journal articles. Here is sample code in the file stlog_1.do:

Code:
sysuse auto, clear
sjlog using auto, replace
su price
sjlog close
sjlog type auto.log.tex
Here is the LaTex output in the file auto.log.tex:

Code:
. su price
{\smallskip}
    Variable {\VBAR}        Obs        Mean    Std. Dev.       Min        Max
\HLI{13}{\PLUS}\HLI{57}
       price {\VBAR}         74    6165.257    2949.496       3291      15906
{\smallskip}
I copy and paste it into this relatively simple LaTeX file stlog_1.tex which uses the {stata} LaTeX package:

Code:
\documentclass[11pt]{article}
\usepackage{stata}
\begin{document}
\section{Example 1}
\begin{stlog}
. su price
{\smallskip}
    Variable {\VBAR}        Obs        Mean    Std. Dev.       Min        Max
\HLI{13}{\PLUS}\HLI{57}
       price {\VBAR}         74    6165.257    2949.496       3291      15906
{\smallskip}
\end{stlog}
\end{document}
Note that the {stlog} environment has formatting for the summarize table. In contrast, here is the do-file stlog_2.do for markdoc:

Code:
sysuse auto, clear
su price
This is the markdoc command for calling stlog_2.do:
Code:
markdoc "C:/temp/md/stlog_2.do" , markup(markdown) export(tex) replace statax ///
     style("stata") master toc noisily
The result is this LaTeX file stlog_2.tex:
Code:
\documentclass{article}
\include{Statax}              %included in your working dorectory
\usepackage{epsfig}
\usepackage{hyperref}         %use hyperlink
\usepackage{booktabs}         %for tables
\usepackage{longtable}        %for long tables
\usepackage{fixltx2e}         % for \textsubscript
\usepackage{graphicx}
\usepackage[article,notstatapress]{sj}
\usepackage{stata}
\usepackage{shadow}
\usepackage{natbib}
\usepackage{chapterbib}
\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}\bibpunct{(}{)}{;}{a}{}{,}

\begin{document}
\clearpage
\tableofcontents
\clearpage

\inserttype[st0001]{article}
\author{Short article author list}{    \and}
\title[Short toc article title]{}
\maketitle

\begin{stlog}

      . sysuse auto, clear
      (1978 Automobile Data)

      . su price

          Variable |        Obs        Mean    Std. Dev.       Min        Max
      -------------+---------------------------------------------------------
             price |         74    6165.257    2949.496       3291      15906
\end{stlog}
\bibliographystyle{sj}
\bibliography{sj}
%\begin{aboutauthors}
%% Write some background information about the author(s).
%\end{aboutauthors}

\end{document}
The LaTeX code from markdoc in the {stlog} environment has no formatting. Perhaps that is not a technical requirement; I am not a LaTeX expert. But the PDF output from compiling the LaTex code shows the result. You know when you see the markdoc table in PDF that it is not in the Stata Journal format. The tables look like plain text rather than SMCL. Therefore, this is a bug in style("stata"). I suggest to use the sjlog command to create the Stata output log files. That is how the user-written program texdoc (SJ) handles the problem, and it works well in comparison. For texdoc, see

Code:
net describe pr0062_1, from(http://www.stata-journal.com/software/sj16-3)
The main advantage of markdoc is the simpler language Markdown rather than LaTex but the bugs are annoying.

Viewing all articles
Browse latest Browse all 65044

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>