A Guide to use Macros and Style Files in L^{A}TEX

(English Version 2.15e : August 7, 1994)

IWAKUMA, Tetsuo^{1} FURUKAWA, Tetsuo^{2}

Contents

1 Introduction 1

2 Why Optional Style Files? 1 2.1 Document size settings and personal macros . . . . . . . . . . . . . . . . . . . 1 2.2 Change of environments and macros . . . . . . . . . . . . . . . . . . . . . . . 1 2.3 Something is wrong with the mark ‘@’ . . . . . . . . . . . . . . . . . . . . . . 2

3 Modification of Page Style 2

3.1 Size of text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 3.1.1 Set the number of lines per page . . . . . . . . . . . . . . . . . . . . . 3 3.1.2 Set the number of characters per line . . . . . . . . . . . . . . . . . . . 3

3.2 Make landscape page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.3 Set header and footer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.4 Display the last page number . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.5 Set the default font size be 8pt . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.6 Put line numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.7 Need ragged-right documents . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.8 Show labels in draft manuscript . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.9 I don’t like formatted documents . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.10 Making similar letters to different addresses (mail-merge) . . . . . . . . . . . . 7 3.11 Make a manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.12 Other style files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4 Title Page 7 4.1 empty won’t kill page number at title page . . . . . . . . . . . . . . . . . . . . 7 4.2 Make titles simpler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4.3 One-column abstract in two-column documents . . . . . . . . . . . . . . . . . 8 4.4 One-column footnote by \thanks in two-column document . . . . . . . . . . . 8 4.5 Change of title layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

5 Table of Contents 9 5.1 Change depth of table of contents . . . . . . . . . . . . . . . . . . . . . . . . . 9 5.2 Always need compilation three times? . . . . . . . . . . . . . . . . . . . . . . . 9 5.3 Reference page in the table of contents . . . . . . . . . . . . . . . . . . . . . . 9 5.4 Table of contents in each chapter of book-style document . . . . . . . . . . . . 9

6 Sections 10 6.1 Cannot use a command in section title . . . . . . . . . . . . . . . . . . . . . . 10 6.2 Centering of section titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 6.3 Adjust spacings above and below section titles . . . . . . . . . . . . . . . . . . 10 6.4 Relax pagination system in ‘book.sty’ . . . . . . . . . . . . . . . . . . . . . . 11 6.5 Why no section number at subsubsection in book? . . . . . . . . . . . . . . 11

7 Main Body of Text 11

7.1 Change expression of paragraphs . . . . . . . . . . . . . . . . . . . . . . . . . 11 7.1.1 Emphasize the beginning of paragraphs . . . . . . . . . . . . . . . . . 11 7.1.2 Set indentation or margins of paragraphs . . . . . . . . . . . . . . . . . 12 7.1.3 Make the shape of paragraph meaningful . . . . . . . . . . . . . . . . . 12 7.1.4 Numbering of paragraphs . . . . . . . . . . . . . . . . . . . . . . . . . 12

7.2 Underlining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 7.2.1 Emphasis with underlines . . . . . . . . . . . . . . . . . . . . . . . . . 12 7.2.2 Wavy underlines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 7.2.3 Double underlines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

1 bear@hashi1.civil.tohoku.ac.jp: responsible for English translation.

2 furukawa@hagi.ces.kyutech.ac.jp

7.3 Multi-column documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 7.3.1 Need one-column and double-column mixed, or three-column documents 13 7.3.2 Balance the last page in two-column documents . . . . . . . . . . . . . 13 7.3.3 Side-by-side translation . . . . . . . . . . . . . . . . . . . . . . . . . . 14

7.4 Ruby not diamond . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 7.5 Italic correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 7.6 German, French and Russian . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

7.6.1 Umlaut in German . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 7.6.2 French documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 7.6.3 Russian documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

7.7 On verbatim environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 7.7.1 \verb cannot span to multiple lines . . . . . . . . . . . . . . . . . . . . 14 7.7.2 Make commands active even in verbatim environment . . . . . . . . . 14

7.8 Draft and final, or neglecting many lines . . . . . . . . . . . . . . . . . . . . . 15 7.9 On footnotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

7.9.1 Put footnotes and floats at the end of documents . . . . . . . . . . . . 15 7.9.2 Short footnotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 7.9.3 Indentation for long footnotes . . . . . . . . . . . . . . . . . . . . . . . 15 7.9.4 What happened to footnotes in tabular environment? . . . . . . . . . 15 7.9.5 Place all the footnotes in the right column . . . . . . . . . . . . . . . . 15

7.10 On hyphenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 7.11 Temporary change of line pitch . . . . . . . . . . . . . . . . . . . . . . . . . . 16 7.12 Program listings from separate files . . . . . . . . . . . . . . . . . . . . . . . . 16 7.13 Algorithm of program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 7.14 Emphasis by thick rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 7.15 Other environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

8 Mathematics 17

8.1 Equation numbering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 8.1.1 Sub numbering of equations . . . . . . . . . . . . . . . . . . . . . . . . 17 8.1.2 Set section number into equation numbers . . . . . . . . . . . . . . . . 18 8.1.3 One equation number for a set of equations . . . . . . . . . . . . . . . 18

8.2 Leaders in flush-lefted equations . . . . . . . . . . . . . . . . . . . . . . . . . . 18 8.3 Spaces at ‘&’ are too wide in eqnarray environment . . . . . . . . . . . . . . . 18 8.4 On matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

8.4.1 Space between rows is small . . . . . . . . . . . . . . . . . . . . . . . . 19 8.4.2 Alignment of quadratic forms . . . . . . . . . . . . . . . . . . . . . . . 19 8.4.3 Simplification of matrices . . . . . . . . . . . . . . . . . . . . . . . . . 21

8.5 Over and under braces to separate terms in equation . . . . . . . . . . . . . . 21 8.6 Height of parentheses and spaces in math mode . . . . . . . . . . . . . . . . . 21 8.7 Math commands of plain TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

8.7.1 Alignment of square root symbols . . . . . . . . . . . . . . . . . . . . . 21 8.7.2 Pile up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 8.7.3 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 8.7.4 Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

8.8 Floating point calculation in the text . . . . . . . . . . . . . . . . . . . . . . . 22 8.9 Chemical formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 8.10 Want to use variable-length arrows . . . . . . . . . . . . . . . . . . . . . . . . 22 8.11 Double bracket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 8.12 Use symbols of AMS-TEX in L^{A}TEX documents . . . . . . . . . . . . . . . . . 23 8.13 Integral symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

8.13.1 Big and standing integral symbols . . . . . . . . . . . . . . . . . . . . . 23 8.13.2 A symbol ‘BELOW’ multiple integral symbols . . . . . . . . . . . . . . 23 8.13.3 Closed surface integral . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

8.14 Blackboard style symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 8.15 Draw commutative diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 8.16 Flow of proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 8.17 Change style of newtheorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 9 Modification of list Environment 24

9.1 Modification of itemize environments . . . . . . . . . . . . . . . . . . . . . . . 24 9.1.1 Change of labels in enumerate environment . . . . . . . . . . . . . . . 24 9.1.2 Change labels in itemize environment . . . . . . . . . . . . . . . . . . 24 9.1.3 Add a symbol to labels of enumerate environment . . . . . . . . . . . 24

9.2 Adjust vertical spacings near and in the list environment . . . . . . . . . . . 25 9.3 Align indentation of description environment . . . . . . . . . . . . . . . . . 25 9.4 Write dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 9.5 Making Q & A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

10 How about Figures, Tables and Photos? 26

10.1 On captions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 10.1.1 Change caption headers . . . . . . . . . . . . . . . . . . . . . . . . . . 26 10.1.2 Indentation of long caption . . . . . . . . . . . . . . . . . . . . . . . . 27 10.1.3 Fragile commands cannot be used in captions . . . . . . . . . . . . . . 27 10.1.4 Need line break within captions . . . . . . . . . . . . . . . . . . . . . . 27

10.2 Want to place floats at specified place . . . . . . . . . . . . . . . . . . . . . . 28 10.3 Put two figures side by side . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 10.4 Paragraph wrapping figure and table . . . . . . . . . . . . . . . . . . . . . . . 28 10.5 Tables longer than one page . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 10.6 Drawings within the limit of picture environment . . . . . . . . . . . . . . . 29

10.6.1 Simple flow chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 10.6.2 Flow charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 10.6.3 Draw tree diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 10.6.4 Draw bar-graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

10.7 Change attribute of rules of tables . . . . . . . . . . . . . . . . . . . . . . . . 31 10.8 Widen vertical spaces in tables . . . . . . . . . . . . . . . . . . . . . . . . . . 31 10.9 Align decimal points in tables . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 10.10 Tables with their total width specified . . . . . . . . . . . . . . . . . . . . . . 32 10.11 Improvement of array and tabular environments . . . . . . . . . . . . . . . . 32 10.12 Diagonal line at the left-top corner of tables . . . . . . . . . . . . . . . . . . . 32 10.13 Subnumbering for floats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 10.14 Photo environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 10.15 Input figures and pictures directly . . . . . . . . . . . . . . . . . . . . . . . . . 33

10.15.1 Within limit of L^{A}TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 10.15.2 Driver-dependent methods . . . . . . . . . . . . . . . . . . . . . . . . . 34

10.16 Too many unprocessed floats . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

11 TEX in the Box 36 11.1 Put a paragraph into a box . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 11.2 A box surrounding a minipage environment . . . . . . . . . . . . . . . . . . . 36 11.3 Strings in oval box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 11.4 A box with title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 11.5 Floats (Figs and Tables) in a box . . . . . . . . . . . . . . . . . . . . . . . . . 36 11.6 A box with shadow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 11.7 Shading strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 11.8 Framed paragraphs that spans several pages . . . . . . . . . . . . . . . . . . . 37 11.9 Framing a page or list environment . . . . . . . . . . . . . . . . . . . . . . . . 37

12 Bibliography and Index 37 12.1 Referring bibliography by ^{1),2)} . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 12.2 Modification of bibliography list . . . . . . . . . . . . . . . . . . . . . . . . . . 38 12.3 Sorting cite labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 12.4 Bibliography listings for each chapter . . . . . . . . . . . . . . . . . . . . . . . 38 12.5 Chicago style bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 12.6 Index for each section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 13 Other Useful Macros 39

13.1 Date and week . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 13.2 Time of compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 13.3 Put key words in the footnote . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 13.4 Ordinal numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 13.5 Put a comma every thousands . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 13.6 Want to write music . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 13.7 Two pages side by side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 13.8 Transparencies for OHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 13.9 Make a poster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 13.10 Need to select pages to be output . . . . . . . . . . . . . . . . . . . . . . . . . 41

14 Fonts 41 14.1 Available fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 14.2 Want to use fonts not loaded . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 14.3 New character without Metafont . . . . . . . . . . . . . . . . . . . . . . . . . 43 14.4 Use of non-standard fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

14.4.1 Manual fonts of TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 14.4.2 Calligraphic characters . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 14.4.3 Old-german fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

14.5 Symbol tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 14.6 Creating undefined symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

14.6.1 Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 14.6.2 Encircled numerals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 14.6.3 ˚ C and = Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 14.6.4 Smiley . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

14.7 Logo symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

15 Other Things on TEX Programming 45 15.1 Interactive input through keyboard . . . . . . . . . . . . . . . . . . . . . . . . 45 15.2 Macros with option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 15.3 Choice by if . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 15.4 Modification of \@tfor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

16 Epilogue 46 16.1 Where are style files? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 16.2 Samples to use style files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 16.3 Finally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

REFERENCES 47

WARNING

Any parts of contents including macros and examples PRINTED on papers can be freely distributed and used. Source files and data files can also be distributed and used freely provided all the original files are present and are not modified so that no error occurs except the error due to installation of the site. Macros which are not displayed in .dvi file cannot be used without showing their references.

In Japan, a serial publication of the similar contents by the same authors exists on a magazine. However since the editor of the magazine added his own information in this serial article, it is not allowed that the information appeared in the magazine but not in this document is copied into this package.

Introduction

This document was first released as an article on bbs of Tohoku University by the second author, titled “L^{A}TEX style files: Q & A” written in Japanese. The first author transferred it into a L^{A}TEX document which can become a kind of manuals and indexes to show examples and samples of those style files. This one is an English-translation version, but becomes much concise because the first author is not good at English and also because of time shortage. Many parts in the Japanese version have been discarded.

Since a new version of L^{A}TEX, L^{A}TEX2_{ε}, has been released, this kind of documents may not be necessary any more. But still many FAQ’s for the old L^{A}TEX, L^{A}TEX209, are repeated on a Network News, for example comp.text.tex, and the new L^{A}TEX needs style files to attain some kinds of features.

We here enumerate useful style files on L^{A}TEX209 and show examples. Most style files can be retrieved through many ftp servers, especially from CTAN. If you get a footnote saying “foo.sty’ is not installed here.’, you must obtain ‘foo.sty’ to show a sample. Choice of style files has been done by the first author, so still many other useful style files exist in the world.

Some of style files introduced here were named by the first author not by their original creators, because they were posted on the network news systems and the creators did not give names. These files can be obtained from an ftp server in Japan, ftp.tohoku.ac.jp (130.34.8.9)

     pub/TeX/latex-styles/bear_collections/style-files/

Compilation has been checked by Big emTEX on a personal computer under MS-DOS and TEX on UNIX^{3}.

Why Optional Style Files?

2.1 Document size settings and personal macros

When you want to use your own macros and to change the page size, you put definitions and settings in the preamble. Among these macros and settings some may be almost always necessary for you to write documents, but it is cumbersome to put these definitions in the preamble every time you create a document file. In such cases, once you put all the necessary macros and settings in an optional style file, say ‘mydoc.sty’, you can use it in any documents by

     \documentstyle[11pt,mydoc]{article}
     \begin{document}
     ...

where the default font size is set 11pt of article.sty and ‘mydoc.sty’ is read before processing so that you can use macros defined in ‘mydoc.sty’ within the document.

2.2 Change of environments and macros

Sometimes you may want to change spacings above and below the itemize environment for your own special purposes. In such cases you must change the default definitions of the macros and environments possibly given in the file ‘latex.tex’. However you should NOT modify the macros in the files directly. You must first copy the necessary portion in the definition files into your own style file, say ‘mydoc.sty’, and then you can edit it. Most basic definitions are given in ‘latex.tex’, but several ones depending on the size or style of the document may be given in ‘article.sty’, ‘art12.sty’ or ‘book.sty’ etc.

There are many style files which attain functions not available within the original L^{A}TEX. For example a style file called ‘wrapfig.sty’ assists you to make a paragraph wrap around a figure smaller than the text width. In order to use it, you simply begin a document file with

3 UNIX is a licensed OS by AT & T and MS-DOS is a trademark of Microsoft Corporation.

\documentstyle[12pt,wrapfig,mydoc]{jarticle}
\begin{document}
...

You may insert as many style files as you like here.

2.3 Something is wrong with the mark ‘@’

When you look into definitions in ‘latex.tex’, you may notice many macro names include a symbol @. This ‘at’ symbol is a special mark within the L^{A}TEX document so that one cannot use it within the ordinary documents. It is probably used to avoid conflict of system macros with user-defined macro names. As long as the macros witch include this symbol are read as optional style files, you may not worry about any warnings and errors relating to this mark.

However when you want to change a short macro temporarily in one document, it is not a good idea to put such a macro into your own style file. In such a case, one can do the followings:

\documentstyle[11pt]{j-article}
\makeatletter                       % from here
\def\thisisapen{\@ifnextchar.......
 ..........
\makeatother                        % through here
\begin{document}
.....

where the portion between \makeatletter and \makeatother handles the symbol @ as an ordinary

letter. Or \catcode`\@=11 (=\makeatletter) and \catcode`\@=12 (=\makeatother) have the same

functions.

On the other hand, if \makeatother is used in the optional style files, you may get a lot of errors in compilation. For example, an optional style file ‘wrong.sty’ includes such a command,

\documentstyle[11pt,wrong,right,mydoc]{j-article}

will read ‘right.sty’ and ‘mydoc.sty’ after ‘wrong.sty’ has been executed. But since this command already makes the symbol @ special, all the lines within the last two files cause errors in compilation.

Modification of Page Style

3.1 Size of text

There are a few style files to set size of the text body. For example, A4 size used in Europe and Japan can be set by using ‘a4.sty’ (Yes, we have it.) or ‘a4wide.sty’^{4} .

But the simplest way is to define the sizes manually as

\setlength{\topmargin}{-6mm}        % dviware dependent
\setlength{\textheight}{30cm}       % B4 size
\setlength{\textwidth}{20cm}
\setlength{\oddsidemargin}{5mm}     % dviware dependent
\setlength{\evensidemargin}{5mm}    % dviware dependent

This document uses the following settings to save spaces. One line may be too long.

\setlength{\topmargin}{-11mm}
\setlength{\headsep}{20pt}
\setlength{\textheight}{24cm}        % A4 size
\setlength{\textwidth}{16cm}
\setlength{\oddsidemargin}{1.5mm}
\setlength{\evensidemargin}{1.5mm}

If the dvi-driver can handle landscape printings, a command defined in ‘mydoc.sty’ as

4 ‘a4wide.sty’ is not installed here.

Page number is 3.  Today is August 8, 1994

     \def\landscape{%
       \@tempdima=\textwidth \textwidth=\textheight \textheight=\@tempdima}

will exchange the height and width of the document, although slight change of margins may be necessary.

3.1.1 Set the number of lines per page

Since it is not a feature of TEX, it is almost impossible because glue will be inserted in proper positions. However as an average or an approximation, one can use the next command to set the number of lines.

     \def\linesparpage#1{
         \baselineskip=\textheight
         \divide\baselineskip by #1} % lineheight = textheight / line#

If one uses \linesparpage{20} in the preamble, it will re-set \baselineskip so that the number of lines per page becomes approximately 20. However this command cannot be used before \maketitle, because

\maketitle modifies \baselinskip.

Moreover \baselineskip is frequently changed in many commands and environments, so that it is not usually appropriate to change it. The line pitch can be changed by setting \baselinestretch as

     \renewcommand{\baselinestretch}{1.7}

where 1.7 times default line-pitch is used everywhere in the document. Trial and error is necessary to set the number of lines by adjusting \baselinestretch.

Since the method above changes all the spacings in the document, for example, footnotes and captions become ugly. One must set line pitch differently depending on the appearance of each environment. One can use ‘doublespace.sty’ (Yes, we have it.) for that purpose. Usage is written in the style file.

When the textheight must be adjusted by fixing the default line pitches, one can set it in the preamble of the document as

     \textheight=19\baselineskip
     \advance\textheight \topskip

just like settings in ‘art10.sty’[7].

3.1.2 Set the number of characters per line

We do not know how to do it in non-Japanese TEX.

3.2 Make landscape page

It is easy to set all the pages in landscape direction by setting its width and height. But sometimes only one table must be in landscape direction within the documents in portrait direction. In this case, ‘portland.sty’ (Yes, we have it.) can be used. Two commands, \portrait and \landscape switch the direction of the page, but it is necessary to check and set \paperheight appropriately. Default paper size is for A4 size paper. As switchings are recorded in .log file, one can change the settings of the dvi-drivers and printers accordingly. If the dvi-driver cannot handle page-wise output, a style file, ‘selectp.sty’ in Section 13.10 (p. 41) may be helpful.

3.3 Set header and footer

A standard way of doing is to use \pagestyle{myheadings}[5], or a new style of the page can be easily defined[8].

More complicated adjustment and settings of header and footer become easily possible if one uses a style file called ‘fancyheadings.sty’ . Three fields in both the header and footer can be defined separately. Note that \pagestyle must be declared after \textwidth is set. And \headheight must be adjusted as shown in Table 1-a (this table shows the settings when Japanese article style of NTT JTEX is used). As an example, this page is created by the following settings:

Clock shows 15: 15  File name is [styleuse.tex]

\headheight=17pt \thispagestyle{fancyplain}%
\lfoot{{\small Clock shows \the\hour : \the\minute}}%
\rfoot{{\small File name is {\tt [\jobname.tex]}}}%
\cfoot{} \chead{}%
\lhead{{\small\rm Page number is \thepage.}}%
\rhead{{\small Today is {\tt \today}}}%

where a method to display of the time of compilation will be shown in Section 13.2 (p. 39) . The name

                        Table 1 About \fancyheadings

Table 1-a Size of \headheight

size j-article jarticle
10pt 17pt  14pt
11pt 19pt  15pt
12pt 21pt  16pt

Table 1-b Name of Each Field

left  center right

                                           header \lhead  \chead  \rhead
                                           footer \lfoot  \cfoot  \rfoot

of each field is given in Table 1-b, and for example

\lfoot{\it\today}

will set the footer at the left. When twoside style is used, \rhead[EVEN-RHEAD]{ODD-RHEAD} will define these in even and odd pages separately. For example

\rhead[\sl\today]{\rm\thepage}

When the section titles are to be set in the header or footer, one must use the commands as

\documentstyle[fancyheadings]{article}
\renewcommand{\sectionmark}[1]{\markboth{#1}{}}    % \leftmark
\renewcommand{\subsectionmark}[1]{\markright{#1}}  % \rightmark
  ---
\documentstyle[fancyheadings]{book}
\renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}  % \leftmark
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} % \rightmark

Furthermore \headheight and \footskip have enough height, two lines of headers and footers are possible. In such a case,

\rhead{\rm\thepage\\\today}

will output multi-line header.

A rule can be inserted between header/footer and main text body by specifying non-zero thicknesses for those dimensions shown in Table 2. The width of such rules are set equal to \textwidth, but can

Table 2 Default of Thickness of Rules

line control  default  line control  default

         header \headrulewidth 0.4pt \plainheadrulewidth 0pt
         footer \footrulewidth 0pt  \plainfootrulewidth 0pt

be extended to the portion of marginal note sections by

\addtolength{\headwidth}{\marginparsep}
\addtolength{\headwidth}{\marginparwidth}

Then the appearance of the page becomes similar to that of the L^{A}TEX manual[1].

Since L^{A}TEX set the page style of the first page (where \maketitle is declared) to be plain, the preceding settings do not affect this first page. In order to change the style of the first page, one must use

\pagestyle{fancyplain}

                   Table 3 Default of \leftmark, \rightmark

             book or (report + twoside) report    article   article + twoside
\leftmark            \chapter           \chapter   \section       \section
\rightmark           \section           \chapter   \section     \subsection

in which each field can be defined as

\fancyplain{PLAIN}{NORMAL}

i.e. the part ‘PLAIN’ defines those in plain page, while the part NORMAL is for the other pages. For example

\lhead[\fancyplain{}{\bf\thepage}]{\fancyplain{}{\bf\rightmark}}
\rhead[\fancyplain{}{\bf\leftmark}]{\fancyplain{}{\bf\thepage}}
\cfoot{\fancyplain{\rm\thepage}{}}

will output only the page number at the center of the footer of the very first page. Default settings of each field are

\lhead[\fancyplain{}{\sl\rightmark}]{\fancyplain{}{\sl\leftmark}}
\chead{}
\rhead[\fancyplain{}{\sl\leftmark}]{\fancyplain{}{\sl\rightmark}}
\lfoot{}
\cfoot{\rm\thepage}
\rfoot{}

where \leftmark etc. depend on the document style (Table 3).

3.4 Display the last page number

Suppose the total page number is fifteen, one may need to put each page number as 3/15. A hint is given in the book[8] and is used here. One way is to use \ref and \label. First you define in your own style file

\let\thepageoriginal=\thepage
\def\thepage{\thepageoriginal/\l@stp@genumber}   % <--- this style
\def\l@stp@genumber{\@ifundefined{r@l@stp@genumber}{(last page)}%
  {\expandafter\@car\r@l@stp@genumber \@nil}}
\def\lastpagenumber{%
 \def\@currentlabel{\arabic{page}}\label{l@stp@genumber}}

Then right before the line of \end{document}\lastpagenumber must be placed. Or even in the definition of \end{document}, \lastpagenumber can be inserted. This method generates desired page numbering in the second compilation, but the table of contents and output of \pageref become correct after the third compilation.

This method will also generate \pageref to be the form of 3/15. If you do not want to change \pageref, you must re-define \label as

\let\thepageoriginal=\thepage
\def\thepage{\thepageoriginal/\l@stp@genumber}  % <--- this style
\def\l@stp@genumber{\@ifundefined{r@l@stp@genumber}{(last page)}%
  {\expandafter\@cdr\r@l@stp@genumber\@nil}}
\def\lastpagenumber{\label{l@stp@genumber}}
\def\label#1{\@bsphack\if@filesw {\let\thepage\relax
   \def\protect{\noexpand\noexpand\noexpand}%
   \edef\@tempa{\write\@auxout{\string
      \newlabel{#1}{{\@currentlabel}{\thepageoriginal}}}}% <---- changed
   \expandafter}\@tempa
   \if@nobreak \ifvmode\nobreak\fi\fi\fi\@esphack}

But still three-times compilation is necessary to make the table of contents right.

In the table of contents, all the page numbers become the form of 3/15, because \thepage is re-defined in the preceding two methods. Here we show a simple method given in the reference[8] which modifies the page style. In the personal style file, one may define

     \def\ps@totalpagestyle{%
       \let\@mkboth=\@gobbletwo
       \def\@oddhead{}\def\@evenhead{}
       \def\@oddfoot{\hfill \thepage/\pageref{lastpagenumber} \hfill}
       \def\@evenfoot{\hfill \thepage/\pageref{lastpagenumber} \hfill}}
     \pagestyle{totalpagestyle}

Note that this \thispagestyle{totalpagestyle} must be placed right after \maketitle when the document has a title section as will be written in Section 4.1 (p. 7) . The last method is used to create an example of this page . This method is also used in ‘nofm.sty’^{5} .

3.5 Set the default font size be 8pt

In L^{A}TEX the default font size is 10pt, while 11pt or 12pt can be chosen as an option. There exists a style file called ‘xarticle.sty’^{6} where 7pt, 8pt and 9pt can be used for the font size of the main body of text. ‘art7[8,9].sty’ are necessary.

     \documentstyle[8pt]{xarticle}

will do all.

3.6 Put line numbers

For example, a draft may need such line numbers. ‘numline.sty’^{7} will put numbers every 5 lines. One may also be able to reset line number every page.

3.7 Need ragged-right documents

You may sometimes need a ragged-right documents just like articles by type writers. However since the original \raggedright suppresses hyphenation, appearance becomes strange when the text width is set narrow. An improvement has been done by ‘raggedri.sty’^{8} . A command, \RaggedRight and FlushLeft environment are defined. The declaration, \RaggedRight, sets all and FlushLeft environment is similar to flushleft environment.

3.8 Show labels in draft manuscript

Cross-reference in L^{A}TEX is the most valuable function, but one must remember all the labels while writing document. It is very helpful to show these labels on the pages in the phase of draft^{9}. ‘showkeys.sty’^{10}shows labels and ref’s in the pages and margins.

3.9 I don’t like formatted documents

It is the most cumbersome job to make a form like an application form for Graduate Schools by L^{A}TEX. But a style file ‘fillform.tex’^{11} may be helpful. It uses the picture environment and makes the page interactively.

Another file is ‘at.sty’^{12} . Similar method is used and specification of the distance from the origin of the document must be given. For example

6/52

5 ‘nofm.sty’ is not installed here.

6 ‘xarticle.sty’ is not installed here.

7 ‘numline.sty’ is not installed here.

8 ‘raggedri.sty’ is not installed here.

9

Similar function can be attained by using ‘draft.sty’ , but sometimes it will output warnings as ‘too many unprocessed

float’. And since draft is a reserved option for the original L^{A}TEX, one must rename this style file or \input is needed.

10 ‘showkeys.sty’ is not installed here.

11 ‘fillform.tex’ is not installed here.

12 ‘at.sty’ is not installed here.

     \at(2cm,5cm){\parbox[t]{10cm}{this is a box}}

will put the \parbox at 2cm right and 5cm below the origin.

3.10 Making similar letters to different addresses (mail-merge)

As a business letter, we sometimes need to send almost the same letters to many different people. Copy machine can be used if completely the same letters are sent, but one may change a few words in the letter correspondingly to receivers and also one needs address labels for many receivers. A style file ‘formlett.sty’ is a very fancy macro to do such things. Manual and samples are provided together with the style file.

3.11 Make a manual

When one needs to create on-line-manual like documents on UNIX, one can use ‘manpage.sty’^{13} . Sample and manuals are provided.

3.12 Other style files

We only enumerate several other files below. For school teachers to make problems, hints and answers, ‘answers.sty’^{14} and ‘ans.sty’^{15} will help a lot. Also ‘exercise.sty’^{16} will do the similar things. ‘exam.sty’^{17} is slightly different but is for preparation of examination.

‘recipe.sty’^{18} is for recipe of cooking, and ‘resume.sty’ (Yes, we have it.) is for vita. As for vita, ‘vita.sty’ (Yes, we have it.) can also be used. ‘schedule.sty’^{19} will create a simple table of personal schedule.

Title Page

4.1 empty won’t kill page number at title page

This is because the macro \maketitle includes \thispagestyle{plain} in it. Therefore to cancel this declaration one must put empty page style right after the \maketitle command as

     \maketitle\thispagestyle{empty}   % No Line Break
(from comp.text.tex or [8]).

4.2 Make titles simpler

It is not necessary to make a personal memo with author, and only the title and date may be needed. Moreover spacing at \maketitle is too large for a simple article of a small meeting. A simple title making is possible by the following command:

     \def\makesimpletitle{%
      \def\@maketitle{\newpage\null\vskip .5em%
       \@ifundefined{@author}{{\LARGE \@title}\hfill(\@date)\par\vskip .5em}%
       {\begin{center} {\LARGE \@title} \end{center}%
                      \begin{flushright} \@author~(\@date) \end{flushright}}%
       \par\vskip 1em}%
      \maketitle \let\makesimpletitle\relax}

13 ‘manpage.sty’ is not installed here.

14 ‘answers.sty’ is not installed here.

15 ‘ans.sty’ is not installed here.

16 ‘exercise.sty’ is not installed here.

17 ‘exam.sty’ is not installed here.

18 ‘recipe.sty’ is not installed here.

19 ‘schedule.sty’ is not installed here.

Instead of using \maketitle, one may use \makesimpletitle to display a simple title heading. If \author{...} is not defined, output will become simpler. This can be used in two-column documents.

4.3 One-column abstract in two-column documents

Usual abstract environment will appear at the beginning of the left column in two-column documents. Several scientific journals ask authors to write abstract in one-column centered right below the title. This

layout can be possible if \twocolumn[title ...  abstract ....]  ... is used.

Or the following change of \maketitle may be used. Define in your personal style file

     \def\abstract#1{\long\def\@abstract{#1}}
     \def\@abstract{}
     \let\@oldmaketitle=\@maketitle
     \def\@maketitle{
         \@oldmaketitle
         \begin{center}\large\bf Abstract\end{center}
         \begin{quotation}\@abstract\end{quotation}
         \vskip 1.5em}

and you can use as

     \title{This is THE title of my paper}
     \author{It's ME!}
     \abstract{We've discovered...}
     \maketitle

If \parbox is used in place of quotation environment, the width can be set to a certain dimension. In such a case, \parbox must be inside a centering environment. If \long is neglected in the definition of \def\abstract, blank line cannot be used, so that only one paragraph of the abstract is allowed.

One may change the definition of \maketitle more drastically for more complicated layout, say, including affiliations and key words listing. This can be achieved by redefining \@maketitle and an example is given in ‘1-in-2.sty’^{20} where a sample is also included.

4.4 One-column footnote by \thanks in two-column document

This may be attained by using ‘multicol.sty’ in Section 7.3.1 (p. 13) , but is possible by cheating to put a full-width footnote in the left column. One simple method is to change the definitions of \par temporarily, so that the first paragraph in the right column of the very first page automatically put a blank footnote there. An example is included in ‘1-in-2.sty’^{21}in Section 4.3 (p. 8) .

4.5 Change of title layout

Another example can be seen in ‘jsce.sty’ ^{22}, which is a style file to write a paper for the Journal of Japan Society of Civil Engineers. In two-column article, the title and authors are centered and the \thanks will appear right below authors’ list. Abstract and key words of the paper is put below them.

20 ‘1-in-2.sty’ is not installed here.

21 ‘1-in-2.sty’ is not installed here.

22 This is available from ftp.tohoku.ac.jp at pub/TeX/latex-styles/jsce.

Table of Contents

5.1 Change depth of table of contents

A counter tocdepth determines the depth of table of contents. The larger this number is, the deeper the depth becomes. Corresponding number for the depth of the article style is shown in the table at the right. It indicates that subsubsection will be in the table of contents if one sets

     \setcounter{tocdepth}{3}

in the preamble[7].

                                                             0 : chapter
                                                             1 : section
                                                             2 : subsection
                                                             3 : subsubsection
                                                               : .........

5.2 Always need compilation three times?

At the first compilation, no table-of-contents file, (.toc), exists. At the second compilation, it exists but it contains only the page numbers compiled without table of contents. This situation forces us to compile three times. However if one set separate page numbering system in the preface and main text body just like books, one can usually get proper page numbers in the second compilation. As an example, this document sets as follows:

     \pagenumbering{roman}
     \maketitle \hrule width \textwidth
     {\par\baselineskip=.8\normalbaselineskip
     \begin{quotation} \tableofcontents \end{quotation} \par}
     \vskip 1em \hrule width \textwidth \pagebreak
     \setcounter{page}{1}\pagenumbering{arabic}

Namely the page numbers of the preface are displayed by roman numerals, but the counter for the page is reset at the end of preface so that the main body of the text begins with page number ‘ONE’. Page numbers are displayed in arabic numerals. (But please check .toc file every time you compile.)

5.3 Reference page in the table of contents

If in the definition of thebibliography environment you add one line of

    \addcontentsline{toc}{section}{\refname}

it will write the page number of the reference listings into .toc file, so that the final output of the table of contents includes the page number of the list of references. The style of appearance depends on the second argument of the command \addcontentsline.

5.4 Table of contents in each chapter of book-style document

When a couple of people get together to make a book, it is convenient to have table of contents in each chapter. This is easily attained if ‘minitoc.sty’ (Yes, we have it.) is used. Commands are dependent on the document style, but when article style is used, \dosecttoc right before the table of contents and \secttoc at each section will do everything. Manual and samples are included in the original package. Note that the style file must be modified when it is used on MS-DOS systems. And one always needs to compile three times.

Sections

6.1 Cannot use a command in section title

A fragile command cannot be used in \section{...}. It may be something to do with timing of macro expansion[8]. To use such a command, one must put \protect before it. Within the command, \string may be used to escape special letters, and the space may be given explicitly by \space. However since these does not work if you want to make table of contents, you must use \section[...]{...} with no fragile commands in the bracket.

6.2 Centering of section titles

One method is given in the reference[2] which is a modification of the macro in ‘latex.tex’

     \def\@sect#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth
     ...

For example, as the section is the level 1 section in the article style, modification as

     ........
     \ifdim \@tempskipa>\z@
       \ifnum #2=1 \begin{center} \else \fi    %<---
         \begingroup #6\relax
           \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty \@M #8\par}
         \endgroup
       \ifnum #2=1 \end{center} \else \fi      %<---
     \csname #1mark\endcsname{#7}\addcontentsline
     ........

will center the section title. The chapter will be centered in the report style documents. Note that the glue spacing by center environment is added above and below the title.

The same effect is possible if the macro as

     \def\section{\@startsection {section}{1}{\z@}{-3.5ex plus-1ex minus
         -.2ex}{2.3ex plus.2ex}{\reset@font\center\Large\bf}}

is added. Or

     \def\section{\@startsection {section}{1}{\z@}{-3.5ex plus-1ex minus
         -.2ex}{2.3ex plus.2ex}{\reset@font\centering\Large\bf}}

will give almost the same output. The difference may be (?) glue spacing.

Another simple method is given in the TEX and TUG NEWS‘ttn2n1.sty’ (Yes, we have it.) .

     \def\Section{\@ifstar{\@Section[2pt]}{\@Section[\z@]}}
     %
     \def\@Section[#1]#2{\ifdim #1<1pt\refstepcounter{section}\fi%
      \section*{\centering \ifdim #1<1pt%
       \addcontentsline{toc}{section}{\protect\numberline{\thesection}#2}%
        \thesection. \fi #2 \nopagebreak[4]}}

This defines \Section{...} to center the title. Since \section* is used instead of \section, you must modify it if you need to show \thesection. In this case, \refstepcounter must also be used to increment

\thesection and to reset \thesubsection etc.

6.3 Adjust spacings above and below section titles

In submitting a camera-ready manuscript to proceedings of conferences, the default spacings near the section titles are a bit large enough to squeeze information in the article. These spacings can be adjusted through re-definition of \section in ‘art12.sty’ etc. For example, ‘art10.sty’ has the definition as

     \def\section{\@startsection {section}{1}{\z@}{-3.5ex plus-1ex minus
       -.2ex}{2.3ex plus.2ex}{\reset@font\Large\bf}}

The fourth and fifth arguments of \@startsection define the spacings. If the fourth argument is negative, it prohibits indentation at the beginning of the first paragraph. When it is modified as

     \def\section{\@startsection {section}{1}{\z@}{1.1ex plus
      .2ex minus.1ex}{1ex plus.2ex}{\reset@font\large\bf}}

spacings become small and the first paragraph has the same indentation as those succeeding paragraphs. The font size of the section titles is also changed into \large. Furthermore, if the fifth argument is set negative, the first paragraph will follow the title without carriage return. (Not that the string ‘\reset@font’ is not used in the old version of ‘article.sty’ and ‘latex.tex’.)

When you want to change the display of section numbers to [1], you simply re-define \thesection as

     \def\thesection{[\arabic{section}]}

6.4 Relax pagination system in ‘book.sty’

In the book style, the chapter begins in the odd page. The table of contents is also controlled by the same macros as \chapter, and begins in the odd page.

For example, in ‘bk10.sty’, the definition of \chapter is given as follows:

     \def\chapter{
       \cleardoublepage              % make it into odd page
       \thispagestyle{plain}         % and no header in THAT page
       \global\@topnum\z@
       \@afterindentfalse
       \secdef\@chapter\@schapter}

Therefore change of \cleardoublepage into \clearpage will stop output of white page and will start chapters from even page. Although it is not a good idea, it saves papers while making a draft.

6.5 Why no section number at subsubsection in book?

The section numbering is controlled by a counter secnumdepth which can be set just like tocdepth in Section 5.1 (p. 9) .

Main Body of Text

7.1 Change expression of paragraphs

7.1.1 Emphasize the beginning of paragraphs

Some old books start the paragraph with the big first letter that spans a few succeeding lines. The style file named ‘drop.sty’^{23} will do this kind of fancy output^{24}. Old German fonts in Section 14.4.3 (p. 43) may be useful.

Or ‘dropcaps.sty’^{25} does the same thing with more controls than ‘drop.sty’. Manual and samples are included in the original package.

23 ‘drop.sty’ is not installed here.

24 ‘drop.sty’ needs to be edited to set the font size before installation.

25 ‘dropcaps.sty’ is not installed here.

7.1.2 Set indentation or margins of paragraphs

A simple way is shown in the reference[6], but it is not in effect within verbatim environment. Another method may be to use list environment, but it is not easy to set spacings before and after the paragraph. A solution is to use \parshape, and the indentation environment defined in ‘indent.sty’^{26} can be used.

7.1.3 Make the shape of paragraph meaningful

For example, a paragraph in a message card for birthday or wedding may be in the shape of heart for strong impression.From FILESERV-Mgr@SHSU.edu Sun May 9 00:08:40 1993 Received: from [192.92.115.8] by loria.loria.fr with SMTP id AA12942 (5.65c+/IDA-1.4.3 for roegel); Sun, 9 May 93 00:08:24 +0200 Message-Id: ¡9305082208.AA12942@loria.loria.fr¿ Received: by SHSU.edu (MX V3.2) id 15087; Sat, 08 May 1993 17:12:21 CDT Date: Sat, 08 May 1993 17:12:21 CDT Sender: FILESERV-Mgr@SHSU.edu Errors-To: FILESERV-Mgr@SHSU.edu Warnings-To: ¡¿ From: FILESERV-Mgr@SHSU.edu Reply-To: FILESERV@SHSU.edu Subject: STY.SHAPEPAR To: Denis.Roegel@loria.fr Status: RO

Or any kind of shape may be defined if you use ‘shapepar.sty’ .

        \shapepar{\heartshape}
        This is an example of using
        heart shape paragraph defined
        in the original style file.
        There are a few more shapes
        defined in this style file.

This is an example of using heart shape paragraph defined in the original style file. There are a few more shapes defined in this style file.

7.1.4 Numbering of paragraphs

While making a draft of a book with some other friends, it may be convenient for the discussion on telephone to have the number at each paragraph just like a sheet music. A style file ‘numberpar.sty’^{27} puts paragraph number at the beginning of each paragraph.

7.2 Underlining

7.2.1 Emphasis with underlines

Underlines do not seem to be recommended in TEX, and a command \underline{...} cannot span to multiple lines.

If you really want to draw underlines for emphasis, you may use ‘ulem.sty’ which allows underlines in multiple lines. Within this style file, if one decides to use extended functions, one can use wavy underlines, scratch-out and cross-out. This is an example of ‘ulem.sty’. When ‘ulem.sty’ is used, the emphasized

text by \em is under-lined unless \normalem is declared at the beginning. Note that the \verb does not

behave normally but needs \string. Other options such as \uwave are not available^{28} here.

7.2.2 Wavy underlines

This symbol may be used for proof-reading or type-setting to make the letter gothic. Vectors and tensors are sometimes indicated by this symbol on blackboard at school. A style file ‘undtilde.sty’^{29} can be used. It seems to use \tilde. Note that the name of this style file is set by us and that this is an article

on ‘comp.text.tex’.

26 ‘indent.sty’ is not installed here.

27 ‘numberpar.sty’ is not installed here.

28 Old version of ‘ulem.sty’ is installed or extended functions of the new version are not set active.

29 ‘undtilde.sty’ is not installed here.

[figure: Last Page; 16 cm; \lastpage-; settings; 4. END] Fig. 1-a Ordinary Output  ⟹  [figure: ABSTRACT; Last Page; 8 cm; \lastpage-; settings; \lastpage-; control{8cm}; 4. END] Fig. 1-b Cheated Last Page

Fig. 1 Balancing the Last Page

7.2.3 Double underlines

This might have been used in proof-readings. ‘uuline.sty’^{30} utilizes the extended functions in ‘ulem.sty’ to put double underlines. This file, ‘uuline.sty’^{31}, explains a method to put any kinds of strings underneath characters.

7.3 Multi-column documents

7.3.1 Need one-column and double-column mixed, or three-column documents

L^{A}TEX has two commands to switch one- and double-column, which are \onecolumn and \twocolumn. But these always clear the page.

When you want one-column part and double-column part in one page, you need ‘multicol.sty’ , which also enables arbitrary multi-column documents. One big restriction is that one cannot use floats within columns.

You will get a balanced portion of n-column beginning with

\begin{multicols}{n} through
the line of \end{multicols}.
\begin{multicols}{3}

                               [\section{.....}]

puts the section title in onecolumn and starts the section in 3-column format. Between columns, a rule with width of 0.4pt is inserted. The thickness is specified by setting dimension,

                                                           \columnseprule, the default of

which is 0pt. You may need BigTEX for compilations

7.3.2 Balance the last page in two-column documents

In the ordinary twocolumn documents, the columns of the last page are not balanced so that the right column ends at the middle of the page while the left column reaches the bottom of the page. The style file ‘multicol.sty’ in Section 7.3.1 (p. 13) automatically controls this kind of output, but one can use a cheating in the ordinary two-column documents.

If you put a blank footnote in the left column, you may force a part of text move into the right column. By trial and error, specification of the height of this blank footnote will eventually balance columns. This method is used in ‘1-in-2.sty’^{32}in Section 4.3 (p. 8) . (See Fig. 1)

30 ‘uuline.sty’ is not installed here.

31 ‘uuline.sty’ is not installed here.

32 ‘1-in-2.sty’ is not installed here.

7.3.3 Side-by-side translation

One may need instructions in English and Japanese side by side, for example, for graduate students in universities. The minipage environment is not easy to use and twocolumn style does not suit for this. A style file called ‘multicolpar.sty’^{33} may be used easily. It makes a two-column document with changing columns automatically at every paragraphs.

7.4 Ruby not diamond

A macro in the reference[7, 8] will help but NTT JTEX supplies a style file called ‘ruby.sty’^{34} in the package. If proper font name is chosen in ‘ruby.sty’^{35}, ASCII Nihongo TEX can process it. Usage is written in comment lines.

Or ‘nruby.sty’^{36} is in public. The font size of ‘ruby’ is set to \tiny.

7.5 Italic correction

When italic font is used in the roman documents, \/ is usually needed at the end of the italic strings. A file ‘italic.sty’^{37} put it automatically, but \ital{...} and \slant{...} must be used in place of

\it and \sl.

7.6 German, French and Russian

7.6.1 Umlaut in German

One needs to use \"u for ü, but it is cumbersome.

A style file ‘german.sty’ makes such codings easy enough;e.g. ü can be input by "u. Other examples are: "`"u"' becomes ”ü“; "<"a"> outputs ^{≪}ä^{≫}.

7.6.2 French documents

Similarly to ‘german.sty’, ‘french.sty’ (Yes, we have it.) is prepared. We did not try yet, but it is used to create a format file (.fmt) by initex.

7.6.3 Russian documents

I am afraid that the documents are written in Japanese, but ‘sscyr.sty’^{38} uses cyrillic fonts of AMS-TEX to write documents in Russian.

7.7 On verbatim environment

7.7.1 \verb cannot span to multiple lines

For example, a long path-name on UNIX may not be displayed in one line, so that the \verb cannot be used. As has been pointed out in the reference[8], if \tt and \slash are used in place of \verb and /, one can write a long string. But ‘path.sty’ (Yes, we have it.) accepts line break at any kind of delimiters. Note that if you want to use it with TEX of old version; i.e. before ver.3, a numeral ‘255’ in this file must be changed into ’127’.

7.7.2 Make commands active even in verbatim environment

In the verbatim environment, \ is treated as a string. Hence no command is active within this environment.

But if you use ‘alltt.sty’ , output is written in Typewriter Type font, while \ and {} remain to be TEX’s special characters. Therefore you can change fonts inside this environment.

33 ‘multicolpar.sty’ is not installed here.

34 ‘ruby.sty’ is not installed here.

35 ‘ruby.sty’ is not installed here.

36 ‘nruby.sty’ is not installed here.

37 ‘italic.sty’ is not installed here.

38 ‘sscyr.sty’ is not installed here.

        \begin{alltt}
         This is an example of ....
         \large `alltt.sty'. \tt This...
         ...
         \scriptsize This is the end...
        \end{alltt}

                                                This is an example of the environment

‘alltt.sty’. This is...

Yes. you have this style file...

Usage is given in the comment

lines of the file...

This is the end of example.

Similar function is possible by ‘astyped.sty’ (Yes, we have it.) .

7.8 Draft and final, or neglecting many lines

While making draft, we want to write down many things as memos but do not want to output these lines. In the final manuscript, we may need some parts of these lines. Or you may need to neglect many lines temporarily. ‘version.sty’ (Yes, we have it.) can be used for these purposes. If you want to neglect lines, then put \begin{comment} at the beginning of the lines and \end{comment} at the end.

   If you declare \includeversion{draft} and \excludeversion{final}, all the portion within draft

environment will be output but final environment will be neglected. Exchange of \includeversion and \excludeversion reverses the output.

‘version.sty’ is used in this package to decide whether examples can be shown or not depending on existence of the corresponding file.

‘comment.sty’^{39} is also used to comment out many lines.

7.9 On footnotes

7.9.1 Put footnotes and floats at the end of documents

One may need to gather all the figures and tables or footnotes at the end of documents. ‘endnote.sty’ (Yes, we have it.) will help it. Or ‘endnotes.sty’ (Yes, we have it.) can be used. As for tables and figures, ‘endfloat.sty’ (Yes, we have it.) can be used.

7.9.2 Short footnotes

When there are many footnotes in one page but they are short, one may want to list them sideways. ‘fnpara.sty’ (Yes, we have it.) will do this.

7.9.3 Indentation for long footnotes

You may like indented footnotes like those in TEXBook[9]. A creator of JaWaTEX, Dr. Watanabe^{40} modified footnote macros as

     \long\def\@makefntext#1{\parindent 1em\noindent
       \hbox to 2em{\hss$^{\@thefnmark}$~}%
       \@tempdima\columnwidth\advance\@tempdima-2em\parbox[t]{\@tempdima}{#1}}

to do so. This modification is employed in this package. Other methods are collected in ‘hanging.tex’^{41} .

7.9.4 What happened to footnotes in tabular environment?

In the manual, \footnotemark and \footnotetext{...} and \addtocounter{footnote}{??} must be

used. But if you use ‘ftn.sty’^{42} , \ftn{...} instead of \footnote will output footnotes in tabular environment properly.

7.9.5 Place all the footnotes in the right column

‘ftnright.sty’ (Yes, we have it.) in the Mainz package does this, but ‘multicol.sty’ in Section 7.3.1 (p. 13) cannot be used at the same time.

39 ‘comment.sty’ is not installed here.

40 watanabe@akiu.gw.tohoku.ac.jp 41 ‘hanging.tex’ is not installed here.

42 ‘ftn.sty’ is not installed here.

7.10 On hyphenation

TEX itself has a rule for hyphenation but it is not always correct especially for proper nouns. In such cases, one must specify the rule as

     \hyphenation{man-u-script man-u-scripts ....
                  ....}

or you may find several rules in many ftp sites.

7.11 Temporary change of line pitch

For example a program listing in the manual may be printed out with smaller line pitch just like this document. If \baselineskip is changed, this becomes active only when \cr is encountered. Therefore english environment in this document is defined as

     \def\english{\par\baselineskip=.7\normalbaselineskip
       \vskip .4286\baselineskip\noindent\ignorespaces}    % .4286=(1-.7)/.7
     \def\endenglish{\par}

to use

     \begin{english}
     Programs may be put here...
     ....
     \end{english}
     \noindent where ....

Note that \begin{english} always breaks line without indentation but that \end{english} breaks line with indent. Therefore an explicit usage of \noindent is necessary to continue statement without indentation after this environment.

If \baselinestretch is changed inside the document, it does not seem to function. This is because this correction is active only when size-change commands are executed. (Here make the pitch twice.)

It is written in TEX and TUG NEWS (Vol.2, No.3 June 1993 ‘ttn2n3.tex’) that the change of the

pitch becomes active if you change temporarily font size;i.e.

     \renewcommand{\baselinestretch}{2}\tiny\normalsize

will change the pitch twice with normal font size. (Here we return to the ordinary line pitch.) Note that the spacings above and below this changes must be adjusted manually.

7.12 Program listings from separate files

For example, verbatim environment can be used with small line pitch as

     \newenvironment{program}%
       {\begin{quote}\addtolength{\baselineskip}{-0.8ex}}%
       {\end{quote}}

where quote environment is used to add indentation.

But it is not realistic to include all the lines of program directly into your document file. If you

use ‘verbatimfiles.sty’^{43} , \verbatimfile{filename} reads ‘filename’ in and outputs the lines in

verbatim environment. If \verbatimlisting{filename} is used, the line number will be output.

‘cprog.sty’ (Yes, we have it.) will input and beautify C programs.

There is a program to convert files of FORTRAN or Prolog into text files for L^{A}TEX with font change of key words. ‘lgrind’ converts into L^{A}TEX file, while plain TEX sources can be obtained by ‘tgrind’. About 25 kinds of source files like C, FORTRAN, CSH and Mlisp can be converted. Note that the spaces in comment lines must be replaced by ~ for proper display.

43 ‘verbatimfiles.sty’ is not installed here.

7.13 Algorithm of program

Just like the theorem environment, the flow of programs sometimes needs to be displayed with variable fonts.

‘algorithms.sty’ is the one to do so. There is a completely different file ‘algorithm.sty’ for another purpose.

7.14 Emphasis by thick rules

In TEX and TUG NEWS (Vol.2, No.4 Oct. 1993 ‘ttn2n4.tex’), a fancy usage of rules was seen. We here modify it.

TODAY’S TOPIC

Photo Contest of Beautiful Bridges

Today the meeting will be held on 15:00 at a conference room on the 5th floor. One of the big topics to discuss is about judges. Everyone must prepare the following items.

1. Eyeglasses

2. Pens and cakes

3. .....

is output of the following announce environment.

     \def\REYrule{\hbox to 2cm{\leaders\hrule height 3pt\hfill}}
     \newbox\REYbox
     \def\announce#1{%
       \setbox\REYbox=\hbox{\REYrule\quad{\LARGE\bf #1}\quad\raise3pt\REYrule}%
       \gdef\REYbigrule{\hbox to \wd\REYbox{\leaders\hrule height 3pt\hfill}}%
       \vspace{1em}%
       \centerline{\raise3pt\REYrule\quad{\LARGE\bf #1}\quad\raise3pt\REYrule}}
     \def\endannounce{\par\centerline{\REYbigrule}}
An example above starts with \begin{announce}{TODAY'S TOPIC}.

7.15 Other environments

‘algorithm.sty’^{44} is for algorithm display of programs. ‘program.sty’ (Yes, we have it.) helps display of programs.

Mathematics

8.1 Equation numbering

8.1.1 Sub numbering of equations

L^{A}TEX automatically put numbers sequentially using only one counter, equation. One may need to put sub number as (3-a) especially in the eqnarray environment. ‘subeqn.sty’^{45} seems to be the one for that purpose. This also allows text between equations. Or ‘subeqnarray.sty’^{46} may have the similar function. But using these style files, we cannot specify \label’s properly.

44 ‘algorithm.sty’ is not installed here.

45 ‘subeqn.sty’ is not installed here.

46 ‘subeqnarray.sty’ is not installed here.

Here we made a simple macro for the purpose. ‘manyeqns.sty’^{47} uses a new counter for sub number within a new manyeqns environment. The sub number can be changed manually, so that one can put text between two consecutive manyeqns environments. Cross-reference by \ref and \label can be set for each equation as well as all the set.

Since ‘subeqnarray.sty’ does have a problem about \label, another style file is introduced which is similar to \case in plain TEX. ‘cases.sty’^{48} defines a macro.

8.1.2 Set section number into equation numbers

\theequation needs to be modified to include section number and to reset every sections. For example

     \@addtoreset{equation}{section}
     \def\theequation{\arabic{equation} of Sec. \thesection}

F = ∫_{Γ} sin z dz  (1 of Sec. 8)

A command \@addtoreset{cA}{cB} resets a counter cA every time another counter cB changes.

8.1.3 One equation number for a set of equations

Of course, one can get such output using \nonumber in the eqnarray environment, but it does not look good when the number of equations is even.

A simple method is to use array environment in the equation environment. Since the default style in array environment is \textstyle, one must explicitly declare \displaystyle when \sum and/or \int are included.

     \begin{equation}
     \begin{array}{l}
     {\displaystyle I=\sum_{i=1}^N a_i\,b_i} \\
                    \noalign{\vskip 1ex}
     {\displaystyle f=\int_0^\ell g(x)\,\sin x\, dx}
     \end{array}
     \end{equation}

\begin{matrix}I = ∑_{i=1}^{N} a_{i} b_{i} \\ f = ∫_{0}^{ℓ} g(x) sin x dx \end{matrix} (2)

Moreover, as shown here, \noalign may be necessary to control spacings when high symbols like \int must be used (See Section 8.4.1 (p. 19) ).

8.2 Leaders in flush-lefted equations

When an option of ‘fleqn.sty’ is used, space between equation and equation number becomes wide so that some kind of leaders may be necessary. Macros introduced here are defined by Mr. Isozaki[8] and Dr. Watanabe. ‘doteqn-f.sty’^{49} is the name of a style file and puts leader in the eqnarray environment. The equation environment can have such a leader. It is defined in ‘dot-eqns.sty’^{50} included in the package of ‘manyeqns.sty’ above.

8.3 Spaces at ‘&’ are too wide in eqnarray environment

This spacing has been set at the definition of eqnarray environment[7].

     ....
     $\displaystyle\tabskip\z@{##}$&\global\@eqcnt\@ne
      \hskip 2\arraycolsep \hfil${##}$\hfil
     %^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     &\global\@eqcnt\tw@ \hskip 2\arraycolsep $\displaystyle\tabskip\z@{##}$\hfil
     %                  ^^^^^^^^^^^^^^^^^^^^^^
      \tabskip\@centering&\llap{##}\tabskip\z@\cr}

47 ‘manyeqns.sty’ is not installed here.

48 ‘cases.sty’ is not installed here.

49 ‘doteqn-f.sty’ is not installed here.

50 ‘dot-eqns.sty’ is not installed here.

The portions underlined are to be modified as

     $\displaystyle\tabskip\z@{##}$&\global\@eqcnt\@ne
      \hfil$\;{##}\;$\hfil
     &\global\@eqcnt\tw@ $\displaystyle\tabskip\z@{##}$\hfil
      \tabskip\@centering&\llap{##}\tabskip\z@\cr}

to get the following example. In the reference[7], the part between these two & is also changed to be

\displaystyle.

\begin{aligned}F & = & ∫_{Γ} sin z dz \\ G & = & ∑_{n=0}^{∞} a_{n} t^{n} \end{aligned}  ⟶  \begin{aligned}F & = & ∫_{Γ} sin z dz \\ G & = & ∑_{n=0}^{∞} a_{n} t^{n} \end{aligned}

8.4 On matrices

8.4.1 Space between rows is small

Especially when displaystyle\frac is in the element of a matrix, rows become too close to each other. In order to separate them, \noalign{\vskip ...} can be used[4].

   \left\{\begin{array}{c}
    f_1\\ f_2\\ f_3
   \end{array}\right\}=
   \left(\begin{array}{ccc}
    A & 0 & B \\
          \noalign{\vskip 1.2ex}  % <-----
    0 & \displaystyle{\frac{EA}{\ell}} &
    -\displaystyle{\frac{EA}{\ell}}\\
          \noalign{\vskip 1.2ex}  % <-----
    B & -\displaystyle{\frac{EA}{\ell}} &
    \displaystyle{\frac{EA}{\ell}}
   \end{array}\right)\left\{
   \begin{array}{c}
    u_1\\ u_2\\ u_3
   \end{array}\right\}

\{ \begin{matrix}f_{1} \\ f_{2} \\ f_{3} \end{matrix} \} = ( \begin{matrix}A & 0 & B \\ 0 & \frac{EA}{ℓ} & −\frac{EA}{ℓ} \\ B & −\frac{EA}{ℓ} & \frac{EA}{ℓ} \end{matrix} ) \{ \begin{matrix}u_{1} \\ u_{2} \\ u_{3} \end{matrix} \}

is a typical example .

8.4.2 Alignment of quadratic forms

There are a few methods to align a row vector to the top line of the matrix in quadratic forms. One method by Mr. Daniel H. Luecking is a modification of the plain TEX command.

     \def\tpmatrix#1{
      \setbox\z@=\vtop{\normalbaselines\m@th
       \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr
        \mathstrut\crcr
        \noalign{\kern-\baselineskip}
        #1\crcr
        \mathstrut\crcr
        \noalign{\kern-\baselineskip}
       }
      }
      \dimen\z@=\dp\z@
      \setbox\z@=\vbox to \ht\z@{
       \hbox{$\displaystyle \left(\,\vcenter{\unvbox\z@}\,\right)$}
       \vss
      }
      \dp\z@=\dimen\z@
      \box\z@
     }

will generate

\pmatrix{x & y & z}
\tpmatrix{a_1 & a_2 & a_3 \cr
     a_4 & a_5 & a_6 \cr
     a_7 & a_8 & a_9 \cr
}
\tpmatrix{b \cr c \cr d}

( x y z) ( \begin{matrix}a_{1} & a_{2} & a_{3} \\ a_{4} & a_{5} & a_{6} \\ a_{7} & a_{8} & a_{9} \end{matrix} )( \begin{matrix}b \\ c \\ d \end{matrix} )

Another one by Mr. Donald Arseneau is

\newbox\matbox
\def\topmatrix#1{\setbox\matbox=\vtop{\normalbaselines\m@th % set the matrix in
\ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr    % a \vtop so the
\mathstrut\crcr\noalign{\kern-\baselineskip}      % first baseline
#1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}} % lines up.
% get twice difference between baseline and centerline of inner matrix:
\dimen255=\dp\matbox \advance\dimen255 by -\ht\matbox
% Center matrix and surround with parentheses:
\setbox\matbox=\hbox{$\left( \,\vcenter{\box\matbox}\,\right)$}
% Correct for difference between baseline and centerline of parentheses:
\advance\dimen255 by -\dp\matbox \advance\dimen255 by \ht\matbox
% Lower centered matrix back to its proper baseline:
\lower0.5\dimen255\box\matbox
}

will be used to get

\pmatrix{x & y & z}
\topmatrix{a_1 & a_2 & a_3 \cr
          a_4  & a_5 & a_6 \cr
          a_7  & a_8 & a_9 \cr
}
\topmatrix{b \cr c \cr d}

( x y z) ( \begin{matrix}a_{1} & a_{2} & a_{3} \\ a_{4} & a_{5} & a_{6} \\ a_{7} & a_{8} & a_{9} \end{matrix} )( \begin{matrix}b \\ c \\ d \end{matrix} )

The last one by Mr. Bruce Ikenaga is the easiest method

\matrix{ A = \cr
  \vphantom{ 0 } \cr
  \vphantom{ 0 } \cr}
\matrix{ \pmatrix{a & b & c\cr} \cr
  \vphantom{ 0 } \cr
  \vphantom{ 0 } \cr}
\pmatrix{ 1 & 0 & 0 \cr
  0 & 1 & 0 \cr
  0 & 0 & 1 \cr}
\pmatrix{b \cr c \cr d}

A = ^{( a b c)} ( \begin{matrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{matrix} ) ( \begin{matrix}b \\ c \\ d \end{matrix} )

and in L^{A}TEX we can write as follows:

\begin{array}{ccc}
\lfloor\quad a & b & c \quad\rfloor \\
\vphantom{0} \\
\vphantom{0}
\end{array}
\left(\begin{array}{ccc}
  a_1 & a_2 & a_3 \\
  a_4 & a_5 & a_6 \\
  a_7 & a_8 & a_9
\end{array}\right)
\left\{\begin{array}{c}
x \\ y \\ z
\end{array}\right\}

⌊ a b c ⌋ ( \begin{matrix}a_{1} & a_{2} & a_{3} \\ a_{4} & a_{5} & a_{6} \\ a_{7} & a_{8} & a_{9} \end{matrix} ) \{ \begin{matrix}x \\ y \\ z \end{matrix} \}

8.4.3 Simplification of matrices

Alignment in matrices or cases is one of the most cumbersome inputs in L^{A}TEX.

‘delarray.sty’ may make it a bit easy. Manual and samples are included in the original package, but always another style file ‘array.sty’ is needed.

8.5 Over and under braces to separate terms in equation

It was an article on ‘comp.text.tex’. We made this article to be a style file called ‘ovudbraces.sty’^{51} without creator’s consent. The creator is Mr. Donald Arseneau. The question is how to output

               x               y
         ,-----^-----,   ,-----^-----,
 a + b + c + d + e + f + g + h + i + j + k + l + m = \pi r^2
                 `-----v-----'
                       z

in L^{A}TEX documents.

8.6 Height of parentheses and spaces in math mode

Spaces must be set manually in math mode. Here we enumerate an example to refer.

g=\int_a^b\int_c^e f(x,y)\,dx\,dy

g=\int_a^b\!\!\!\int_c^e f(x,y)\,dx\,dy

g = ∫_{a}^{b} ∫_{c}^{e} f(x, y) dx dy_{g = ∫_{a}^{b}∫_{c}^{e} f(x, y) dx dy}

f(x)=a  x + b
f(x)=a\,x + b
f(x)=a\:x + b
f(x)=a\;x + b

f(x) = ax + b_{f(x) = a x + b}_{f(x) = a x + b}_{f(x) = a x + b}

Also variable-height parentheses are listed below:

\left\{\sqrt{1+\frac{\pi}{\omega}}
\Biggl[\biggl(\Bigr|\bigr](a+b)\right\}

\{\sqrt{1 + \frac{π}{ω}} [(|](a + b)\}

Sometimes we need a pile-up of symbols. There are several ways but a few from the reference[4] are shown below:

g\stackrel{\rm def}{=}\sin(x)...
\sum_{{\scriptstyle j=1}
 \atop{\scriptstyle i\neq j}}^n
\mathop{\bf Res}_{\Im z>0}\,f(z)
\mathop{\sum_{i=1}^n \sum_{j=1}^m}%
      _{i+j=\mbox{\scriptsize even}}

g =^{def} sin(x)..., ∑_{{j=1 \atop i≠j}}^{n}, Res_{ℑz>0} f(z), \begin{matrix}∑_{i=1}^{n} & ∑_{j=1}^{m} \\ i+j=even \end{matrix} (3)

8.7 Math commands of plain TEX

8.7.1 Alignment of square root symbols

a &=& \sqrt{g}+\sqrt{h}
b &=& \sqrt{\mathstrut g}+\sqrt{\mathstrut h}

a = \sqrt{g} + \sqrt{h}_{b = \sqrt{g} + \sqrt{h}}

51 ‘ovudbraces.sty’ is not installed here.

8.7.2 Pile up

{a \atop b} + c
a \atopwithdelims<> b
a \atopwithdelims\{. b

{a \atop b} + c,  \left⟨{a \atop b}\right⟩,  \{{a \atop b}

8.7.3 Matrices

A=\pmatrix{ a & b \cr
            c & d \cr }
A= \left[ \matrix{ a & b \cr
          c & d \cr } \right]

A = ( \begin{matrix}a & b \\ c & d \end{matrix} ) , A = [ \begin{matrix}a & b \\ c & d \end{matrix} ]

8.7.4 Cases

|x|=\cases{ x & (if $x$ $\ge$ 0) \cr
           -x & (otherwise) \cr }

|x| = \{ \begin{matrix}x & (if x ≥ 0) \\ −x & (otherwise) \end{matrix}

8.8 Floating point calculation in the text

TEX itself carries out all the calculation by integer variables probably because of its historical reasons. But a style file by Mr. Isozaki, ‘eclarith.sty’^{52} enables us to calculate real numbers or even to use trigonometric functions.

8.9 Chemical formulas

In L^{A}TEX it is a very difficult task, but it becomes a little easy if one uses AMS-L^{A}TEX. There is a package called ChemTEX to handle these chemical formulas, in which ‘chemtex.sty’^{53} and manual are included^{54}. As for reaction equations, a style file ‘dchem.sty’^{55} can be used. New environments like the equation and eqnarray ones in math mode are prepared.

Another file to be used in plain TEX is called ‘chemstruct.tex’^{56} . We don’t use it, though.

8.10 Want to use variable-length arrows

Even not in math mode, one may need an arrow with explanation above it. The style file ‘dchem.sty’^{57} introduced above has a couple of definitions for such arrows. For example \Yields can be used in math mode Length can be explicitly specified as \Yields[3cm]. Double arrow with explicit length is used by

\Eqbm.

8.11 Double bracket

In TEX and TUG NEWS (Vol.1, No.2 May 1992 ‘ttn1n2.tex’), we found a macro defined by Mr. Michael Barr (McGill Univ., Montreal, barr@math.mcgill.ca) as

     \newdimen\argwidth
     \def\[[#1\]]{%
         \setbox0=\hbox{$#1$}\argwidth=\wd0
         \setbox0=\hbox{$\left[\box0\right]$}\advance\argwidth by -\wd0
         \left[\kern.3\argwidth\box0\kern.3\argwidth\right]}

52 ‘eclarith.sty’ is not installed here.

53 ‘chemtex.sty’ is not installed here.

54

In compiling on UNIX, it is necessary to correct file names in the manual, because upper-case letters are used while the

actual file names are in lower-case letters.

55 ‘dchem.sty’ is not installed here.

56 ‘chemstruct.tex’ is not installed here.

57 ‘dchem.sty’ is not installed here.

This helps us to use $\[[\sum_\{i\in I\}A_i=A\]]$ to output \begin{matrix}[ \\ [ & ∑_{i∈I} A_{i} = A & ] \\ ] \end{matrix}. In the ordinary displaying math mode, \displaystyle can be used within these brackets.

\begin{matrix}[ \\ [ & ∑_{i∈I} A_{i} = A & ] \\ ] \end{matrix}  (4)

is an example.

8.12 Use symbols of AMS-TEX in L^{A}TEX documents

AMS-TEX has many varieties of mathematical symbols and macros. Among such features, one can use symbols by using ‘amssymbols.sty’^{58} .

8.13 Integral symbols

8.13.1 Big and standing integral symbols

The integral symbol is a variable-height symbol, but the maximum height is limited. And some people dislike that slanted integral symbol. ‘bigint.sty’^{59} defines a new integral symbols probably using

\lmoustache etc.
     \bigint[overlap symbol] [_lower][^upper] { integrand }

is a typical usage where the parts in brackets are options.

8.13.2 A symbol ‘BELOW’ multiple integral symbols

Usually a volume integral is indicated by putting V right-below three integral symbols. But sometimes a domain like V needs to be placed below the integral symbols. ‘multiint.sty’^{60} will output such symbols automatically.

8.13.3 Closed surface integral

Even AMS-TEX does not have this symbol. In order to output ∮ with two integral symbols, one may

use ‘Ointint.sty’^{61} .

8.14 Blackboard style symbols

There exists a font set of this kind in a separate package or in AMS-TEX. But one can cheat to get similar symbols in the ordinary L^{A}TEX by using ‘pmbb-sym.sty’^{62} .

8.15 Draw commutative diagrams

There are style files called ‘cd.sty’ and ‘diagram.sty’^{63}. ‘cd.sty’ (Yes, we have it.) draws rather simple diagrams. On the other hand, ‘diagram.sty’^{64} can help drawing complicated diagrams.

Another style file is ‘diagrams.tex’ (Yes, we have it.) , which can be used in both L^{A}TEX and plain TEX. Manual and samples are included in the original package, but it can output Postscript and TPIC codes by user’s choice.

8.16 Flow of proof

‘proof.sty’ (Yes, we have it.) draws such a tree in proof.

58 ‘amssymbols.sty’ is not installed here.

59 ‘bigint.sty’ is not installed here.

60 ‘multiint.sty’ is not installed here.

61 ‘Ointint.sty’ is not installed here.

62 ‘pmbb-sym.sty’ is not installed here.

63 It used to be ‘catmac.sty’.

64 ‘diagram.sty’ is not installed here.

8.17 Change style of newtheorem

If you want to change “Theorem 4.1” into “Theorem 4-1”, you simply re-define as

     \def\@thmcountersep{-}
See ‘latex.tex’.

Modification of list Environment

9.1 Modification of itemize environments

9.1.1 Change of labels in enumerate environment

Since labels and symbols of each depth are stored in the following pairs, they can be changed by modification of these[1].

     \labelenumi    \theenumi
     \labelenumii   \theenumii
     \labelenumiii  \theenumiii
     \labelenumiv   \theenumiv
     \labelenumv    \theenumv

For example, if the first enumeration needs to begin with symbols as A), B), one can set as

                                                \def\labelenumi{\theenumi)}
                                                \def\theenumi{\Alph{enumi}}

where arabic numerals can be obtained by \arabic{enumi}, while roman numerals are by

                                           \roman{enumi}.

9.1.2 Change labels in itemize environment

Similarly this can be done by modifying \labelitemi etc. For example, the next definition changes the second deep itemize symbol to a solid diamond shape.

     \def\labelitemii{$\diamond$}

9.1.3 Add a symbol to labels of enumerate environment

There are several style files to add a mark to labels of enumerate environment.

One is called ‘enumerate.sty’ , style and string for the label can be specifies as an option.

        \begin{enumerate}[{\bf Problem 1.}]
         \item Solve ...
         \item Explain ...
          \begin{enumerate}[{H{i}nt. a}]
           \item Let ...
           \item Suppose ...
          \end{enumerate}
         \item Calculate ...
          \begin{enumerate}[{H{i}nt. i}]
           \item Let ...
           \item Suppose ...
          \end{enumerate}
        \end{enumerate}

Problem 1. Solve ...

Problem 2. Explain ...

Hint. a Let ... Hint. b Suppose ...

Problem 3. Calculate ...

Hint. i Let ... Hint. ii Suppose ...

Note that the braces in options as H{i}nt or {i} are necessary to distinguish these characters and specification of numbering style. A and I are used to set the numbering to be upper-case letters and upper-case roman numerals respectively.

Another file is ‘enumspec.sty’^{65} , and it simply put a symbol at the left of numerals.

65 ‘enumspec.sty’ is not installed here.

9.2 Adjust vertical spacings near and in the list environment

A bit wide space is inserted before and after the itemize and enumerate environment. And also space between \item’s becomes wider than the ordinary line pitch. In a personal memo or private report, this space need not be so wide. To change these, one has to edit definitions of list environments. For example, the following modification kills all the extra spacings above and below each environment.

\def\enumerate{\ifnum \@enumdepth >3 \@toodeep\else
      \advance\@enumdepth \@ne
      \edef\@enumctr{enum\romannumeral\the\@enumdepth}\list
      {\csname label\@enumctr\endcsname}{\usecounter
        {\@enumctr}\def\makelabel##1{\hss\llap{##1}}%
      \parsep\z@ \itemsep\z@ \topsep\z@}\fi}
%     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
\def\itemize{\ifnum \@itemdepth >3 \@toodeep\else \advance\@itemdepth \@ne
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
\list{\csname\@itemitem\endcsname}{\def\makelabel##1{\hss\llap{##1}}%
\parsep\z@ \itemsep\z@ \topsep\z@}\fi}
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
\def\description{\list{}{\labelwidth\z@ \itemindent-\leftmargin
       \let\makelabel\descriptionlabel \parsep\z@ \itemsep\z@ \topsep\z@}}
%                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This kind of settings has been also done in a style file called ‘jeep.sty’^{66} .

9.3 Align indentation of description environment

The description environment fixes the amount of indent to a certain width no matter how the argument becomes long. One method to specify this width by hand is introduced in the reference[4]. Example follows:

\begin{namelist}{This length}
\item[first item] This is the first one.
\item[second item] the next one.
\item[last one] finally the last one.
\end{namelist}

Time Today after midnight

Place That place near church

Materials This book and that pencil

9.4 Write dialog

The list environment can be used for this purpose.

\newenvironment{dialog}{%
  \begin{list}{}{%
    \setlength{\labelwidth}{3cm}
    \setlength{\labelsep}{1cm}
    \setlength{\itemsep}{0pt}
    \setlength{\leftmargin}{3.5cm}
  }%
}{%
  \end{list}}
\def\character#1#2{\def#1{\item[{\bf #2:}]}}
\def\naration#1{\item \par
        \medskip\hspace{-\leftmargin}
        \parbox{0.98\textwidth}{\it #1}
        \smallskip}

is the definition of dialog environment. Then

\begin{dialog}
\character{\turtle}{Turtle}
\character{\bear}{Bear}
\naration{Bear is peeping into a room of Turtle}

66 ‘jeep.sty’ is not installed here.

\bear Hi, Turtle. Where in the world have you been last night?
\turtle Well. After finishing my routine job, I stopped by ....
\bear Oh, Yeah? What ....?
\end{dialog}

will output the followings: Bear is peeping into a room of Turtle

Bear: Hi, Turtle. Where in the world have you been last night?

Turtle: Well. After finishing my routine job, I stopped by ....

Bear: Oh, Yeah? What ....?

9.5 Making Q & A

The enumerate environment can be used with slight modification. Numbers must be changed every two \item’s. For example,

\def\QandA{\setbox\@tempboxa\hbox{{\bf ~Q.99~:~}}%
  \labelwidth\wd\@tempboxa \leftmargini\labelwidth
  \advance\leftmargini\labelsep \def\labelenumi{\theenumi~:~} \enumerate}
\let\endQandA\endenumerate
\def\Qitem{\@ifnextchar [{\@item}{\@noitemargtrue \@item[\@qitemlabel]}}
 \def\@qitemlabel{{\bf Q.\@itemlabel}}
\def\Aitem{\@ifnextchar [{\@aitem}{\@noitemargtrue \@aitem[\@aitemlabel]}}
 \def\@aitemlabel{{\bf A.\@itemlabel}}
\def\@aitem[#1]{\addtocounter{\@listctr}{-1}\@item[#1]}

will define a new environment so that we can use

\begin{QandA}
\Qitem Why ... How ... ?
\Aitem Because .... In order to ...
\Qitem Then .... ?
\Aitem Yes ...
.....
\end{QandA}

Q.1 : Why ... How ... ?

A.1 : Because .... In order to ... Q.2 : Then .... ? A.2 : Yes ...

How about Figures, Tables and Photos?

10.1 On captions

10.1.1 Change caption headers One may want to change the default style of ‘Figure 1 : ...’ into, say, ‘Fig. 1. ...’ of the caption header. Look into the definition of \def\fnum@figure,

\def\fnum@figure{\figurename \thefigure}

to find out that modification of \figurename is necessary. Namely

\def\figurename{Fig.}

changes the header. Similar definition exists for tables. We can set as

\def\tablename{Tab. --}

As for the font and delimiter as ‘:’ can be changed in the definition of \long\def\@makecaption. For example,

     \long\def\@makecaption#1#2{%
        \vskip 10\p@
     %   \setbox\@tempboxa\hbox{#1: #2}%        <--- original
        \setbox\@tempboxa\hbox{{\bf#1}\ \ #2}%
        \ifdim \wd\@tempboxa >\hsize
     %       #1: #2\par                %        <--- original
            {\bf#1}\ \ #2\par
          \else
            \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
        \fi}

will make the font be \bf. Furthermore font size of the caption can be changed in the definition of

\long\def\@caption in ‘latex.tex’.

In the article style, the numbers of figures and tables are monotonically incremented throughout the entire document. If one needs to make these number to have the section number and to reset them in each section, a command \@addtoreset{figure}{section} works similarly to the case in Section 8.1.2

(p. 18) .

10.1.2 Indentation of long caption

Automatic indentation can be achieved by the next method by Mr. Watanabe as

     \long\def\@makecaption#1#2{%
        \vskip 10\p@
        \setbox\@tempboxa\hbox{{\bf #1}\ \ }%
         \@tempdima\hsize\advance\@tempdima-\wd\@tempboxa
         \setbox\@tempboxa\hbox{{\bf #1}\ \ #2}
        \ifdim \wd\@tempboxa <\hsize
            \hfil {\bf#1}\ \ #2\hfil\par
          \else
            \hbox to\hsize{\hfil {\bf #1}\ \ \parbox[t]\@tempdima{#2}\hfil}%
        \fi}

where \parbox in L^{A}TEX is used after the check of the width of caption. By this macro, long captions span to the entire width of the text. On the other hand, ‘hangcaption.sty’ (Yes, we have it.) can be used to put appropriate margins with indented captions. When this style file is used, \hangcaption{...} is used instead of \caption{...}.

10.1.3 Fragile commands cannot be used in captions

This is the same situation as those in \section{...}, and \protect will solve problems (See Section 6.1

(p. 10) ).

10.1.4 Need line break within captions

A simple method is to use \vtop. The original definition of \caption does not allow line break. It can be circumvented by usage of \usebox as

     \newsavebox{\@parc@ption}
     \def\parcaption#1{%
         \sbox{\@parc@ption}{\shortstack[l]{#1}}%
         \setbox\@tempboxa\hbox{\csname fnum@\@captype\endcsname}%
         \@tempdima\columnwidth \advance\@tempdima-\wd\@tempboxa
         \@tempdimb.8\@tempdima %<-- maximum length is set here
         \ifdim\wd\@parc@ption>\@tempdimb \@tempdima\@tempdimb
          \else\@tempdima\wd\@parc@ption\fi
         \sbox{\@tempboxa}{\parbox[t]{\@tempdima}{#1}}%
         \caption{\usebox{\@tempboxa}}}

Using this macro, we can write

     \begin{figure}
     \vspace{?cm}
     \parcaption{This is a long caption\\ with line-break.}
     \end{figure}

to put line break within \parcaption{...}.

10.2 Want to place floats at specified place

Since they are float, it is not designed to put figures and tables at the place specified. However, one can ask L^{A}TEX to try the best by the following settings:

• Try to specify the position by the option as \begin{figure}[hbtp].

• Move the floats slightly backward.

• Relax the limits of floats. To do this, one must change parameters as topnumber etc.[4, 5] These parameters limit the number of floats in one page. In this document, we set

         \def\textfraction{.08}
         \def\topfraction{.9}
         \def\floatpagefraction{.99}
         \def\dbltopfraction{.9}
         \def\dblfloatpagefraction{.99}

to put many tables in one page.

• Or ‘here.sty’ (Yes, we have it.) may be used. With this style file, \begin{figure}{H} can be used as an option to force that figure HERE. But of course you must take care of the position of page break manually by yourself.

10.3 Put two figures side by side

Mr. Watanabe taught me how. It is simply possible if one uses the minipage environment.

     \begin{figure}
      \begin{minipage}[t]{.47\textwidth}
       \vspace{3cm} % Left Figure
       \caption{Figure in the left.}
      \end{minipage}
     \hfill
      \begin{minipage}[t]{.47\textwidth}
       \vspace{3cm} % Right Figure
       \caption{Figure in the right.}
      \end{minipage}
     \end{figure}

will is the solution. An example is shown in Fig. 1 (p. 13).

10.4 Paragraph wrapping figure and table

The minipage environment can handle this situation, but one must adjust many things by hands. A style file ‘wrapfig.sty’ (Yes, we have it.) does it semi-automatically. This file is modified to handle tables and it is named ‘wrapfloat.sty’^{67} . You usually need to give the width of figure or table, but sometimes you further need to specify its height. It is the case when ‘epsf.sty’ is used. Moreover you must take care of the position of page break by yourself.

Similar output can be obtained if ‘picinpar.sty’ (Yes, we have it.) is used. It is to open windows inside a paragraph.

And also ‘cut.sty’^{68} has almost the same function as ‘wrapfloat.sty’. There is a style file called ‘floatfig.sty’ (Yes, we have it.) , but it seems to have bugs. Samples in the original package cannot be compiled properly, but we do not know why.

Comparisons are made in Table 4.

Another one is ‘picins.sty’ which seems to be the best. The style file ‘picins.sty’^{69} defines a macro of \parpic to wrap floats at the beginning of paragraphs. One can use four kinds of frames.

67 ‘wrapfloat.sty’ is not installed here.

68 ‘cut.sty’ is not installed here.

69 ‘picins.sty’ is not installed here.

Table 4 Comparison of float-wrapping paragraph

         Function  ‘cut.sty’  ‘wrapfig.sty’  ‘picinpar.sty’

Width  Need spec  Need spec  Automatic but narrow
Lines  Need spec  Semi automatic  Automatic
Starting  Paragraph top  Top  Free
Location  Left/Right  L/R  L/R and Center
Table  Yes  Yes with ‘wrapfloat.sty’  Yes
Equation (centered)  Yes  Yes  Need $⋯$
Equation (left)  No number  No number  No number
New paragraph  Use \Par  Blank line works  Blank line but no indent
Usage of \verb  No  Yes  Yes

10.5 Tables longer than one page

There are a couple of style files. One is ‘supertab.sty’^{70} . Manual and samples are distributed with the style file. This can be used in twocolumn documents.

Another one has better controls of spacings than supertabular environment. It is ‘longtable.sty’ (Yes, we have it.) but cannot be used in twocolumn documents. The package also includes manuals and samples.

In the latter style file, the caption is set “Table 1:”. If you want to change this into expressions in other languages, you must re-define the following macros in preamble:

     \def\LT@c@ption[#1]#2{%
      \LT@mkcaption{{\bf Table \thetable:} #2}% <-----
      \def\@tempa{#1}\ifx\@tempa\empty\else
       {\let\\\space
        \addcontentsline{lot}{table}{\protect\numberline{\thetable}{#1}}}%
      \fi}
     \def\LT@@c@ption#1{%
      \LT@mkcaption{{\bf Table \thetable:} #1}% <-----
      {\let\\\space
       \addcontentsline{lot}{table}{\protect\numberline{\thetable}{#1}}}}

where \bf is added.

A style file called ‘bigtabular.sty’^{71} is the one for the same purpose.

10.6 Drawings within the limit of picture environment

10.6.1 Simple flow chart

Although picture environment has a lot of restrictions, simple charts may be drawn within such restrictions. A style file ‘smallgrf.sty’^{72} helps to draw simple flow charts with arrows.

10.6.2 Flow charts

It is difficult to draw them by hands within picture environment. A style file ‘Flow.sty’^{73} assists to draw flow charts. It supports while and if, but does not write flows with goto jumps. A sample is included in the original package of the style file. A style file ‘fchart.tex’^{74} helps writing somehow different flow charts.

Besides these style files, there exists a program to convert an input file in some format to a flow chart in picture environment of L^{A}TEX. The name is ‘flow’ written in C, so that it can be used on both UNIX and MS-DOS. One sample is given in Fig. 2 where \ is not used deliberately to avoid font replacement. Note that \verb may not be used.

70 ‘supertab.sty’ is not installed here.

71 ‘bigtabular.sty’ is not installed here.

72 ‘smallgrf.sty’ is not installed here.

73 ‘Flow.sty’ is not installed here.

74 ‘fchart.tex’ is not installed here.

Oval Documents by LaTeX Box Edit source files Tilt Compile by TeX Tag Choice . Yes . No Error in compilation Tag Left 1 Up 7 Right 1 * ToTag Down Box dvi file Tilt preview Choice . Yes No . Errors in logic and layout Tag Right Tilt Output in public Down Oval Output ToTag Left 1 Up 11 * ToTag Right SetTrack line Box LaTeX macros user’s macros SetTrack none Up 1 TxtPos [l] [l] Text documentstyle... title... author... date... begin... maketitle ..... Down 6 Text ¡- the most ¡- cumbersome ¡- here Down 3 Text ¡- need ¡- big display ¡- for clear ¡- preview

[figure: Documents by LaTeX; Edit source files; Compile by TeX; Error in compilation; Yes; No; dvi file; preview; Errors in logic and layout; Yes; No; Output in public; Output; LaTeX macros user’s macros; documentstyle... title... author... date... begin... maketitle .....; ← the most ← cumbersome ← here; ← need ← big display ← for clear ← preview]

Fig. 2 Source and output of flow chart

10.6.3 Draw tree diagrams

There are many kinds of tree diagrams. Vertical trees can be drawn by using a style file[8], which has the name of ‘ecltree.sty’ (Yes, we have it.) . An extended picture environment in ‘epic.sty’ is needed, and a better output may be obtained if your system supports ‘eepic.sty’.

Among samples in the original documents, an example is chosen in Fig. 3. The file ‘eepic.sty’ is not used here. Many other styles of tree diagrams can be drawn by this style file.

     \begin{bundle}{xxx}
     \chunk{aaa}
     \chunk{
             \begin{bundle}{yyy}
             \chunk{bbb}
             \chunk{ddd}
             \end{bundle}}
     \chunk{ccc}
     \end{bundle}

[figure: aaa; bbb; ddd; yyy; ccc; xxx]

Fig. 3 Tree using ‘ecltree.sty’

Table 5 Lines may be too close

Laplace transforms

f(t)  (p) no struts
δ(t) 1 optional arg.
cos ω_{0}t \frac{p}{p^{2}+ω_{0}^{2}}

Laplace transforms

f(t)  (p)  with struts
δ(t)  1  optional arg.
cos ω_{0}t \frac{p}{p^{2}+ω_{0}^{2}}

Horizontal trees can be drawn by the macros in ‘tree.sty’^{75} . Furthermore a tree to show subdirectory structures of file systems on UNIX can be drawn with a style file called ‘eclclass.sty’^{76} .

10.6.4 Draw bar-graphs

There is a nice style file to support it within L^{A}TEX’s framework. ‘bar.sty’ (Yes, we have it.) makes it easy to draw bar graphs. Although a manual is in the package, there are many features not written in the documents. Due to limit of L^{A}TEX, we cannot include a sample within this document. Please use a separate file ‘bargraph.tex’ for examples.

10.7 Change attribute of rules of tables

Thickness of rules can be specified by \arrayrulewidth. Change of attribute to dashed lines is suggested in the reference[8], in which a horizontal dashed line is defined.

A style file ‘arydshln.sty’^{77} can be used to draw vertical and horizontal dashed lines within tables. An example is shown in Section 8.4.1 (p. 19) .

10.8 Widen vertical spaces in tables

This is given in the article of TEX and TUG NEWS (Vol.2, No.3 July 1993 ‘ttn2n3.tex’), and the macro above is defined by Mr. Claudio Beccari (Politecnico di Torino, beccari@polito.it). Define

     \newcommand\setTBstruts{\def\T{\rule{0pt}{2.6ex}}%
                             \def\B{\rule[-1.2ex]{0pt}{0pt}}}

and declare \setTBstruts at certain place, and \T and \B broaden vertical spaces. The right one in Table 5 is an output of the followings:

     \begin{tabular}[t]{|c|c|l|}
        \hline
        \multicolumn{3}{|c|}{Laplace transforms\T\B}\\\hline
        $f(t)$       \T & $(p)$ \B      & with struts  \\\hline
        $\delta(t)$     & $1$    \T     & optional arg.\\[.5ex]
        $\cos\omega_0t$ & $\frac{p}{p^2+\omega_0^2\B}$ & \\\hline
     \end{tabular}

10.9 Align decimal points in tables

There is a solution within the framework of the default tabular environment but they may not be flexible. A style file ‘dectab.sty’^{78} does this job, but integer numerals lose decimal points in the output.

Another is a better one.

The style file is included in the package about tips on table-making by Mr. Mittelbach; so-called Mainz File. It is ‘dcolumn.sty’ .

Or ‘decalign.sty’^{79} may be used.

75 ‘tree.sty’ is not installed here.

76 ‘eclclass.sty’ is not installed here.

77 ‘arydshln.sty’ is not installed here.

78 ‘dectab.sty’ is not installed here.

79 ‘decalign.sty’ is not installed here.

10.10 Tables with their total width specified

The environment, \begin{tabular*}{12cm} is the originally prepared one in L^{A}TEX. But it usually needs a couple of @{\extracolsep{\fill}}’s to get desired horizontal alignment, and you need experience or trial and error to do it right.

A style file ‘tabularx.sty’ assists you to do the same thing more easily. It moreover can handle footnotes inside the environment, and a new specifier of width, X, for flexible adjustment.

10.11 Improvement of array and tabular environments

Modification and refinement of array environment has been carried out by ‘array.sty’ . It does something to do with spaces around vertical rules and at @{...}.

10.12 Diagonal line at the left-top corner of tables

Frequently the left-top corner of tables indicates meanings of row and column items with a diagonal line in the box. This kind of line is not supported within [L^{A}]TEX. However a style file ‘slashbox.sty’^{80} is designed for that purpose.

10.13 Subnumbering for floats

Similarly to those for equations in Section 8.1.1 (p. 17) , one may need subnumbering system for floats such as Fig. 1 (a). There is a style file ‘subfigure.sty’ (Yes, we have it.) for this purpose, but it is possible by a simple modification of \caption command as shown below. The next lines are also used in ‘subfloat.sty’^{81} , where several other sub-numberings are supported.

We here presume that the figure captions are located below the figures and that those for tables appear above the tables.

     \@definecounter{subfloatnumber}
     \def\@T@bLe{table}
     \def\subfloatcap{-\alph{subfloatnumber}}
     \def\subcaption{\@addtoreset{subfloatnumber}{\@captype}%
     \ifx\@captype\@T@bLe\relax\else\addtocounter{\@captype}{1}\fi%
     \def\the@subfloatnumber{\csname the\@captype\endcsname\subfloatcap}%
     \stepcounter{subfloatnumber}%
     \edef\@currentlabel{\csname the@subfloatnumber\endcsname}%
     \@dblarg{\@subcaption\@captype}}
     \long\def\@subcaption#1[#2]#3{\par\addcontentsline{\csname
       ext@#1\endcsname}{#1}{\protect\numberline{\csname
       the#1\endcsname\subfloatcap}{\ignorespaces #2}}\begingroup
         \@parboxrestore
         \normalsize
         \@makecaption{\csname fnum@#1\endcsname\subfloatcap}%
              {\ignorespaces #3}\par
         \endgroup%
          \ifx\@captype\@T@bLe\relax\else\addtocounter{\@captype}{-1}\fi}

Usage follows

     \begin{figure}
     ...
      \subcaption{...} \label{fig:thisone-1}
     ...
      \subcaption{...} \label{fig:thisone-2}
     \caption{Main Caption} \label{fig:thisone}
     \end{figure}

Examples are found in Fig. 1 (p. 13) and the table at Section 3.3 (p. 3) .

80 ‘slashbox.sty’ is not installed here.

81 ‘subfloat.sty’ is not installed here.

10.14 Photo environment

Tables and figures are put within the environments called ‘float’, so that they can move around in pages to fit writers’ needs. Photo environment can be defined similarly as

\newcounter{photo}
\def\thephoto{\@arabic\c@photo}
\def\fps@photo{tp}
\def\ftype@photo{4}
\def\ext@photo{lop}
\def\fnum@photo{\photoname \thephoto}
\def\photo{\@float{photo}}
\let\endphoto\end@float
\@namedef{photo*}{\@dblfloat{photo}}
\@namedef{endphoto*}{\end@dblfloat}
\def\photoname{Photo}

where \ftype@photo is set ‘4’ in the fourth line, because this number must be in the power of two. Then

\begin{photo}
...
\caption{This is a beautiful picture.}
\end{photo}

yields a caption as ‘Photo 5: This is ...’, and the list of photos are written in the file ‘\jobname.lop’. Therefore in report style,

\def\listofphotos{\@restonecolfalse
  \if@twocolumn\@restonecoltrue\onecolumn\fi
  \chapter*{\listphotoname\@mkboth{\uppercase{\listphotoname}}%
   {\uppercase{\listphotoname}}}\@starttoc{lop}\if@restonecol
  \twocolumn\fi}
\let\l@photo\l@figure

will help us to output the list of photos by the command as \listofphotos, but \listphotoname must be properly defined as

\def\listphotoname{List of Photos}

If you need to reset photo number every chapter in report style, one must define this new counter by

\newcounter{photo}[chapter]

or add one line as

\@addtoreset{photo}{chapter}.

A style file ‘float.sty’ (Yes, we have it.) helps us to define new floating environments easily. Photos in any format cannot be directly input by TEX, but can be handled depending on dviwares.

For example a dviware dviout/prt on Japanese MS-DOS can include monochrome gif and pbm files.

10.15 Input figures and pictures directly

Cut & paste of figures is the most cumbersome job in preparing reports or manuscripts. The original ‘picture environment’ in L^{A}TEX uses fonts for this special purpose and thus there exists strong limit in drawing lines, curves and circles. Neither arcs nor circles of arbitrary radii can be drawn in this environment. Therefore a simple figure such as simple maps can be depicted within a document, but complicated graphs cannot be included without cut & paste. In order to overcome these limits, macros and fonts are created for specific purposes of drawings, one of which may be called xypic.

Or if PICTEX is used, no further special fonts is necessary, but one must read in huge macro files so that one must use BigTEX instead of ordinary small TEX. Its manual is not free though.

Other methods depend on dvi-wares or devices, but can handle many flexible commands to draw complicated pieces of images. Here we enumerate a couple of methods to draw figures and pictures available in a wide range of environments.

10.15.1 Within limit of LATEX First, portable methods within the limit of L^{A}TEX are introduced.

1. Use of picture environment: If you do not mind drawing figures and pictures on section papers, you can use this environment. Or there are a couple of utilities to help you to input coordinates. Typical ones of such softwares are gnuplot^{82}, xfig^{83} and texdraw^{84}. Converted files are either directly included in the source file or read-in by \input.

2. Use of PICTEX : Usage is shown in the manual or can be imagined by reading pictex.tex. In the

preamble of your document, you must declare as follows:

\documentstyle{article}
\input{prepictex.tex}
\input{pictex.tex}
\input{postpictex.tex}
....

Pictures can be created, for example, by xfig or qfig etc.

3. Use of ‘bitmap.sty’ : Figures and photos input through scanners might be converted into a form of files called ‘X bitmap format (xbm)’. Then a style file called ‘bitmap.sty’ can be used to make an image within documents from that file. Of course complicated figures cannot be processed because of the capacity of TEX itself.

4. Use of ‘curves.sty’: Another style file called ‘curves.sty’ has similar features to those of PICTEX, but its macros are so lighter than those of PICTEX that it can be used even with small TEX.

[figure: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .; ^{..................................................................................}; ^{^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}}; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .; ^{^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}}; . . . . . . . . . . . . . . . . . . . . . . . . . .; . . . . . . . . . . . . . . . . . . . . . . . . . .; . . . . . . . . . . . . . . . . . . . . . . . . . .; ^{^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}}; . . . . . . . .; . . . . . . . .; . . . . . . . .; . . . . . . . .; . . . . . . . .; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .; ^{^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}}; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .; ^{^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}}; . . . . . . . . . . . . . . . . .; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .; ^{^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}}; ^{^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}}; ^{^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}}; ^{^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}}; . . . . . . . . . . . . . . . . . . .; ^{^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}}; ^{^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}}; ^{^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}}; ^{^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}^{.}}; . . . . . . . . . . . . . . . . . . .; . . . . . . . . . . . . . . . . . . .; . . . . . . . . . . . . . . . . . . .]

Fig. 4 Example using curves.sty and qfig 1. Use of PostScript: If you have a PostScript printer or are able to use GhostScript, figures

5. Use of METAFONT: It is also possible to consider one figure as a special font and to make it by

METAFONT. A style file called ‘drawing.tex’^{85} can be used for that purpose.

10.15.2 Driver-dependent methods Functions of device drivers or printer can be used to draw figures. Namely a drawing command of the printer is set by a \special and the dvi-ware passes it directly into the printer. A typical example is to use PostScript^{86} printers.

82 There are those on both UNIX and MS-DOS.

83 Another program transfig is necessary to convert figures into TEX files.

84 It operates only on UNIX.

85 ‘drawing.tex’ is not installed here.

86 PostScript is a trade mark of Adobe Systems Inc.

and pictures created by so many utilities can be included in the documents. Either ‘epsf.sty’ or ‘epsbox.sty’ is used. The former is for NTT JTEX, while the latter is used in ASCII Nihongo TEX. However the file to be input into L^{A}TEX must be in the form of EPSF (Encapsulated PostScript File).^{87} There exist many free softs to create PostScript files;e.g. gnuplot, xfig, idraw and tgif+. Typical usage of ‘epsf.sty’ (Yes, we have it.) is like the followings:

         \epsfile{file=image.ps,scale=0.5}

2. Use of TPIC codes: This code is supported by many dvi-wares. One method is to write a figure directly by the TPIC codes in \special. Or using ‘epic.sty’ and ‘eepic.sty’, you can draw figures a bit more easily than using TPIC directly. xfig and qfig^{88} can be used to draw lines and curves.

As for usage of ‘epic.sty’ and ‘eepic.sty’ , one must be careful to declare these options as

     \documentstyle[epic,eepic,...]{j-article}

and your dvi-ware must recognize TPIC codes. If your driver does not understand it, you may use its emulation by replacing ‘eepic.sty’ by ‘eepicemu.sty’ or ‘ecleepic.sty’ . It takes time to compile and it loses some of the features, but the output is portable in any environments.

Since there exist both ‘epic.sty’ and ‘eepic.sty’, an example of a Japanese software called Ngraph and a picture created by qfig are shown in Fig. 5. If you see any lines and curves there, your dvi-ware can handle TPIC codes.

−2  2 0 20 40  _{5−Polynomial Fit}_{Trigonometrical Fit}_{masked error bar} L_{EAST} S_{QUARE} F_{IT}

Fig. 5 Examples of Ngraph and qfig with eepic.sty

10.16 Too many unprocessed floats

In compilation, floats in several pages are saved within memory, so that sometimes TEX complains with warning message of memory shortage. In order to circumvent this situation, floats may be forced to settle in the desired page by a command \clearpage, although it is in general difficult. Another method is to use ‘morefloats.sty’^{89} to enlarge the limit.

87

It can be checked by looking for a line as %%BoundingBox:... at the top of the file. If it is not, a utility called bbfig

may be used to convert it into EPSF format.

88

qfig is originally created on a Japanese MS-DOS, but recently it is converted so that it can be used on IBM PC’s.

The former supports output for curves.sty.

89 ‘morefloats.sty’ is not installed here.

TEX in the Box

11.1 Put a paragraph into a box

\fbox can put a minipage environment into a box, but within it verbatim environment cannot be used. One style file to do it is called ‘boxit.sty’^{90} , as long as the box is within a page. A box which can span multiple pages can be achieved by a method explained in Section 11.8 (p. 37) .

It should also be noted that a minipage environment has no indent at the beginning of paragraphs, so that one must specify \parindent in the environment.

11.2 A box surrounding a minipage environment

The minipage environment is often used to show samples and usage of L^{A}TEX commands. One may want to use a frame for samples.

‘boxedminipage.sty’ will allow to use \verb within a frame. Change the name of environment from

minipage to boxedminipage.

This is an ordinary minipage environment. One can use \verb, but cannot use \fbox to frame it. A box to the right hand side shows boxedminipage environment and one can use verbatim environment within it.

A verbatim environment in the frame becomes

                                                \begin{boxedminipage}{.45\textwidth}
                                                ...
                                                \end{boxedminipage}

which is usage of boxedminipage.

11.3 Strings in oval box

\fbox outputs a rectangular box, but ‘loval.sty’^{91} can be used to use an oval box. The author of this style file created another style file called ‘oval.sty’ , but one needs to make new circle fonts by

Metafont.

Note that ‘fancybox.sty’ in Section 11.9 (p. 37) seems better than this file.

11.4 A box with title

One may need a title for each box. One article on Network News (comp.text.tex) is originally designed for plain TEX but can be used in L^{A}TEX documents. I put the macro into a file called ‘tboxit.sty’^{92} which is not named by the creator.

11.5 Floats (Figs and Tables) in a box

In addition to enough space surrounding floats, one may also want a frame around it ‘bigbox.sty’^{93} does it. A portion within a float enclosed between \begin{bigbox} and \end{bigbox} is framed.

11.6 A box with shadow

In order to emphasize a word on OHP screen, for example, a box with shadow may be effective. ‘shadow.sty’ is a style file for it.

90 ‘boxit.sty’ is not installed here.

91 ‘loval.sty’ is not installed here.

92 ‘tboxit.sty’ is not installed here.

93 ‘bigbox.sty’ is not installed here.

Line thickness and width of shadow are controlled by three parameters A content in \shabox{...} will be framed. Default values for each parameter are shown to the right. The shadow-frame to the right is obtained from

  \shabox{\shortstack[l]{%
   This is the first line \\
      then the \verb+\string\second+ \\
    Finally the last one }}

where care must be needed for \verb.

                                                                \sboxsep = 10pt
                                                                \sdim = 4pt
                                                                \sboxrule = .4pt

Note that ‘fancybox.sty’ in Section 11.9 (p. 37) seems better.

11.7 Shading strings

Usually one needs a special command that depends on printer or driver to be used. But ‘shadebox.sty’^{94} can be used in the ordinary environment. I am not sure but it may be using many dots within a box of string.

11.8 Framed paragraphs that spans several pages

A short column article in textbooks may be inside a frame, but a page break may occur in the middle. ‘eclbkbox.sty’^{95} by Mr. Isozaki helps to do so. As an option, line number may be put outside the frame. Examples are also included in the original archive file. The portion in breakbox environment is framed and can span several pages. Line number is controlled by \bkcounttrue and \bkcountfalse.

11.9 Framing a page or list environment

Page framing is not an original feature of L^{A}TEX, and one must change the output routine. A style file called ‘pageframe.sty’^{96} put crop-marks or grid in pages. As for crop-marks, ‘cropmark.sty’^{97} can be used.

On the other hand, ‘fancybox.sty’ does excellent jobs for these purposes. This file is included in ‘seminar.sty’ to make transparencies for OHP, but can be obtained separately from many ftp servers. It also supports framing of list and verbatim environments.

For example,

  \doublebox{\begin{minipage}{.25\textwidth}
  \begin{Bitemize}
  \item \shadowsize=2pt\shadowbox{First item}
  \item \cornersize{.2}\ovalbox{Second one}
  \item \Ovalbox{The last one}
  \end{Bitemize}
  \end{minipage}}

• First item

•

[figure]

Second one

•

[figure]

The last one

Index page at the end of this document is created by

     \fancypage{\fboxsep=2em\cornersize{2}\ovalbox}{}

Bibliography and Index

12.1 Referring bibliography by ^{1),2)}

One can get it by modifying definition of \@cite. The original definition is given by

94 ‘shadebox.sty’ is not installed here.

95 ‘eclbkbox.sty’ is not installed here.

96 ‘pageframe.sty’ is not installed here.

97 ‘cropmark.sty’ is not installed here.

     \def\@cite#1#2{[{#1\if@tempswa , #2\fi}]}

and modification as

     \def\@cite#1#2{$^{\mbox{\scriptsize {#1\if@tempswa , #2\fi})}}$}

will change it into the desired form. Or a style file ‘overcite.sty’ (Yes, we have it.) may be used.

12.2 Modification of bibliography list

A method is to modify thebibliography environment. In the definition of \def\thebibliography, one may change the following under-lined parts

      {\refname}{\refname}}\list
      {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
     % ^^^^^^^^^^^^^^^^^^^^
      \advance\leftmargin\labelsep

into

      {(\arabic{enumi})}{\settowidth\labelwidth{(#1)}\leftmargin\labelwidth

to change list numbering from [1] to (1). The latest version of L^{A}TEX209 as of (Mar. 20, 1992), a file ‘article.sty’ has a definition of \@biblabel, so that the change as

     \def\@biblabel#1{(#1)}

will do the same. Also enumiv is used in place of enumi at the definition of \thebibliography in the latest version of L^{A}TEX209.

12.3 Sorting cite labels

When one cites a few references like \cite{rakuraku,koho,jlamport,isozaki,total} in this docu-

ment, it becomes [4, 2, 5, 8, 6]. One may need to change it into [2,4-6,8] after sorting. ‘cite.sty’ is for this purpose. The same citing as above becomes [4, 2, 5, 8, 6].

12.4 Bibliography listings for each chapter

You may need this kind of list of references in a book with many authors. For this purpose there is a style file called ‘chapterbib.sty’ (Yes, we have it.) . Or ‘bibunits.sty’ (Yes, we have it.) does similar things. But the name of temporary files cannot be used on MS-DOS so that a slight modification is needed.

Moreover ‘bibperinclude.sty’^{98} is for files with \include.

12.5 Chicago style bibliography

There is a famous book about writings called ‘Chicago Manual of Style’. ‘chicago.sty’ (Yes, we have it.) and ‘chicago.bst’ for BibTEX are to be used for that purpose. Current version is based on the 13th Edition of the book.

12.6 Index for each section

‘index.sty’ (Yes, we have it.) will do it.

98 ‘bibperinclude.sty’ is not installed here.

Other Useful Macros

13.1 Date and week

There seem to exist many style files among which a file ‘ukdate.sty’^{99} changes the definition of \today into one of English style. A week can be output by \dayofweek. Weeks can be also obtained by ‘weekday.sty’^{100} . In addition, ‘austdate.sty’^{101} assists you to have an Australian expression of the date .

13.2 Time of compilation

L^{A}TEX originally remembers the time of starting of compilation in \time, so that one needs a simple manipulation to extract ‘hour’ and ‘minute. To this end, one may use a macro like

     % \mod<counter><value> : <counter>=<counter> % <value>
     \def\mod#1#2{
       \count255=#1 \divide\count255 by #2   % <register> = <counter> / <value>
       \multiply\count255 by #2              % <register> *= <value>
       \advance\count255 by -#1              % <register> -= <counter>
       #1=-\count255}                        % <counter> = -<register>
     \newcount\hour
     \hour=\time \divide\hour by 60          % <time> = <\time> / 60
     \newcount\minute
     \minute=\time \mod{\minute}{60}         % <minute> = <\time> % 60

to use \the\hour and \the\minute (now is 15:15).

Such style files are ‘daytime.sty’^{102} , and ‘time.sty’^{103} is another one. I like ‘mickeytime.sty’^{104} .

13.3 Put key words in the footnote

For example, a simple macro like[5]

     \def\keyword#1#2{\def\@thefnmark{}\@footnotetext{{\bf #1}: #2}}

will do it. \keyword{KEY WORD}{EXPLANATION} will output a footnote like the one in this page.

13.4 Ordinal numbers

Just like the one in date command in Section 13.1 (p. 39) , one may need to use ordinal numbers like 1st and 2nd. Mr. Donald Arseneau posted one in comp.text.tex and it is saved as a style file in our ftp server. The file is named ‘ordinalno.sty’^{105} .

13.5 Put a comma every thousands

As is often used in expression for money or price, one puts a comma every 10^{3}. A style file called ‘sumofmoney.sty’^{106} is not named by the creator, but it can be used for that purpose. Another file

is ‘numbersty.sty’^{107} .

99 ‘ukdate.sty’ is not installed here.

100 ‘weekday.sty’ is not installed here.

101 ‘austdate.sty’ is not installed here.

102 ‘daytime.sty’ is not installed here.

103 ‘time.sty’ is not installed here.

104 ‘mickeytime.sty’ is not installed here.

KEY WORD: This is an example to use \keyword.

105 ‘ordinalno.sty’ is not installed here.

106 ‘sumofmoney.sty’ is not installed here.

107 ‘numbersty.sty’ is not installed here.

13.6 Want to write music

There is a package called MusicTEX . Originally it has been developed within plain TEX, but recent version supports L^{A}TEX and includes style files. Metafont sources for musical notes are also distributed within this package. A manual says all and there is a Japanese version of the manual, too.

13.7 Two pages side by side

It is possible to use a copy machine with 50% reduction in length, but it is very difficult to make them in the right order for both side binding. This kind of manipulation in page arrangement can be easily done by using a style file called ‘2up.sty’ (Yes, we have it.) . A good document is included in the package, and it can be used independently of peripherical devices. In the preamble of the document, declarations like

     \target{\magstep0}{2.1\textwidth}{\textheight}
     \source{\magstep0}{\textwidth}{\textheight}
     \targetlayout{twosided}

do it all.

13.8 Transparencies for OHP

One method is to use a copy machine with enlarging feature. Another is to use SliTEX, but you may lose many L^{A}TEX commands. One may want to use L^{A}TEX with large fonts to create transparencies. A style file ‘eslides.sty’^{108} may be one of the simplest style files. Font enlargement is defined by \magnification, but one must specify that magnification rate directly to the driver for the screen and printer. If the driver has the same notation of magnification as that of TEX, then Table 6 will help the switch for the driver to be used.

Table 6 Magnification and switches with ‘eslides.sty’

         \magnification 1000  1095  1200 1440 1728 2074 2488 dviware         -mag0  -maghalf  -mag1  -mag2  -mag3  -mag4  -mag5

   Set \pagestyle to be myslide, and
     \begin{slide}
      ...... for one transparency
     \end{slide}
     \begin{remark}
       ...... comment and memo for that sheet
     \end{remark}

will output a desired page, where a slide environment is centered in both vertical and horizontal directions. Page number is put at the left-bottom corner of the page. If you begin a remark environment immediately after the end of slide environment, it becomes a brief note for speakers and it has no page number. Moreover \logo put a logo at the left-bottom corner of the page, while redefinition of \conference shows the name of conference at the center-bottom.

On the other hand, ‘seminar.sty’ (Yes, we have it.) has many other features and is designed quite neatly. It can be used with AMS-L^{A}TEX, too. But every time I have to make an OHP sheet, I give up reading the manual in the middle, because it is not written in Japanese. So I am not using it.

There is a style file called ‘lslide.sty’ (Yes, we have it.) , but I have never used it, either.

13.9 Make a poster

Unlike many drawing tools or WYSIWYG editors, it is usually difficult to make a poster in TEX. But ‘poster.tex’ (Yes, we have it.) is an excellent macro to convert ordinary documents into posters. It enlarges the entire page and splits it into a few pages with crop-marks at four corners. Once you get such pages, you simply cut along the crop-marks (not all of them, of course), and paste them to make a big sheet of poster. It is not pain at all to convert a page into proper numbers of papers, but it is a bit cumbersome to cut and paste them crawling on the floor.

108 ‘eslides.sty’ is not installed here.

13.10 Need to select pages to be output

If your dviware does not have a feature to output individual pages separately, it is necessary to have appropriate pages in the ‘.dvi’ file. For this purpose, ‘selectp.sty’ (Yes, we have it.) can be used.

\outputonly{1,3, 1 2-5}

specifies the pages to be output. In this example, the first and third pages of the table of contents and the first and second through fifth pages are written into the ‘.dvi’ file. Usage is written in the comment lines of the file.

Fonts

14.1 Available fonts

Possibly either ‘fntbl.tex’ or ‘testfont.tex’ is installed, and

prompt > tex fntbl □^{↩}

will output font tables interactively. Or the following lines can be compiled by the plain TEX. Usually fonts shown in Table 7 are prepared and can be used by request.

\def\fox{A quick brown fox jumps over the lazy dog.\par}
\def\sampleof#1{\font\fontA=#1 \rm #1:\quad\fontA \fox}
\sampleof{cmb10}        % Computer Modern Bold Roman
\sampleof{cmbsy10}      % Computer Modern Bold Math Symbols
\sampleof{cmbx10}       % Computer Modern Bold Extended Roman
\sampleof{cmbxsl10}     % Computer Modern Bold Extended Slanted Roman
\sampleof{cmbxti10}     % Computer Modern Bold Extended Text Italic
\sampleof{cmcsc10}      % Computer Modern Roman Caps and Small Caps
\sampleof{cmdunh10}     % Computer Modern Dunhill Roman
\sampleof{cmex10}       % Computer Modern Math Extension
\sampleof{cmff10}       % Computer Modern Funny Roman
\sampleof{cmfi10}       % Computer Modern Funny Italic
\sampleof{cmitt10}      % Computer Modern Italic Typewrite Text
\sampleof{cmmi10}       % Computer Modern Italic Math Italic
\sampleof{cmmib10}      % Computer Modern Math Italic Bold
\sampleof{cmr10}        % Computer Modern Roman
\sampleof{cmsa10}       %
\sampleof{cmsl10}       % Computer Modern Slanted Roman
\sampleof{cmsltt10}     % Computer Modern Slanted Typewriter Text
\sampleof{cmss10}       % Computer Modern Sans Serif
\sampleof{cmssbx10}     % Computer Modern Sans Serif Bold Extended
\sampleof{cmssdc10}     % Computer Modern Sans Serif Demibold Condensed
\sampleof{cmssi10}      % Computer Modern Slanted Sans Serif
\sampleof{cmsy10}       % Computer Modern Math Symbols
\sampleof{cmtcsc10}     % Computer Modern Typewrite Caps ans Small Caps
\sampleof{cmtex10}      % Computer Modern TeX extended ASCII characters
\sampleof{cmti10}       % Computer Modern Text Italic
\sampleof{cmtt10}       % Computer Modern Typewriter Text
\sampleof{cmu10}        % Computer Modern Unslanted Italic
\sampleof{cmvtt10}      % Computer Modern Variable-Width Typewriter Text
\bye

Table 7 Standard fonts sample on TEX

font  Sample  Description
cmr10  A quick brown fox jumps over the lazy dog.  Roman : \rm
cmti10  A quick brown fox jumps over the lazy dog.  Italic : \it
cmcsc10 A quick brown fox jumps over the lazy dog. Small Caps : \sc
cmsl10  A quick brown fox jumps over the lazy dog.  Slanted : \sl

cmtt10    A quick brown fox jumps over the lazy dog.  Typewriter : \tt

cmbx10  A quick brown fox jumps over the lazy dog.  Boldface : \bf
cmss10  A quick brown fox jumps over the lazy dog.  Sans Serif : \sf
cmbxsl10 A quick brown fox jumps over the lazy dog.  Boldface Slanted
cmbxti10 A quick brown fox jumps over the lazy dog.  Boldface Italic
cmssbx10 A quick brown fox jumps over the lazy dog.  Boldface Sans Serif
cmssi10 A quick brown fox jumps over the lazy dog.  Italic Sans Serif
cmu10 A quick brown fox jumps over the lazy dog. Unslanted Italic
cmssdc10 A quick brown fox jumps over the lazy dog.  S S Demibold Condensed

cmitt10   A quick brown fox jumps over the lazy dog.  Italic Typewriter
cmsltt10  A quick brown fox jumps over the lazy dog.  Slanted Typewriter
cmtcsc10  A quick brown fox jumps over the lazy dog.  Typewriter Small Caps

cmvtt10 A quick brown fox jumps over the lazy dog.  Variable-Width Typewriter
cmtex10  TEX Extended ASCII Char
cmdunh10 A quick brown fox jumps over the lazy dog.  Dunhill

cminch  1-Inch-High Char
cmfi10  A quick brown fox jumps over the lazy dog.  Funny Italic
cmff10  A quick brown fox jumps over the lazy dog.  Funny Roman
cmmi10  Aquickbrownfoxjumpsoverthelazydog  Math Italic
cmmib10 Aquickbrownfoxjumpsoverthelazydog  Math Italic Boldface
cmsy10 ABCDEFGHIJKLMNOPQRSTUVWXYZ Math Symbol
cmbsy10 ABCDEFGHIJKLMNOPQRSTUVWXYZ  Boldface Math Symbol

14.2 Want to use fonts not loaded

Fonts which are not pre-loaded can be used if you define their font names by a command \newfont[5]. For example boldface italic (cmbxti10) fonts in the size of 12pt can be used if you declare

 \newfont{\bolditalic}{cmbxti10 scaled \magstep1}

in the preamble. However it enables you to use this font in a fixed size, so that the size change by \Large etc. does not affect this font. A method to use different sizes in a document can be found in a reference[8], but there exists a style file for that. For example ‘bsf.sty’^{109} defines a boldface Sans-Serif fonts into one font family. Then arbitrary size change becomes possible as

 \documentstyle[bsf]{article}
 ...
 This is normal. {\Large\bsf Bold Sans Serif font} Again normal

Similarly ‘bsl.sty’^{110} defines a boldface slanted font family, ‘isf.sty’^{111} is for italic Sans-Serif font. On the other hand, ‘slem.sty’ (Yes, we have it.) changes \em into \sl.

109 ‘bsf.sty’ is not installed here.

110 ‘bsl.sty’ is not installed here.

111 ‘isf.sty’ is not installed here.

Table 8 Non-standard fonts

font  Sample  Description
manfnt  manual font
callig15 � ����� ����� ��� ����� ���� ��� ���� ���� Calligraphy
yfrak  ��������� ������������ ��� ��� ��������� ��� ��� Fraktur
ysmfrak (Not Available)  Fraktur
ygoth  ��������� ����������� �� �� ��������� �� ���Gothisch
yswab  ��������� ������������ ��� ��� ��������� ��� ��� Schwabacher

yinit  �����  Initials

14.3 New character without Metafont

Funny symbols or Chinese characters is to be made by Metafont, but can be created as bit map images. A style file ‘sprite.sty’^{112} is used to define arbitrary symbols by defining bit map patterns.

14.4 Use of non-standard fonts

14.4.1 Manual fonts of TEX

Fonts used in TEXBook[9] are defined in a package called manfnt. A few samples are shown in Table 8.

14.4.2 Calligraphic characters

An example is shown in Table 8. Just like the style file in Section 14.2 (p. 42) , ‘calligra.sty’^{113} enables us to use it in different size.

14.4.3 Old-german fonts

There is such a font called ‘old-german’. Samples are also shown in Table 8. You should read manual especially to output umlaut and ligature.

14.5 Symbol tables

There are a few symbol tables for L^{A}TEX and/or AMS-TEX. ‘symbols.tex’^{114} outputs such a table including AMS-TEX if it is installed. Also ‘latexsymbols.tex’^{115} may be useful for further information in Japan. Standard tables are given at the end of this document.

14.6 Creating undefined symbols

14.6.1 Mathematics

Here we show only a method to define characters within the limit of L^{A}TEX.

112 ‘sprite.sty’ is not installed here.

113 ‘calligra.sty’ is not installed here.

114 ‘symbols.tex’ is not installed here.

115 ‘latexsymbols.tex’ is not installed here.

··· by Mr. Watanabe { \def\therefore{\setbox0 \hbox{$\cdot$} \raise-0.2em \copy0 \raise0.2em \copy0 \raise-0.2em \box0 ~}

··· by Mr. Watanabe { \def\because{\setbox0\hbox{$\cdot$} \raise0.2em \copy0 \raise-0.2em \copy0 \raise0.2em \box0 ~}

□^{↩} This is made of $\Box$ and $\hookleftarrow$, but you can find much more sophisticated ones in ‘ascmac.sty’ and a reference[7].

To use " for “ and ”, a style file ‘quote.sty’^{116} can be used. Each pair of " will result in a pair of double quotation marks. In a portion between \begindoublequotes and \enddoublequotes, it is activated.

14.6.2 Encircled numerals

A method is given in a reference[8]. Here we shown another one using ‘overwriting’ by Mr. Watanabe.

     \def\MARU#1{\leavevmode\setbox0\hbox{$\bigcirc$}%
                 \copy0\kern-\wd0 \hbox to\wd0{\hfil{\scriptsize#1}\hfil}}

will convert \MARU{3} etc. into ◯ 3 and ◯ 84.

14.6.3 ˚ C and = Y

Japanese currency mark = Y is also defined by the overwriting method as

    = Y    \def\yen{{\leavevmode\tt\rlap=Y}}
    Y =    \newlength{\Ywidth}
         \def\yen{\mbox{\tt\settowidth{\Ywidth}{Y}Y\hspace{-\Ywidth}=}}

Unit for temperature ˚ C can be obtained by

    ˚ C \newcommand{\DegC}{\char'27 C}
    ˚ C \newcommand{\DegC}{\char'27\kern-.3em\hbox{C}}

\circ may be used in place of \char'27 which might be found in references.

14.6.4 Smiley

I found it in TEX and TUG NEWS (Vol.1, No.4 Nov 1992 ‘ttn1n4.tex’). It is created by Mr. Peter Flynn (University College Cork, cbts8001@iruccvax.ucc.ie), but we modified it so that one can use it many times in a document.

     \typeout{Smiley by Peter Flynn (cbts8001@iruccvax.ucc.ie)}
     \font\tmi@grin=cmmi7
     \font\tsy@grin=cmsy5
     \font\bsy@grin=cmsy10 scaled\magstep4
     \newsavebox{\sbox@grin}
     \savebox{\sbox@grin}{\vbox{\hsize=1pc\baselineskip=5pt
                        \centerline{{\tsy@grin\char'014\ \char'014}}
                        \centerline{{\tsy@grin\char'064}}\vskip-1pt
                        \centerline{{\tmi@grin\char'136}}}}
     \newsavebox{\bbox@grin}
     \savebox{\bbox@grin}{\hbox{{\bsy@grin\char'015}}}
     \def\grin{\hbox{\usebox\bbox@grin\kern-5.75mm\usebox\sbox@grin%
               \kern-\wd\sbox@grin\kern5.75mm}}

\grin will output ◯^{⊙⊙ ; △ ; ⌣} , where horizontal positioning is not precise.

116 ‘quote.sty’ is not installed here.

14.7 Logo symbols

An ‘a’ in L^{A}TEX logo uses \sc with other characters in \rm. So that no bold-face nor italic logo exists. There seem to exist many methods to improve it in Network News, but ‘ttn2n1.sty’ (Yes, we have it.) defines one of such logos which are used within this document.

Other logos are also defined there but there exists another style file ‘texnames.sty’ (Yes, we have it.) for the same purpose.

Other Things on TEX Programming

15.1 Interactive input through keyboard

You may want to choose compilation conditions or to input a string interactively while compilation. A command \typein does this[5]. For example, one can choose whether the final output of ‘dvi’ file is needed or not. A sequence like

     \typein[\answer]{Do you need dvi output? (y or n) }
     \if\answer y
      \typeout{Normal operation with output}
     \else
      \typeout{OK! No output} \output={\setbox0=\box255\deadcycles=0}
     \fi

controls such output by selecting Yes or No during compilation. Or one can show a menu for multiple choice. It can be possible to use ‘fillform.tex’^{117}explained in Section 3.9 (p. 6) .

15.2 Macros with option

If you need to use an option with a pair of bracket “[...]”, a conditional choice with \@ifnextchar can be used. Usage is like the following:

     \def\foo{\@ifnextchar [{\@foo}{\@@foo}}
      \def\@foo[#1]#2{.....}   % with option [...]
      \def\@@foo#1{.....}      % w/o  option

Or, if there is a default for this option in [..], say length 2em is such a default, you may specify it as

     \def\foo{\@ifnextchar [{\@foo}{\@foo[2em]}}
      \def\@foo[#1]#2{.....}           % ^^^^^= default

If you need to put such options in {..}, \bgroup must be used, because { cannot be used as a character within the macro[8].

Or one may use * to control such choices. In such a case, one may use a command \@ifstar{yes}{no}.

     \def\foo{\@ifstar{\@foostar}{\@foonostar}}

can give different definitions for \foo{...} and \foo*{...}.

15.3 Choice by if

One may need to put different paragraphs between the final manuscripts and drafts. In such a case, a declaration as

     \newif\ifdraft

enables us to use controls by setting this if-flag \draft to either true or false.

117 ‘fillform.tex’ is not installed here.

     \documentstyle{article}
     \newif\ifdraft          % newly define \ifdraft
     \drafttrue              % Now draft mode ON!!!
     \begin{document}
     ....
     \ifdraft
             ...             % operation when draft mode is ON
     \else
             ...             % operation at the final manuscript
     \fi
     ...

This example shows an usage.

15.4 Modification of \@tfor

The loop by \@tfor simply outputs listings of arguments delimited by commas in that order. However in English documents, one may need ‘and’ in place of comma right before the last item;e.g. we need a feature so that a command \fignos{2,5,6,9} outputs Figs. 2, 5, 6 and 9. Mr. Watanabe made one for me in preparing a style file for the Japan Society of Civil Engineers’ Journals. It is defined as follows:

     \def\andfor#1{\@ffor\@ndfora:=#1\do{\@ndfora}}
     \def\@ffor#1:=#2\do#3{\def\@fortmp{#2}\ifx\@fortmp\@empty \else
       \expandafter\@fforloop#2,\@nil\@@#1{#3}\fi}
     \def\@fforloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil \else
       \ifx #2\@nil{#4}\else
       {#4}\@ifforloop #2\@@#3{#4}\fi\fi}
     \def\@ifforloop#1,#2\@@#3#4{\def#3{#1}\ifx #2\@nil
       {\ and\ {\ignorespaces #4}}\let\@nextwhile=\@fornoop \else
       {,\ {\ignorespaces #4}}\let\@nextwhile=\@ifforloop\fi
       \@nextwhile#2\@@#3{#4}}

Then \andfor{apple, banana, orange} will become ‘apple, banana and orange’. But it may need large memory when one puts \ref’s in the arguement.

Epilogue

16.1 Where are style files?

Usually environment variable TEXINPUTS holds the name of directories for macros and style files for TEX. On emTEX this may be TEXINPUT. If on UNIX you want to add your own directory of style files;e.g.

HOME/tex/inputs can be added by
     setenv TEXINPUTS ".:$HOME/tex/inputs:/usr/local/lib/tex/inputs"

where the second directory is commonly used as a default. Most style files are located in these directories.

Therefore, if you want to change something in the public files to make your own private style files, you must copy those into your own directory to edit them. Since especially on UNIX those public files are shared with others, you should not touch them directly.

16.2 Samples to use style files

Many style files show its usage in comment lines or include sample files after the line of \endinput. Some use features of ‘docstrip.tex’ (Yes, we have it.) in the very first MZ0 package of the famous Mainz files. It is used to extract style files as well as document files and/or samples.

[figure]

Table 9 Greek Letters (Math Mode)

    α \alpha  β \beta  γ \gamma δ \delta ϵ \epsilon ζ \zeta
    η \eta  θ \theta  ι \iota κ \kappa λ \lambda  μ \mu
    ν \nu  ξ \xi  π \pi  ρ \rho  σ \sigma  τ \tau
    υ \upsilon  ϕ \phi  χ \chi  ψ \psi  ω \omega
    ε \varepsilon ϑ \vartheta ϖ \varpi ϱ \varrho ς \varsigma φ \varphi
    Γ \Gamma  Δ \Delta  Θ \Theta Λ \Lambda Ξ \Xi  Π \Pi
    Σ \Sigma  Υ \Upsilon Φ \Phi  Ψ \Psi  Ω \Omega

16.3 Finally

We guess that L^{A}TEX is originally designed to use TEX easily but in somehow formatted page styles. So many style files are then created to modify or broaden the original features of L^{A}TEX, and are enumerated in this document with samples. Choices of files introduced here are made accordingly to the first author’s taste and needs.

This spring a new version, L^{A}TEX2ϵ, has been released, and many style files are converted for this new system. Or some of them might be included in the new L^{A}TEX itself.

REFERENCES

[1] Leslie Lamport, L^{A}TEX —A Document Preparation System, Addison-Wesley Publishing Co., 1986.

[2] Otabe and Nawata, Modification of style files of L^{A}TEX — Tune-up of family sedan —, Kyushu-Univ. Computer Center News, 1989 (in Japanese).

[3] Ohno, Introduction to TEX, Kyoritsu Pub. Co. 1989 (in Japanese).

[4] Nodera, Easy going with L^{A}TEX, Kyoritsu Pub. Co. 1990, 2nd ed. 1994 (in Japanese).

[5] Eds. Cooke, Kurasawa, L^{A}TEX[1], Ohno, Kogure and Fujiura, ASCII Pub., 1990 (Japanese translation).

[6] Ito, Total guide for L^{A}TEX, Shuwa-system trading, 1991 (in Japanese).

[7] Okumura, Introduction of document making by L^{A}TEX — document layout on personal computer —, Gijutu hyouron Pub. Co. 1991 (in Japanese).

[8] Isozaki, Pleasure with L^{A}TEX, Computer Today Library Vol.5. Science Pub. Co. 1992 (in Japanese).

[9] Donald E. Knuth, The TEXbook, Addison-Wesley Publishing Co., 1984.

[10] Ed. Saito, TEXBook[9], Sagitani, ASCII Pub., 1989 (Japanese translation).

Note: Translation of Japanese authors’ names in this list above may be wrong, and titles of Japanese books are not original but are loosely translated by the first author of this article.

[figure]

Table 10 Symbols in Math Mode

ℓ \ell  ℜ \Re  ℑ \Im  ∂ \partial ∞ \infty ′ \prime
∅ \emptyset ∇ \nabla   ^{}\angle △ \triangle ∀ \forall ∃ \exists
ℵ \aleph  h̄ \hbar ı \imath ȷ \jmath  ℘ \wp  ℧ \mho
√ \surd  ⊤ \top  ⊥ \bot  ∥ \|  ¬ \neg  ♭ \flat
♮ \natural ♯ \sharp □ \Box  ◇ \Diamond \ \backslash
♣ \clubsuit  ♢ \diamondsuit  ♡ \heartsuit  ♠ \spadesuit

Table 11 Binary Operation Symbols (Math Mode)

± \pm  ∓ \mp  × \times ∗  \ast  •  \bullet ÷ \div
⋆ \star  ∘ \circ  · \cdot · · · \cdots  ... \ddots    ⋮  \vdots
∩ \cap  ∪ \cup  ⊕ \oplus ⊖ \ominus  ⊗ \otimes ⊙ \odot
⊎ \uplus ⊓ \sqcap  ⊔ \sqcup \  \setminus ≀  \wr  ⋄ \diamond
< \lhd  > \rhd  ≤ \unlhd ≥ \unrhd  ⊘ \oslash ◯ \bigcirc
† \dagger ‡ \ddagger ⨿ \amalg  △ \bigtriangleup
◁ \triangleleft  ▷ \triangleright  ▽ \bigtriangledown

Table 12 Relation Symbols (Math Mode)

≤ \leq  ≥ \geq  ≪ \ll  ≫ \gg  ∨ \vee  ∧ \wedge
⊂ \subset  ⊃ \supset ⊆ \subseteq ⊇ \supseteq ∈ \in  ∋ \owns, \ni
∼ \sim  ≃ \simeq ≡ \equiv  ≈ \approx     ≅ \cong  ≠ \neq
≐ \doteq  ∝ \propto   ∉ \notin  ∥ \parallel ⌣ \smile ⌢ \frown
≺ \prec  ⪯ \preceq ≻ \succ  ⪰ \succeq  ⊧ \models ⊥ \perp
| \mid  ≍ \asymp ▷◁ \bowtie  ⋈ \Join  ⊢ \vdash ⊣ \dashv
⊏ \sqsubset ⊑ \sqsubseteq  ⊐ \sqsupset ⊒ \sqsupseteq

Table 13 Arrows (Math Mode)

← \leftarrow  → \rightarrow, \to ↔  \leftrightarrow
↑  \uparrow  ↓  \downarrow  ↕  \updownarrow
↗ \nearrow  ↙ \swarrow  ↘  \searrow
↖ \nwarrow  ⇝ \leadsto  ↼  \leftharpoonup
⇀ \rightharpoonup  ↽ \leftharpoondown ⇁  \rightharpoondown
⇀ ↽ \rightleftharpoons ↦ \mapsto
⇐ \Leftarrow  ⇒ \Rightarrow  ⇔  \Leftrightarrow
⇑  \Uparrow  ⇓  \Downarrow  ⇕  \Updownarrow
⟵ \longleftarrow  ⟶ \longrightarrow ⟷ \longleftrightarrow
⟸ \Longleftarrow  ⟹ \Longrightarrow ⟺ \Longleftrightarrow
⟼ \longmapsto  ↩ \hookleftarrow  ↪  \hookrightarrow

[figure]

Table 14 Variable-sized Symbols (Math Mode)

              ∑ ∑ \sum  ⋂ ⋂ \bigcap  ⨀ ⨀ \bigodot
              ∏ ∏ \prod  ⋃ ⋃ \bigcup  ⨂ ⨂ \bigotimes
              ∐ ∐ \coprod ⨆ ⨆ \bigsqcup ⨁ ⨁ \bigoplus
              ∫ ∫  \int  ⋁ ⋁ \bigvee  ⨄ ⨄  \biguplus
              ∮ ∮  \oint  ⋀ ⋀ \bigwedge

Table 15 Log-like Symbols (Math Mode)

             \arccos   \cos    \csc   \exp    \ker      \limsup   \min   \sinh
             \arcsin   \cosh   \deg   \gcd    \lg       \ln       \Pr    \sup
             \arctan   \cot    \det   \hom    \lim      \log      \sec   \tan
             \arg      \coth   \dim   \iinf   \liminf   \max      \sin   \tanh

Table 16 Balanced Parentheses with \left and \right (Math Mode)

            ( (  ) )  [ [  ] ]
            { \{  } \}  ⌊ \lfloor ⌋ \rfloor
            ⌈ \lceil  ⌉ \rceil  ⟨ \langle ⟩ \rangle
            / /  \ \backslash  | |  ∥ \|
            ↑ \uparrow  ↓ \downarrow  ⇑ \Uparrow ⇓ \Downarrow
            ↕ \updownarrow ⇕ \Updownarrow  . (to balance)

Table 17 Delimiters with \[B]bi[g]gr[l] (Math Mode)

            } \rmoustache   { \lmoustache   } \rgroup      { \lgroup
            | \arrowvert    ‖ \Arrowvert    | \bracevert

Table 18 Accents

Output Ordinary Mode Math Mode

ò  \`{o}^{118}  \grave{o}
ó  \'{o}^{119}  \acute{o}
ô  \^{o}           \hat{o}
M̂  \widehat{M}
ö  \"{o}           \ddot{o}
õ  \~{o}           \tilde{o}
M̃  \widetilde{M}
ō  \={o}^{120}  \bar{o}
\overline{o}  \overline\{o\}

Output Ordinary Mode Math Mode

                                               ȯ  \.{o}           \dot{o}
                                               ŏ  \u{o}           \breve{o}
                                               ǒ  \v{o}           \check{o}
                                               ő  \H{o}
                                               oo  \t{oo}
                                               o̧  \c{o}
                                               o.  \d{o}
                                               o⃗  \vec{o}
                                               \underline{o}  \underline\{o\}   \underline\{o\}

118^{,}^{119}^{,}^{120}: \a`{o}, \a'{o}, and \a={o} must be used in tabbing enironment respectively.

[figure]

Table 19 Symbols in Ordinary Mode

† \dag  ‡ \ddag  § \S  ¶ \P
\begin{matrix}c \\ ◯ \end{matrix} \copyright  £ \pounds  ł \l  Ł \L
ß \ss  ¿ ?`  ¡ !`  # \#
$ \$  % \%  & \&                 \_
œ \oe  Œ \OE  æ \ae  Æ \AE
å \aa  Å \AA  ø \o  Ø \O
{ \{  } \}             ^\tt\symbol{'136}
\   \tt\symbol{'134}                  ~   \tt\symbol{'176}

[figure]

Index

1. ¶indicates existence of a sample in this article.

2. †: Samples are in the original package.

3. ‡: Need docstrip.tex to get manual and/or sample.

4. §: Samples are below the line of \endinput.

5. Usage is found in the comment lines of the file.

1-in-2.sty § . . . . . . . . . . . . . (2/93), 8

2up.sty † . . . . . . . . . . . . . . . . . . (1.2), 40

a4.sty . . . . . . . . . . . . . . . . . . . .(5/87), 2 a4wide.sty . . . . . . . . . . . . . . . (7/86), 2 algorithm.sty . . . . . . . . . . . . . . . (-), 17

algorithms.sty § . . . . . . . . . . . . (-), 17

alltt.sty ¶. . . . . . . . . . . . . .(12/87), 14

amssymbols.sty . . . . . . . . . (11/85), 23

ans.sty †. . . . . . . . . . . . . . . . .(2/94), 7

answers.sty § . . . . . . . . . . . (10/92), 7

array.sty ¶ ‡ . . . . . . . . . . . . . (2.1b), 32

arydshln.sty ¶ . . . . . . . . . . . . (1.0), 31

astyped.sty . . . . . . . . . . . . . . . (1.3), 15 at.sty . . . . . . . . . . . . . . . . . . . .(3/92), 6

austdate.sty ¶ . . . . . . . . . . . (5/87), 39

bar.sty ¶ † . . . . . . . . . . . . . . . . (1.0), 31

bibperinclude.sty . . . . . . . (6/91), 38

bibunits.sty † . . . . . . . . . . . . . . (-), 38 bigbox.sty ¶. . . . . . . . . . . . . .(8/90), 36 bigint.sty ¶. . . . . . . . . . . . . .(8/93), 23

bigtabular.sty . . . . . . . . . . (7/90), 29

bitmap.sty ¶ † . . . . . . . . . . . . . . . (-), 34

boxedminipage.sty ¶. . . . . .(6/89), 36

boxit.sty ¶ . . . . . . . . . . . . . . . (2/92), 36 bsf.sty . . . . . . . . . . . . . . . . . . (6/89), 42 bsl.sty . . . . . . . . . . . . . . . . . . (6/89), 42

calligra.sty ¶ . . . . . . . . . . . (3/94), 43

calligraphy ¶ . . . . . . . . . . . . . . . . (-), 43 cases.sty ¶ . . . . . . . . . . . . . . . . (1.0), 18 cd.sty † . . . . . . . . . . . . . . . . . . (3/89), 23

chapterbib.sty . . . . . . . . . . . .(1.2), 38
chemstruct.tex † . . . . . . . . . . (1.0), 22

chemtex.sty † . . . . . . . . . . . . . ('87), 22 chicago.bst . . . . . . . . . . . . . . . . . (4), 38 chicago.sty . . . . . . . . . . . . . . . . . (4), 38 cite.sty ¶ . . . . . . . . . . . . . . . . . (3.2), 38 comment.sty § . . . . . . . . . . . . . (2.0), 15 cprog.sty . . . . . . . . . . . . . . . . . (1.2), 16 cropmark.sty . . . . . . . . . . . . . . . . (1), 37 curves.sty ¶ ‡ . . . . . . . . . . . . (1.32), 34 cut.sty §. . . . . . . . . . . . . . . .(10/91), 28

daytime.sty ¶ . . . . . . . . . . . (10/91), 39

dchem.sty ¶ . . . . . . . . . . . . . . . . . . (-), 22

dcolumn.sty ¶ ‡. . . . . . . . . . .(1.01), 31
decalign.sty † . . . . . . . . . . (10/87), 31

dectab.sty ¶. . . . . . . . . . . . . .(4/91), 31

delarray.sty ¶ ‡. . . . . . . . . .(1.00), 21
diagram.sty ¶ †. . . . . . . . . . .(5/91), 23
diagrams.tex † . . . . . . . . . . . (3.29), 23
docstrip.tex ‡ . . . . . . . . . . . (2.0r), 46
dot-eqns.sty † . . . . . . . . . . . (3/92), 18
doteqn-f.sty ¶ †. . . . . . . . . .(3/92), 18
doublespace.sty . . . . . . . . . . . . .(-), 3

draft.sty . . . . . . . . . . . . . . . . . . . .(-), 6

drawing.tex † . . . . . . . . . . . . (1.0a), 34

drop.sty ¶ . . . . . . . . . . . . . . . . (2/88), 11

dropcaps.sty . . . . . . . . . . . . .(0.30), 11
eclarith.sty ¶ †. . . . . . . . . . .(1.1), 22
eclbkbox.sty † . . . . . . . . . . . (5/93), 37
eclclass.sty ¶ †. . . . . . . . . .(9/92), 31
ecleepic.sty † . . . . . . . . . . . . (1.0), 35
ecltree.sty ¶ †. . . . . . . . . . .(4/91), 30

eepic.sty ¶ † . . . . . . . . . . . . . (1/1b), 35

eepicemu.sty . . . . . . . . . . . . .(1.1a), 35
endfloat.sty . . . . . . . . . . . . . . (2.0), 15
endnote.sty . . . . . . . . . . . . . . (9/91), 15

endnotes.sty . . . . . . . . . . . . . . . . (-), 15

enumerate.sty ¶ ‡ . . . . . . . . (2.01), 24
enumspec.sty ¶ . . . . . . . . . . . (1/88), 24

epic.sty ¶ † . . . . . . . . . . . . . . . (1.2), 35 epsbox.sty † . . . . . . . . . . . . . . (1.5), 35 epsf.sty †. . . . . . . . . . . . . . . . .(1.2), 35

eslides.sty † . . . . . . . . . . . . (2/90), 40

exam.sty . . . . . . . . . . . . . . . . . (7/89), 7

exercise.sty . . . . . . . . . . . .(10/88), 7
fancybox.sty ¶ §. . . . . . . . . . .(1.0), 37
fancyheadings.sty ¶ . . . . . . . (1.3), 3

fchart.tex † . . . . . . . . . . . . . . (2.0), 29

fillform.tex † . . . . . . . . . . . . ('92), 6

float.sty † . . . . . . . . . . . . . . (1.1c), 33

floatfig.sty † . . . . . . . . . . . . (0.4), 28

flow.exe ¶ † . . . . . . . . . . . . . . (0.99), 29 Flow.sty †. . . . . . . . . . . . . . . .(8/89), 29

fnpara.sty . . . . . . . . . . . . . . (10/88), 15

fntbl.tex . . . . . . . . . . . . . . . . . . . .(-), 41

formlett.sty ¶ §. . . . . . . . . . .(2.0), 7

french.sty † . . . . . . . . . . . . . (3,25), 14 ftn.sty ‡. . . . . . . . . . . . . . . . .(1/92), 15

ftnright.sty ‡ . . . . . . . . . . . (1.0d), 15

german.sty ¶ † . . . . . . . . . . . . (2.4a), 14

hangcaption.sty . . . . . . . . . (2.00), 27
hanging.tex . . . . . . . . . . . . . . (5/93), 15

here.sty ‡. . . . . . . . . . . . . . . .(1.01), 28

[figure]

indent.sty ¶. . . . . . . . . . . . . .(1/93), 12 index.sty ‡ . . . . . . . . . . . . . . (3.01), 38 isf.sty . . . . . . . . . . . . . . . . . . (8/89), 42 italic.sty . . . . . . . . . . . . . . . (8/91), 14

jeep.sty †. . . . . . . . . . . . . . . .(2/89), 25 jsce.sty †. . . . . . . . . . . . . . . .(2.10), 8

latexsymbols.tex . . . . . . . . (6/93), 43

lgrind.c †. . . . . . . . . . . . . . . . .(1.4), 16

longtable.sty ‡ . . . . . . . . . . (3.04), 29

loval.sty ¶ † . . . . . . . . . . . . . . (1.1), 36

lslide.sty † . . . . . . . . . . . . (2.0.1), 40

manfnt ¶. . . . . . . . . . . . . . . . . . . . . .(-), 43

manpage.sty † . . . . . . . . . . . . (1.03), 7
manyeqns.sty ¶ †. . . . . . . . . .(2/91), 18
mickeytime.sty ¶ . . . . . . . . . (7/93), 39

minitoc.sty † . . . . . . . . . . . . . . (16), 9

morefloats.sty . . . . . . . . . . (7/90), 35
multicol.sty ¶ ‡. . . . . . . . . .(1.4m), 13
multicolpar.sty ¶ . . . . . . . . . . . (-), 14
multiint.sty ¶ . . . . . . . . . . (10/92), 23
musictex.tex † . . . . . . . . . . . (5.01), 40

nofm.sty . . . . . . . . . . . . . . . . . (9/88), 6 nruby.sty §. . . . . . . . . . . . . . . .(2.0), 14 numberpar.sty . . . . . . . . . . . . . . . (-), 12

numbersty.sty ¶ . . . . . . . . . . (1/94), 39
numline.sty § . . . . . . . . . . . . . (1.2), 6
Ointint.sty ¶ . . . . . . . . . . . . (2/94), 23

old-german ¶ † . . . . . . . . . . . . . . . (-), 43

ordinalno.sty ¶ . . . . . . . . . . (5/93), 39

oval.sty †. . . . . . . . . . . . . . . . .('91), 36

overcite.sty . . . . . . . . . . . . . . (3.2), 38
ovudbraces.sty ¶ § . . . . . . . (4/93), 21
pageframe.sty . . . . . . . . . . (11/91), 37

path.sty . . . . . . . . . . . . . . . . . (3.02), 14

picinpar.sty † . . . . . . . . . . . . ('92), 28

picins.sty ¶ † . . . . . . . . . . . . . (3.0), 28 pictex.tex † . . . . . . . . . . . . . . (1.1), 34

pmbb-sym.sty ¶ §. . . . . . . . . .(1/94), 23
portland.sty . . . . . . . . . . . .(12/88), 3

poster.tex † . . . . . . . . . . . . . . (1.0), 40 program.sty † . . . . . . . . . . . . . ('91), 17 proof.sty . . . . . . . . . . . . . . . . . (1.0), 23

quote.sty ¶ . . . . . . . . . . . . . . . (8/91), 44

raggedri.sty ¶ ‡. . . . . . . . . .(1.00), 6

recipe.sty . . . . . . . . . . . . . . . (7/92), 7

resume.sty § . . . . . . . . . . . . (10/89), 7

ruby.sty ¶ . . . . . . . . . . . . . . . . (1/88), 14

schedule.sty § . . . . . . . . . . . . . . (-), 7 selectp.sty . . . . . . . . . . . . . . . (0.9), 41 seminar.sty † . . . . . . . . . . . . . (1.0), 40

shadebox.sty ¶ . . . . . . . . . . . (3/94), 37

shadow.sty ¶ . . . . . . . . . . . . . . . (1.1), 36

shapepar.sty ¶ . . . . . . . . . . . . (1.0), 12
showkeys.sty ¶ ‡. . . . . . . . . .(1.01), 6

                                                    slashbox.sty ¶ §. . . . . . . . . .(5/93), 32

slem.sty . . . . . . . . . . . . . . . . (10/86), 42

                                                    smallgrf.sty ¶ §. . . . . . . . . .(4/92), 29
                                                    sprite.sty ¶ †. . . . . . . . . . .(10/87), 43

sscyr.sty † . . . . . . . . . . . . . . (3/94), 14 subeqn.sty . . . . . . . . . . . . . . . (2/90), 17

                                                    subeqnarray.sty . . . . . . . . . . (1.1), 17
                                                    subfigure.sty . . . . . . . . . . . . .(1.1), 32
                                                    subfloat.sty ¶ §. . . . . . . . . .(8/93), 32
                                                    sumofmoney.sty ¶ . . . . . . . . . (1/94), 39
                                                    supertab.sty † . . . . . . . . . . . (3.7b), 29
                                                    supertabular.sty † . . . . . . (3.7b), 29
                                                    symbols.tex . . . . . . . . . . . . . . (2.00), 43
                                                    tabularx.sty ¶ ‡. . . . . . . . . .(1.04), 32

tboxit.sty ¶. . . . . . . . . . . . . .(1/93), 36 testfont.tex . . . . . . . . . . . . . . . . (-), 41 texnames.sty . . . . . . . . . . . . . . . . (-), 45 time.sty ¶ . . . . . . . . . . . . . . . . (1/92), 39 tree.sty ¶ † . . . . . . . . . . . . . . . ('85), 31 ttn2n1.sty . . . . . . . . . . . . . . . . (2.1), 10

ukdate.sty ¶. . . . . . . . . . . . . .(1.00), 39 ulem.sty ¶ . . . . . . . . . . . . . . . . . ('93), 12 undtilde.sty ¶ . . . . . . . . . . . . . . . (-), 12 uuline.sty ¶ . . . . . . . . . . . . . . . . . (-), 13

                                                    verbatimfiles.sty ¶ . . . . . . . . . (-), 16

version.sty ¶ . . . . . . . . . . . . . . . . (-), 15 vita.sty . . . . . . . . . . . . . . . . . (2/92), 7

                                                    weekday.sty ¶ . . . . . . . . . . . . (2/91), 39

wrapfig.sty † . . . . . . . . . . . . . ('91), 28

                                                    wrapfloat.sty ¶ † . . . . . . . . (3/92), 28
                                                    xarticle.sty . . . . . . . . . . . . .(9/90), 6