SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 1 Vol 2

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.

    As of the 2013/12 version of Dataplot, most of the Analysis commands support LaTeX formatted output. The following are the Analysis commands that do not yet support LaTeX formatted output (the output for these commands is simply enclosed in a {\verbatim} ... {\verbatim} block (that is, an "asis" format).

      ARMA
      DDS
      ORTHOGONAL DISTANCE FIT
      PRE-FIT
      RECIPE
      SEASONAL LOWESS
      SIMCOV
      SMOOTH

    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.

    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.

Note:
    The August 2014 version of Dataplot added the command

      SET LATEX RESIZE <ON/OFF>

    If this switch is set to ON, Dataplot will add the line

      \resizebox{\linewidth{{!} {

    to the beginning of LaTex tables. This is useful for tables with a large number of columns. This LaTex command automatically resizes the text size if needed when there are a large number of columns.

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:
    2003/10
    2014/08 Added SET LATEX RESIZE command
    Support for LaTex formatted output added for various Analysis commands over the years
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

Privacy Policy/Security Notice
Disclaimer | FOIA

NIST is an agency of the U.S. Commerce Department.

Date created: 11/14/2003
Last updated: 12/15/2013

Please email comments on this WWW page to alan.heckert@nist.gov.