Announcement

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

  • Using "texdoc" for dynamic documentation

    Hello,

    I am new at using Ben Jann's "texdoc" to generate dynamic documents with LaTeX commands embedded in the Stata dofile.

    I tried to execute texdoc do a do file part of which is here below. But it generates a particular log file which contains only the LaTeX command "{\smallskip}" inserted just below the first LaTeX block. The log file containing only {\smallskip} indeed doesn't allow TeXStudio to compile LaTeX codes to create the corresponding pdf document.

    What could be the error I am making?

    See part of the do-file below:


    set more off
    texdoc init AtesoZXZ4presentation.tex, replace
    /*** %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Beamer Presentation
    % LaTeX Template
    % Version 1.0 (10/11/12)
    %
    % This template has been downloaded from:
    % http://www.LaTeXTemplates.com
    %
    % License:
    % CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
    %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%
    %CREATE HANDOUTS

    %Now let’s briefly look at creating handouts for our presentation. To do this we add the keyword ‘handout’ into square brackets in the document class command. We then use the ‘pgfpages’ package to help us print multiple slides on a page. After loading the package we use the \pgfpagesuselayout command. In the curly brackets we specify how many frames we want on a sheet. In the square brackets we specify the paper size and how much border shrink we want:


    \documentclass[handout]{beamer}
    \usepackage{pgfpages}
    \usepackage{stata}

    %\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm] %Potrait page orientation
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%

    %If we wanted to put four frames on a sheet we could simply change the 2 to a 4 and then add the ‘landscape’ keyword into the square brackets.

    \pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm,landscape] %Landscape Orientation

    %----------------------------------------------------------------------------------------
    % PACKAGES AND THEMES
    %----------------------------------------------------------------------------------------
    %\documentclass[t]{beamer}
    \newcommand\Fontvi{\fontsize{10}{7.2}\selectfont} %Creates command Fontvi with font 11
    %\documentclass{beamer}
    ***/

    texdoc stlog, cmdstrip
    use AtesoZ4presentation.dta,clear
    texdoc stlog close

    /***
    \usepackage{amsmath,amsfonts,amssymb}
    \usepackage{booktabs, graphicx}
    \usepackage{lipsum}

    ...

    Thanks,

    Kizito

  • #2
    There are a couple of obvious mistakes. I am using Stata 14.2 for Windows.

    First, you should have mentioned, were you able to use texdoc at all? For instance, can you create Figure 1 from the texdoc article in SJ 16-2? It does not make sense to try an undocumented (in the SJ article) feature such as a Beamer presentation until you have tried one or two basic documented features. Second, use the forum [CODE] tag to show code. Third, use a reproducible example. We do not have access to your dataset and "..." does not help.

    I have only about 30 minutes of experience using texdoc but I was able to create a 1-page Beamer handout with two frames. I have no idea if that is what you want. But the code gives an idea of how one can use texdoc with Beamer, which I think is the main issue you raise. This is my file example1.texdoc:

    Code:
    texdoc init AtesoZXZ4presentation.tex, replace
    
    /*** 
    \documentclass[handout]{beamer}
    \usepackage{pgfpages}
    \usepackage{stata}
    \pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm,landscape] %Landscape Orientation
    \newcommand\Fontvi{\fontsize{10}{7.2}\selectfont} %Creates command Fontvi with font 11
    \begin{document}
    
    \begin{frame}
    \frametitle{Exercise 1}
    Open the auto dataset and summarize the variables.
    ***/
    texdoc stlog
    sysuse auto.dta,clear
    su
    texdoc stlog close
    
    /***
    \end{frame}
    \begin{frame}
    \frametitle{Exercise 2}
    Run a regression.
    ***/
    texdoc stlog
    regress price mpg weight
    texdoc stlog close
    
    /***
    \end{frame}
    \end{document}
    ***/
    This is my code for calling the file:
    Code:
    texdoc do example1.texdoc
    The output is a 1-page PDF file with the expected output. Frame 1 in the upper left quadrant shows the output for Exercise 1. Frame 2 in the upper right quadrant shows the output for Exercise 2. Frames 3 and 4 in the bottom half of the page are empty, as expected.

    Comment

    Working...
    X