SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Contacts SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 1 Auxiliary Chapter

CAPTURE LATEX

Name:
    CAPTURE LATEX
Type:
    Support Command
Purpose:
    The CAPTURE LATEX command redirects Dataplot alphanumeric output from the screen to the specified file and formats it using Latex syntax. The END OF CAPTURE command reverts alphanumeric output back to the screen.
Description:
    Latex is a popular text processing system. Although developed originally on Unix platforms, versions of Latex are available for Windows platforms as well.

    The CAPTURE LATEX command is useful for generating Dataplot output in a format suitable for inclusion into publications and reports.

    Note that the output for most commands is simply enclosed in a {\verbatim} ... {\verbatim} block (that is, an "asis" format). However, the following commands generate the output using Latex syntax (primarily using the Latex tables capability):

      TABULATE
      CROSS TABULATE
      SUMMARY
      YATES

      CONSENSUS MEAN (and CONSENSUS MEAN PLOT)
      LINEAR CALIBRATION, QUADRATIC CALIBRATION

      WILK-SHAPIRO GOODNESS OF FIT
      ANDERSON-DARLING GOODNESS OF FIT
      KOLMOGOROV-SMIRNOV GOODNESS OF FIT
      CHI-SQUARE GOODNESS OF FIT
      GUMBEL MAXIMUM LIKELIHOOD
      EXPONENTIAL MAXIMUM LIKELIHOOD
      WEIBULL MAXIMUM LIKELIHOOD
      PARETO MAXIMUM LIKELIHOOD
      LOGISTIC MAXIMUM LIKELIHOOD
      UNIFORM MAXIMUM LIKELIHOOD
      BETA MAXIMUM LIKELIHOOD

      CONFIDENCE LIMITS
      DIFFERENCE OF MEANS CONFIDENCE LIMITS
      BIWEIGHT LOCATION CONFIDENCE LIMITS
      TRIMMED MEAN CONFIDENCE LIMITS
      MEDIAN/QUANTILE CONFIDENCE LIMITS
      FRIEDMAN TEST

    In addition, WRITE LATEX can be used to generate 1-way tables in Latex format. This is described in more detail in a Note below.

    The above list corresponds to the 10/2003 version of Dataplot. The ultimate goal is to have most of the commands in the Analysis category generate Latex formatted output. It is expected that Dataplot releases after 10/2003 will contain additional commands that can generate Latex specific output.

    Dataplot generates a latex file. The Latex file is then typically processed by the "latex" command to create a Device Independent (DVI) file. The DVI file is then processed by a command that converts the DVI output to a device specific format. The following block of code uses the system command to process the Latex output to a Postscript format and then view it with Ghostview from within Dataplot (the names of the Latex/Ghostview commands may be different on your system).

      SKIP 25
      READ RIPKEN.DAT Y X1 X2
      CAPTURE LATEX table.tex
      TABULATE MEAN Y X1
      CROSS TABULATE MEAN Y X1 X2
      END OF CAPTURE
      .
      . Following code invokes Latex/Ghostview commands. It is
      . assumed that these programs are available on your system.
      . You may need to check how these commands are invoked on
      . your local system.
      .
      system latex table.tex
      system dvips table.dvi > table.ps
      system ghostview table.ps

    In addition, if DEVICE 2 is set to Postscript, Dataplot will incorporate the graphics output into the Latex file. Dataplot defines the commands LGRAPHIC and PGRAPHIC for importing Postscript commands into the Latex file in landscape and portrait mode, respectively.

Syntax:
    CAPTURE LATEX <file name>
    where <file name> is the name of a file where alphanumeric output is written.

    If the file name does not contain a period, place a period (no spaces) at the end of the file name.

Examples:
    CAPTURE LATEX FITOUT.TEX
    ... DATAPLOT COMMANDS ....
    END OF CAPTURE
Note:
    DATAPLOT has the following restrictions on the file name:

    1. The file name should be a valid file name on the local operating system.

    2. It must contain a period "." in the file name itself or as a trailing character. DATAPLOT strips off trailing periods on those systems where it is appropriate to do so. On systems where trailing periods can be a valid file name (e.g., Unix), DATAPLOT opens the file with the trailing period.

    3. On systems where file names are case sensitive (i.e., Unix), the case is preserved as entered on the CAPTURE command.

    4. The file name cannot contain more than 80 characters.

    5. If the file name contains a space, then use the SET FILE NAME QUOTE command and enclose the file name in quotes. For example,
        SET FILE NAME QUOTE ON
        CAPTURE "junk temp.out"
Note:
    The capture command can be toggled on and off (END OF CAPTURE redirects alphanumeric output to the screen). However, a new file name should be used each time since invoking a new CAPTURE command overwrites any existing file (END OF CAPTURE automatically closes the file).
