|
LATEXName:
The motivation for developing a LaTeX graphics driver in Dataplot is to help in producing publication quality graphics with Dataplot. Additional comments on utilizing the typesetting capabilities of LaTeX from within Dataplot are given below. The basic process in using LaTeX is:
Although Tex and LaTeX were written primarily for typesetting text, there are several ways that LaTeX provides for graphics:
Dataplot supports LaTeX output in three ways:
Features of the LaTeX driver are discussed in the Notes section below.
This syntax is used to generate a standalone LaTeX file.
This syntax is used to generate a LaTeX file that can be imported into another LaTeX file (i.e., you can not run the latex command directly on this file).
This syntax is used in conjunction with the CAPTURE LATEX command to incorporate Dataplot alphanumeric and graphics output in a single LaTeX file. The Program 2 example below gives an example of this.
DEVICE 2 LATEX
In particular, this applies to special characters such as subscritps, superscripts, Greek characters, and special mathematical symbols. If your text does not utilize these, you can obtain publication quality text by simply using the Postscript driver. There are two ways to utilize these special symbols.
If you want to provide your own preamble or postamble, you can enter the following command:
SET LATEX FOOTER FILE <file> The header file should contain the following two lines:
\usepackage{graphics,color}
To have LaTeX generate thick lines, enter
To have Dataplot generate thick lines, enter
Currently, Dataplot does not support different dots per inch. If you specify ORIENTATION LANDSCAPE or ORIENTATION LANDSCAPE WORDPERFECT, the graph will be generated with a width of 6.25 inches and a height of 4.8 inches (i.e., a landscape orientation on a portrait page). If you specify ORIENTATION PORTRAIT, the graph will be generated with a width of 6.26 inches and a height of 9 inches. If you specify ORIENTATION SQUARE, the graph will be generated with a width of 6 inches and a height of 6 inches. Dataplot does not currently support a true landscape mode (i.e., a rotated picture with a width of 9 inches and a height of 6.25 inches). You can also specify your own dimensions. For example, to generate a 5 inch by 5 inch plot, enter the commands
DEVICE 2 LATEX STANDALONE DEVICE 2 PICTURE POINTS AWIDTH AWIDTH If you use the default landscape mode, you may want to specify larger character sizes. Dataplot text sizes are specified as a percentage of the height and generating a landscape mode plot may result in the default character sizes being smaller than desired. You may want to include the following size commands:
LEGEND SIZE 3 TITLE SIZE 3 LABEL SIZE 3 TIC MARK LABEL SIZE 3 CHARACTER SIZE 3 ALL The default character size for the above commands is 2. Note that Dataplot cannot specify a specific point size for text to LaTeX. Instead, there are 10 commands (e.g., \normalsize, \footnotesize, \tiny, \large). The actual size LaTeX generates depends on the font and the default point size for the LaTeX file. Dataplot maps the requested character size to one of the 10 LaTeX size commands based on a default point size of 12 and the default LaTeX font. Our testing shows that this results in 5 distinct point sizes generated by LaTeX. If you use a different font, Dataplot's best guess as to the size LaTeX will generate may not be accurate. Since Dataplot uses LaTeX to justify text, this should typically not be a problem. One case where it might be an issue is in the placement of tick mark labels. You can use the TIC MARK LABEL DISPLACEMENT comamnd to adjust their positioning if needed.
DEVICE 2 LATEX STANDALONE
You can combine this with the DEVICE 1 LATEX command to generate a LaTeX file with both the analysis output and the graphics output in the same file. A typical sequence of commands would be
CAPTURE LATEX sample.tex DEVICE 1 LATEX ... analysis and graphics commands ... DEVICE 1 CLOSE END OF CAPTURE Note that the order of the commands matters here. Specifically, the CAPTURE LATEX command should be entered before the DEVICE 1 LATEX command and the DEVICE 1 CLOSE command should be entered before the END OF CAPTURE command. If this sequence is not followed, some of the needed LaTeX commands may not be written to the LaTeX file.
The steps involved are:
This does require that LaTeX (and the epic and eepic packages) be installed on your local platform.
Frank Mittelbach and Michel Goosens with Johannes Braams, David Carlisle, and Chris Rowley (2004), "The LATEX Companion," Second Edition, Addison-Wesley, Helmut Kopka and Patrick Daly (2003), "Guide to LATEX," Fourth Edition, Addison-Wesley,
. Demonstrate following features of Latex driver: . . 1) Color . 2) Text using Latex encodings . 3) Text using Dataplot encodings . 4) Thick lines . set ipl1na latex1.tex set latex color on device 2 latex standalone . skip 25 read berger1.dat y x . quadratic fit y x . title case asis label case asis legend case asis title size 3 legend size 3 label size 3 tic mark label size 3 title offset 2 replacement character ! . Use Latex encodings for title title Y = $\alpha_{0} + \alpha_{1}x + \alpha_{2}x^{2}$ replacement character ^ y1label Measured In-Field Defect Size x1label Measured In-Lab Defect Size . Use Dataplot encodings for legends legend 1 lc()alph()sub()0unsb() = ^a0 legend 2 lc()alph()sub()1unsb() = ^a1 legend 3 lc()alph()sub()2unsb() = ^a2 tic offset units screen tic offset 3 3 . title size 3 tic mark label size 3 label size 3 . char x blank character color red all line blank solid line color blue all line thickness 0.2 . plot y pred vs x . device 2 close system latex latex1.tex; . Run LaTeX . system dvips latex1 system dvipdfmx latex1; . Create PDF from the LaTeX Program 2: . Example of creating Dataplot output in a single . Latex file (i.e., both graphics and alphanumeric output . . Step 1: Read Data . skip 25 read stutz86.dat y1 to y5 x . . Step 2: Generate the Consensus Means Output . feedback off capture latex consensus.tex tabulate mean y1 x tabulate sd y1 x consensus mean y1 x . . Step 3: Generate Some Complementary Graphics . device 1 latex . multiplot corner coordinates 2 2 98 98 multiplot 2 2 multiplot scale factor 2 . title offset 2 title size 3 label size 3 tic mark label size 3 title automatic tic offset units screen tic offset 3 3 line blank solid char x blank . mean plot y1 x sd plot y1 x . character box plot lines box plot fences on box plot y1 x . end of multiplot . device 1 close end of capture . system latex consensus.tex; . Run LaTeX system dvipdfmx consensus; . Create PDF file from the LaTeX .View the output in PDF format
Date created: 02/27/2006 |
Last updated: 11/13/2023 Please email comments on this WWW page to alan.heckert@nist.gov. |