28.03.2013 Views

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

212 Chapter 9. Document Management<br />

the following appears on the moni<strong>to</strong>r:<br />

✎<br />

Which files?<br />

☞<br />

Now L<br />

\files=<br />

✍<br />

✌<br />

ATE X waits for the user <strong>to</strong> type in the<br />

names of one or more files (separated by<br />

commas) <strong>to</strong> be processed. This avoids having<br />

<strong>to</strong> modify the main processing file with<br />

an edi<strong>to</strong>r every time.<br />

A similar procedure may be employed when a form letter is <strong>to</strong> be sent<br />

<strong>to</strong> various recipients. One can enter the name <strong>and</strong> address <strong>and</strong> even the<br />

salutation interactively. Complete forms may be processed by LAT EX in this<br />

way, with the entries being made from the keyboard.<br />

Warning: The \typein comm<strong>and</strong> may not be used as the argument of<br />

another L AT E X comm<strong>and</strong>! It may, however, be given in environments such<br />

as minipage.<br />

Exercise 9.2: Change the main file from Exercise 9.1 so that the files exer1.tex,<br />

exer2.tex, <strong>and</strong> exer3.tex may be read in with the \include comm<strong>and</strong>. Arrange<br />

that you can determine interactively which of the files is <strong>to</strong> be processed.<br />

Exercise 9.3: Generate output of the form<br />

Certificate<br />

Olympic Spring Games<br />

Walterville 1992<br />

Finger Wrestling<br />

Gold A. T. Glitter AUR 7999.9 Points<br />

Silver S. Lining ARG 7777.7 Points<br />

Bronze H. D. Tarnish CUP 7250.0 Points<br />

so that the following enquiries appear on the moni<strong>to</strong>r one after the other<br />

Message Comm<strong>and</strong>= Input<br />

Sport: \@typein = Finger Wrestling<br />

Unit: \unit = Points<br />

Gold: \@typein = A. T. Glitter<br />

Country: \@typein = AUR<br />

Value: \@typein = 7999.9<br />

Silver: \@typein = S. Lining<br />

. . . . . . = . . .<br />

<strong>and</strong> the appropriate entries are made interactively. The third column contains<br />

the answers necessary <strong>to</strong> produce the above sample output. Repeat the program<br />

with different entries. Let your imagination run wild.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!