Note:
    Dataplot provides the following switches for controlling what output Datplot generates:

      FEEDBACK <ON/OFF>
      PRINT <ON/OFF>

    The PRINT command controls most of the output generated by the Analysis category commands. Output from most other commands is controlled by the FEEDBACK command. The purpose of this distinction is to allow you to generate the output from commands such as FIT while suppressing most of the other output.

    When generating LATEX format output, a common choice is

      PRINT ON
      FEEDBACK OFF
Note:
    You can create one-way tables using the command

      WRITE LATEX <var-list>

    where <var-list> is a list of variables to print in an HTML table format. Note that this command is typically entered after a CAPTURE LATEX command.

    The following commands can be used to control the appearance of the Latex table:

      SET TABLE TITLE <text> - allows you to specify a title for the generated table
      SET TABLE BORDER <ON/OFF/RULE/COLS> - specify what type of border the table will have

    The SET WRITE DECIMALS command can be used to specify how many digits after the decimal point will be printed (this will apply to all of the columns, currently there is no way to specify a different value for different columns).

    By default, the column headers will simply be the variable names. However, if you have entered a VARIABLE LABEL command for a given variable, the label specified for that variable will be used instead of the variable name.

Note:
    By default, Dataplot generates the folllowing code at the beginning of the Latex file:
    \documentclass[12pt]{article}
     
    \usepackage{epsfig}
     
    \setlength{\textwidth}{6.25in}
    \setlength{\textheight}{9in}
    \setlength{\oddsidemargin}{0.25in}
    \setlength{\evensidemargin}{0in}
    \setlength{\headheight}{0.5in}
    \setlength{\headsep}{0.5in}
    \setlength{\topmargin}{-1in}
    \setlength{\parindent}{0in}
    \setlength{\parskip}{10pt}
    \setlength{\textfloatsep}{4ex}
    \addtolength{\footskip}{0.25in}
    \overfullrule=0pt
    \baselineskip=12pt
     
    \newcommand{\PGRAPHIC}[1]{\begin{figure}[h]
                           \epsfig{file=#1,width=6.0in}
                           \end{figure}}
    \newcommand{\LGRAPHIC}[1]{\begin{figure}[h]
                           \epsfig{file=#1,angle=-90,width=6.0in}
                           \end{figure}}
     
    \begin{document}
     
    \begin{verbatim}
        
    and the following Latex code at the end of the file:
    \end{verbatim}
    \end{document}
        
    You can specify files containing what Latex code goes at the beginning and end of the Latex file with the commands

      SET LATEX HEADER FILE <file-name>
      SET LATEX FOOTER FILE <file-name>

    If you are going to incorporate Postscript graphics, be sure to include a PGRAPHIC and LGRAPHIC (for portrait and landscape orientation graphs, respectively). You can edit the defintions given above, but you should have some definition for these since Dataplot uses PGRAPHIC and LGRAPHIC to insert the Postscript graphs.

    In particular, if you are going to insert the Dataplot generated Latex into a larger file, you might want to specify files that contain no active Latex code.

Note:
    Dataplot is not a word processor. The Latex code generated is fairly basic. That is, Dataplot creates the basic table or list structure for the output. However, it does not give you control over font sizes, colors, and so on.

    If you want to modify the appearance of the Latex output, edit the generated Latex output using the ASCII editor of your choice. We have written the Latex in a style which we believe is relatively easy to read and edit.

Default:
    None
Synonyms:
    None
Related Commands:
    CAPTURE = Redirect alphanumeric output to a file.
    CAPTURE HTML = Redirect alphanumeric output to a file in HTML format.
    END OF CAPTURE = Revert alphanumeric output back to the screen.
    LIST = Lists the contents of a file.
    CALL = Execute commands stored in a file.
    CREATE = Echo entered commands to a file.
    POSTSCRIPT CONVERT = Automatically generate JPEG, PDF, TIFF, PBM, PGM, PPM, or PNM from postscript output.
    LATEX HEADER FILE = Specify a file to use for the header of the Latex output.
    LATEX FOOTER FILE = Specify a file to use for the footer of the Latex output.
Applications:
    Web Output
Implementation Date:
    10/2003
Program:
    skip 25
    read gear.dat y x
    .
    line blank solid
    character x blank
    feedback off
    .
    capture latex tabulate.htm
    .
    summary y
    tabulate mean y x
    tabulate sd y x
    .
    set ipl1na meanplot.eps
    device 2 postscript encapsulated
    orientation landscape wordperfect
    title mean plot
    y1label diameter
    x1label batch
    mean plot y x
    device 2 close
    end of capture

Date created: 11/14/2003
Last updated: 11/14/2003
Please email comments on this WWW page to alan.heckert@nist.gov.