Home

A Simplified Introduction to LATEX

image

Contents

1. 0 02000002 eae Operators and Quantifiers 2 2 Special Functions 2 00000022 eae Relation Symbols s 42 43 44 45 46 vil AAF OWS asada 404 wreck ale Gode Te ere ee unos 116 Dots Circles Triangles and Lines 116 Variable Size Symbols a 117 Special Symbols in Both Text and Math Modes 117 Commands and Parameters in Picture Environment 117 viii Preface The majority of this book is about using IATEX 2e 2 10 a descendant of IATEX designed by Leslie Lamport 9 based on TEX originated by Donald E Knuth 8 This is a typesetting program not a word processor You enter some editor that saves plain text files Then you type text freely until you need something special such as italic font or a complex mathematical expression like ate 1 x u de O It was the desire to have high quality low cost publications in mathe matics and related disciplines that caused Knuth pronounced Kah nooth to invent TEX pronounced Tek in the late 1970 s Originally believing that he could write a program in less than a year that could typeset documents he actually ended up defining an entire branch of research in computer science It was 10 years later that he published his seminal book 8 but he published articles along the way and he permanently changed the way mathematical documents are prepared IATEX pronounced Lah
2. In Figure 61 the top left box starts at 1 5 and its width is 7 so the right edge of that box is at x 3 Starting at y 35 the vertical position changes by moving up half of the height so the coordinate where the arrow begins called its tail is 3 5 3 3 3 35 That accounts for the initial position given by put 3 35 The arrow is to be horizontal drawn left to right so Ax 1 and Ay 0 as specified with Nvector 1 0 Finally we need to determine the length specified as 1 3 We want the coordinate of the end of the arrow called the head to be flush to the left side of the center box That box begins at 0 5 so Az 0 3 3 It required these computations to determine the complete picture command put 3 35 vector 1 0 3 Now consider the next Nvector which is a vertical arrow from the same box to the circle below it The initial position is calculated simply as the midpoint of the bottom edge of the box x y xo 3h yo where the box starts at zo yo and h height In this case zo yo 1 5 and h 3 so we obtain the coordinates of the arrow s tail a yi 1 2 3 5 65 5 as specified Since the arrow is downward Ax 0 and Ay 0 given by vector 0 1 The length is determined by where we want the arrowhead at the top of the circle T he circles y coordinate is 65 which is its center We must
3. Nsimeq FE Wnodels M1 gt We 2 cong x Npropto C subset D supset x Nasymp E Vin C MXsubseteg 2 Nsupseteq amp approx 2 Mni E sqsubseteq sqsupseteq 116 APPENDIX Table 42 Arrows leftarrow Mongleftarrow T uparrow lt Leftarrow lt NLongleftarrow f XUparrow rightarrow longrightarrow NXdownarrow gt Rightarrow gt MLongrightarrow XADownarrow gt Meftrightarrow longleftrightarrow updownarrow gt Leftrightarrow lt Longleftrightarrow Updownarrow gt mapsto gt longmapsto nearrow hookleftarrow gt hookrightarrow Xx searrow leftharpoonup rightharpoonup Y swarrow leftharpoondown rightharpoondown NM nwarrow rightleftharpoons Table 43 Dots Circles Triangles and Lines NLAXKPY DBD cire cdots vdots frown triangle triangleright bigtriangleup bowtie top dashv angle mid O EGO bigcirc ddots bullet smile diamond triangleleft bigtriangledown perp bot vdash NI Xparallel Some Tips 117 Table 44 Variable Size Symbols Y Nsum J int oint II prod 25 overbrace underbrace WY JI coprod z overline underline 4 Mrac nMd y sqrt These use left and right CA A NN lfloor rfloor V backslash f lceil rceil langle ran
4. Required fields author or key title Optional fields author howpublished address month year inbook is a part of a book such as a chapter or just some range of pages Required fields author or editor title chapter and or pages publisher year Optional fields volume or number series type address edition month incollection is a part of a book having its own title Required fields author title booktitle publisher year Optional fields editor volume or number chapter series type pages address edition month 3 2 The bib File 31 inproceedings is an article in a conference proceedings Required fields author title booktitle year Optional fields editor volume or number series pages month organization publisher address manual is some technical documentation Required fields author or key see note below title Optional fields author organization address edition month year mastersthesis is a Master s thesis Required fields author title school year Optional fields type address month misc is when nothing else fits Required fields author or key see note below Optional fields author title month howpublished year phdthesis is a PhD thesis Required fields author title school year Optional fields type address month proceedings Required fields title year Optional fields editor volume or number series publisher organization address month techreport is a re
5. The newcommand is something I shall describe more fully in For now it is used to define a command noopsort requiring one argument Command noopsort ignores the argument that it receives producing noth ing indicated by Here is how this can be used Suppose there is a 2 volume work by the same authors originally pub lished 1971 but a second edition of volume 1 is printed in 1973 The bib entries would have the years in the opposite order than we want because sorting is first by the authors which are the same then by year To force the first volume to sort before the second we fool the bibtex program with the following specifications Volume 1 Volume 2 year noopsort a 1973 year noopsort b 1971 This fools the bibtex program into thinking the years are a1973 and b1971 thus putting volume 1 first The definition of noopsort however does not actually print the letters so just the years appear 3 3 Declaration and Citation At the end of your source file where you want the bibliography to appear before end document put the following commands in either order bibliography mybiblio bibliographystyle plain The first declares the bibliography to be in the bib file mybiblio bib The second command defines the format style of the bibliography to be plain which comes with every installation of latex There are other bibliography format styles including some provided by publishers
6. 104 overbrace 56 overline 56 overset 65 pagebreak 24 pagenumbering 97 pageref 40 62 122 pagestyle 97 108 parbox 18 19 72 parindent 106 parsep 106 parskip 106 partial 60 prime 54 printindex 98 prod 48 providecommand 119 psset 78 raggedright 57 raisebox 57 refstepcounter 43 ref 39 40 53 62 renewcommand 25 34 43 98 100 119 renewenvironment 103 right 56 117 samepage 24 section 98 section 5 selectfont 38 setcounter 43 setlength 42 72 99 smallskip 11 sqrt 48 stackrel 65 stepcounter 43 subsection 5 substack 65 tableofcontents 97 textstyle 48 textwidth 104 textfont 8 thanks 94 theenumi 43 thefootnote 95 thecounter 39 43 title 93 underbrace 56 underline 9 16 56 underset 65 INDEX unitlength 72 73 url 24 33 usepackage 25 41 58 59 61 77 value 43 vector 74 verb 21 118 vfill 25 vspace 25 vspace 25 55 widehat 56 widetilde 56 Ws 15 pdftex 78 titlepage 93 accents 22 AMS 1 amsmath 61 Bezier curve 84 bibtex program 28 body 1 boldmath 47 box 72 co authoring 118 column specification 16 command line 1 comment 20 comments 1 118 compile 1 conditional assignment 56 counting words 118 cover page 93 cross referencing 35 dash 10 debugging 2 derivative 60 document styles 1 DOS 3 28 dvi viewer 3 dvips 4 emftoeps
7. 86 INDEX environment 1 6 abstract 96 98 appendix 98 array 51 54 57 axiom 62 center 6 corollary 62 description 12 21 document 1 93 enumerate 14 eqnarray 53 eqnarray 53 equation 54 figure 40 41 flushleft 6 18 19 57 flushright 6 gather 64 gather 64 itemize 13 large 9 longtable 20 picture 72 quotation 10 quote 9 smallmatrix 64 65 tabbing 22 table 40 41 tabular 15 21 41 56 thebibliography 109 theorem 61 verbatim 21 verse 11 file bib 28 29 32 34 36 bst bib style 36 110 dvi 1 78 eps 86 jpeg 86 ps postscript 3 78 86 tex 1 32 wmf 86 float 40 123 float page 41 floating object 40 font size 4 9 55 font style bold small caps 9 boldface 8 boldmath 47 calligraphic 47 Greek 47 italic 8 16 math mode 47 54 58 non English 22 Roman 16 sans serif 8 slanted 8 small caps 8 16 typewriter 8 underlined 8 footnote 95 99 fractions 48 ghostview 3 global setting 43 graph 82 Hamiltonian 60 horizontal fill 10 hyphenation 24 index making of 98 jpeg2ps 86 Lagrangian 59 landscape 81 Laplace transform 59 latex command 1 line spacing 11 25 bibliography 38 list environment 12 description 12 enumerate 14 itemize 13 local setting 42 124 make index 98 math display mode 45 48 52 mathbf 47 matrix equation 54 message 2 Overfull 2 Repeated entry 37 Underfull 2 warnin
8. Here is a list of the most basic ones included in every installation plain is the most common because it formats entries according to accepted standards Entries are sorted by the alphabetical order of author names breaking ties with the year of publi cation and they are labeled with numbers abbrv differs from plain by abbreviating names of journals among other things to give a more compact bibliography alpha differs from plain by citing by labels rather than num bers unsrt differs from plain by sorting entries by the order in which they are cited rather than by the author names 3 4 Some Controls 37 We shall use only the plain style here but know that many other styles have been written and are available free of charge To cite particular references the ATEX command is cite label where label is what we put in our bib file entry For example 8 is produced by specifying cite tex You can put more than one citation separated by commas For example cite tex latex produces 8 9 for this document You can insert some further citation information as an optional input argument to the cite command For example cite p 46 latex pro duces 9 p 46 in this document In the option delimited by the is used to ensure that there is a space but no line break when giving the page number as p 46 in the citation The rule is that only those bib entries that are cited appear in the final docum
9. Last field on new line Figure 30 Tabbing Result Source in Figure 29 2 6 Line Page and Word Breaks You can cause a new line by entering linebreak When text is justified the default this could result in an undesirable appearance like the following 24 2 TEXT textsf This example is linebreak extreme This example is extreme The newline command forces a new line without justifying it textsf Here is the extreme newline example Here is the extreme example The nolinebreak command works analogously preventing a line break even if it means extending into the right margin Also it is better style to keep certain words together such as figure 1 or p 10 To prevent a line break where you want a blank use the space character We would thus write figure 1 or p 10 There are two commands to force a page break pagebreak and newpage The newpage command follows the analogy with newline in forcing a page break precisely at the point it is specified rather than completing the line as pagebreak does The nopagebreak command disallows a page break im mediately following the next blank line The samepage command prevents a page break within its scope Here is an example that keeps line 1 on the same page as line 2 samepage line 1 nopagebreak line 2 Word breaks are hyphenations that ATEX does for you Sometimes however you want to suppress hyphenation This can be done b
10. anything could be used for the middle column Further there are times when we need to use more than one line for an equation in which case we need to suppress the numbering of all but one of the rows Figures 43 and 44 give an example The nonumber command causes no number to be assigned to the first part of the second equation beginfeqnarray x amp mbox is equal to y NN y amp Npreceq frac atbtctd Psi fracfe f gth Phi nonumber MM amp amp I K J L end eqnarray Figure 43 eqnarray Environment Source Result in Figure 44 x isequalto y 3 a b c d e f g h A y o i TEK IFL 4 Figure 44 eqnarray Environment Result Source in Figure 43 There is also an eqnarray environment which is the same as eqnarray but without the equation numbers There is no apparent advantage to this since the same result can be produced by the ordinary array environment specialized to this column specification It does however let us change our mind easily as to whether or not to include equation numbers by simply adding or removing the from the environment specification 54 5 MATH MODE For a single numbered equation there is the equation environment This poses no particular advantage over specifying eqnarray and merely entering one row except that column separators amp are not used in the equation environment Analogous to eqnarray there is the equation environment which suppresses th
11. partial x_i partial x_j Might end array There seems to be some crowding in this direct specification Compare with the following and see if you can produce it vero ete There are two integral signs int f and oint which are both variable size symbols For example note how the outer integral is large in the following expression b J lim A oo This was obtained by the following code 6 x v zef dg fxi eM dz DIMUS XT Sint a b lim_ lambda rightarrow infty left frac oint_ X v xe Mlambda f x dx oint_ X v e7 lambda f x dx right Phi v dv M 5 6 Theorems and Definitions 61 Note the use of the thin space Definite multiple integrals are no problem To have yu J E H 21 n da1 dog o Jo Jo 0 NE Nint O NMinfty Mint O x n Mint O x n 1 cdots int_O7 x_2 H x_1 dots x_n dx_1 cdots dx n write M However consider the following f ev mas f f ew v van The domains of integration and the spacing of the integral signs are better with the following which is not produced by standard TX 2e but by specifying usepackage amsmath in the preamble see The ATEX Companion 5 p 223 a T Note how the domains are centered on the multiple integrals and the spacing of the integral signs 5 6 Theorems and Definitions The foundations of mathematics are axioms and rules of inference The rules create theorems which ar
12. some common examples a complete table is in the Appendix For example write Poincar e to have Poincar and G o del to have G del An accent could be applied to any letter even if it does not relate to some language for example b c a gt bed IATEX has a basic library of accents and special characters for writing in languages other than English some of which are shown in Appendix Table 29 e g gt and aa a In some cases these are not sufficient particularly if the entire document is to be in a non English language For that purpose there are some packages such as Babel 1 also see 5 Chapter 9 Table 3 Some Accents for Letters What you write What you see a gt a Her gt XE gt i V 0l gt 0 Nul gt 2 5 Tabbing The tabbing environment provides an alternative to the tabular environment by letting you set your own column tabs Table 4 shows a simple case with two basic tabbing commands X to define a tab setting and gt to move to a tab setting In addition NX ends each row but unlike the tabular environment the first sentence continues normally without extra spaces so that the position of the tab is not equivalent to that of a table s column Table 4 The Tabbing Environment What you see What you write begin tabbing Begin set tab 1 set tab 2 Begin set tab 1 dots set tab 2 skip tol then to 2 gt skip to 1 gt then to 2 gt gt skip
13. subseteq superset proper 2 supset superset or equal 2 supseteq 5 1 Mathematical Symbols 47 You can control the size of the font by using the usual specification before enter ing math mode For example Large x div y z gt x y 2 Font style however does not apply to math mode because math mode has its own sep arate from text mode You can make math fonts boldface by specifying boldmath before entering math mode For example boldmath x n y n z n gt a y z Note that boldmath is surrounded by the braces otherwise math fonts would remain bold even when leaving and re entering The following illustrates this where B U C is boldface in the first case and returns to normal style in the second case boldmath A supset B text B cup C gt AD B text BUC boldmath A supset B text BNcup C AD B text BUC Within math mode we can control the font style of letters with the command mathfont expression where font is one of bf cal it normal rm sf tt analogous to the textfont command p 8 Unlike boldmath this applies only to letters digits and accents but not to special mathematical symbols For example boldmath tilde A times vec 1 otimes overline 2 gt Ax 192 mathbf tilde A times vec 1 otimes overline 2 gt Ax1 2 Table 11 illustrates the outcome of each font for this expression mathfont tilde A times vec 1 otimes overline 2 Table 11 The mathfon
14. 15 20 22 23 25 25 28 28 28 28 32 34 36 37 38 5 Math Mode 5 1 Mathematical Symbols 2l 5 2 Fractions and Variable Size Functionality 5 3 Arrays and Equations 5 4 Special Functions and Alphabets 5 5 Derivatives and Integrals leen 5 6 Theorems and Definitions o 5 7 Refinements o sa acea kde MR oe Gk vc mos a a RE RT S 5 8 Grammar dox cent a AR nus RRE ap Pe es LEXerC1S68 vos a a Romoe r a ox doy Ee mou n Box Rr e p s 6 Graphics 6 1 Picture Environment 6 2 BSIneks ud knife a0 e heces whe eR GRADUS de 6 3 Importing pictures e Icono qui od ee ce a da ee 7 Making Special Parts T l Cover Page 293 cos xw hosce A e AA COMES do O TT TT ETT E Hes 7 3 Other Front Matter 7 4 Back Matter 7 5 Footnotes 22 4 EXETCISES 2222229 939 8 Taking Control 8 1 Your Own Abbreviations and Commands 8 2 Your Own Names Titles and Numbers 8 3 Your Own Environments a 8 4 Your Own Margins and Spacing 8 5 Your Own Output Control less 8 6 Your Own Bibliography ls Closing Remarks Appendix Some Tips References Index 45 46 48 51 58 60 61 63 66 67 71 a 77 86 90 100 100 102 103 103 108 109 110 111 117 119 121 List of Figures e 0 JONA ho gt 4 0 02020
15. 2 Average Bill 67 72 70 5 Charleetah 72 67 70 5 Taken in class Figure 27 Multicolumn Result Source in Figure 26 Tables that are too long to fit on one page could be broken manually but the longtable package enables automatic page breaks by the TFX com piler You obtain the package from CTAN 4 In the preamble specify usepackage longtable Then instead of the tabular environment specify the longtable environment which has most of the same options 2 4 Special Characters We have already seen that some characters are special in that they delimit something In particular delimits every IXTEX command and ends a line enabling comments How do we print such characters One way is with the symbol itself like V4 Other times a keyword like Xtextbackslash is needed The Appendix contains complete tables of these special characters including those I do not cover explicitly in the chapters Of particular importance are the braces written as to obtain Recall that the braces by themselves create a local environment like large When using a keyword to specify a special character it appears with whatever font is active Table 2 next page illustrates this with commonly 2 4 Special Characters 21 used special characters The brackets are different because they can be entered directly except when they are used to delimit an option in the syntax in which case they can be obtained by e
16. Horizontal Braces Result Source in Figure 49 flushleft in parbox Source Result in Figure 52 flushleft in parbox Result Source in Figure 51 raggedright in parbox Source Result in Figure 54 raggedright in parbox Result Source in Figure 53 gather Environment Source Result in Figure 56 gather Environment Result Source in Figure 55 Commutative Diagram Source Result in Figure 58 Commutative Diagram Result Source in Figure 57 Vertical Diagram Source Result in Figure 60 Vertical Diagram Result Source in Figure 59 Variety of Objects in Picture Environment Source for Figure 61 o e e Line Parameters oc ss cocuda renta 00000000008 PS Iricks Source for Connecting Nodes Graph Source Result in Figure 66 Graph Result Source in Figure 65 Source Code for Drawing Histogram of Test Scores Sequence of PS Tricks Commands to Draw Histogram Applying includegraphics to Import an eps File Specifying Dimensions in Nincludegraphics Title Page Source Result in Figure 72 Title Page Result Source in Figure 71 Adding Addresses to Authors lll Footnotes in the Cover Page Source Result in Figure 75 Footnotes in the Cover Page Result Source in Figure 74 Authors with same footnote Result in Figure 77 Authors with same footnote S
17. It is not necessary that the left symbol be related to the right one i e left does not require right to balance any right symbol will do The period is not printed in this case used specifically for this purpose of balance We have seen the use of left and right for brackets around a matrix Now the use of the left IATEX command for conditional assignment raises related uses of the underbrace and overbrace Figures 49 and 50 illustrate these along with overline underline widehat and widetilde NT beginfarray cc mbox This sum has mbox an overbrace overbrace overline i dots j underline k cdots 1 amp underbrace widehat xy widetilde ab mbox This difference mboxfhas an underbrace end array Figure 49 Horizontal Braces Source Result in Figure 50 This sum has an overbrace 2 _0700 m i kd xy ab This difference has an underbrace Figure 50 Horizontal Braces Result Source in Figure 49 We often need to mix mathematical notation and text We could use the tabular environment and specify in line math mode where needed with or we 5 3 Arrays and Equations 57 could use the array environment and use either the mbox or parbox see p 18 to enter the text There are however some nuances to understand Figures 51 and 52 show the problem with using flushleft to make the text within the parbox flush left Try it with t
18. Sebastian Rahtz Axel Reichert Thomas Ruedas Bernd Schandl Anton Schwaighofer M rten Svantesson and Matt Swift who were very gen erous with taking time to answer so many questions on a regular basis I also received useful comments from people who read an earlier draft that I made available on the web notably William Briggs I especially thank Kasper B Graversen whose in depth review has made this version much better than my original One student Andrea Dean provided feedback that led to several points of clarification Last but not least I thank Allen G Holder who taught me TFX in the first place Sources of IATEpX Software The basic IATEX software system is available free of charge for unix systems and MiKTeX 13 is available free of charge for DOS systems The best source of these and additional packages that extend the TEX capabilities to which I refer in this book is at the Comprehensive TeX Archive Network CTAN 4 at three host sites and many mirrors 1 http ctan tug org in Boston MA USA 2 http www tex ac uk in Cambridge UK and 3 http www dante de in Mainz Germany in German These all describe how to search and browse the FTP sites for software and documents 1 Overview You will create a file called the ATX source which is plain text To keep things simple its suffix is tex For example I refer to myfile tex as a plain text source file that you create Figure 1 shows the structure
19. above is a big skip The space you see just above is a medium skip The space you now see just above is a small skip This is just an ordinary line space Figure 13 Skipping Line Spaces Result Source in Figure 12 The verse environment indents oppositely lines after the first The fol lowing was generated by putting begin verse before the text and end verse after it Neglect of mathematics works injury to all knowledge since he who is ignorant of it cannot know the other sciences or the things of this world And what is worse men who are thus ignorant are unable to perceive their own ignorance and so do not seek a remedy Roger Bacon The italics were specified in the usual way by enclosing Bacon s verse with textit Designed for poetry each line is a stanza in the verse 12 2 TEXT and if a stanza runs long this form of indentation makes it clear Bacon s name appears flush right again from the hfill command but this time it is on the last line of the verse rather than a new line This is achieved by not skipping a line after the verse begin verse textit Neglect of mathematics hfill Roger Bacon end verse 2 2 Lists There are three intrinsic list environments distinguished by what appears at the beginning of each item number bullet or your description perhaps nothing To illustrate here is the use of a description list environment to itemize steps involved in learning
20. after plotting the sin function over the indicated grid Figure 70 shows the same eps file but with the width and height set as follows begin center includegraphics width 2in height 1in sin eps end center Figure 70 Specifying Dimensions in includegraphics For a very large picture we might want to specify width textwidth height and let it fill the entire width of the page The height specification says to maintain the aspect ratio If you find yourself importing eps files but would like to make some changes in IATEX read about the PSfrag package by Michael C Grant and 6 3 Importing pictures 89 David Carlisle which comes with a basic installation including MiKTeX whose documentation is at CTAN 4 It has two basic operations 1 edit some string or position in the figure i e the eps file and 2 translate IXTEX commands that you put in the figure in the first place The documentation gives examples with eps files produced by MATLAB and xfig Importing graphics is only one of the functions of graphicx It can also perform scaling rotation and sizing of an arbitrary box The box could contain text pictures or almost any stuff Here are examples Double your fun scalebox 2 Double your fun Open wide resizebox 1lin fbox Open wide eid ao toohexA reflectbox Reflect on this o E E rotatebox origin c 90 Landscape R 4 rotatebox origin rt 45 psframebox beg
21. and basic unix installations There are two packages that provide 6 3 Importing pictures 87 essentially the same capabilities but with different syntax One is called graphics the other is graphicx Here I use graphicx as specified in the preamble by usepackage graphicx fileplot plotstyle dots mydata dat 15 10 psaxes 0x 50 Oy 0 Dx 10 Dy 5 dx 10 dy 5 ticks y lt gt 60 17 5 0 50 60 70 80 90 100 15 36 psline 1 0 1 6 10 6 10 0 F Wput 5 8 Ntextsf F 5 0 50 60 70 80 90 100 15 T Mpsline 11 0 11 2 19 2 19 0 F rput 14 4 textsf D 5 D 0 50 60 70 80 90 100 15 10 psline 20 0 20 11 29 11 29 0 F rput 25 13 textsf C 5 D 0 50 60 70 80 90 100 15 e j B psline 30 0 30 8 39 8 39 0 F rput 35 10 textsf B 5 D 0 50 60 70 80 90 100 15 C 10 F B psline 40 0 40 5 50 5 50 0 5 5 A rput 45 7 textsf A 0 50 60 70 80 90 100 Figure 68 Sequence of PSTricks Commands to Draw Histogram To include an eps file simply specify includegraphcs Loptions filename For example Figure 69 shows a figure that was imported with the following statement 88 6 GRAPHICS begin center includegraphics scale 5 sin eps end center Figure 69 Applying includegraphics to Import an eps File In this case I specified the option scale 5 which prints the figure half the size it was produced in this case by MATLAB by specifying print sin deps
22. archive USA ftp tug2 cs umb edu tex archive These are host sites which contain a list of mirror sites Michel Goosens Frank Mittelbach and Alexander Samarin The ATRX Companion Addison Wesley Publishing Company Reading MA 1994 John D Hobby A User s Manual for MetaPost Computing Sci ence Technical Report no 162 AT amp T Bell Laboratories Murray Hill New Jersey 1992 Available at http cm bell labs com who hobby MetaPost html 120 7 8 9 10 11 12 13 14 15 REFERENCES John D Hobby Drawing Graphs with MetaPost Computing Science Technical Report no 164 AT amp T Bell Laboratories Murray Hill New Jersey 1993 Available at http cm bell labs com cs cstr 164 ps gz Donald E Knuth The TgX Book Addison Wesley Publishing Company Reading MA 15th edition 1989 Leslie Lamport MT X A Document Preparation System Addison Wesley Publishing Company Reading MA 1986 also see 2nd edition 1994 IATEX 22 for authors CTAN macros latex doc usrguide ps see 4 for replacing CTAN 1995 99 Oren Patashnik BIBT EXng World Wide Web http www uic edu depts adn infwww ps btxdoc ps 1988 Keith Reckdahl Using imported graphics in TX 2e World Wide Web site Version 2 0 Comprehensive TEX Archive CTAN info epslatex ps see 4 for replacing CTAN 1995 97 Christian Schenk MiKTgX Local Guide World Wide Web http www miktex de 1998 99 version
23. command line which you enter by running Start 9Programs MS DOS Prompt or by Start Run and entering cmd or command into the window This is called compiling your source which creates several output files The only one you need to be concerned with now is the dvi file which the 2 1 OVERVIEW documentclass article begin document Hello world end document Figure 2 Your First ATEX Source File latex program called a compiler names myfile dvi One of three things will have occurred Case 1 You got messages but they were not fatal errors Among the non fatal messages you will generally see are warnings like Overfull Mhbox Overfull vbox Underfull hbox Underfull vbox Do not worry about these Case 2 You got a fatal error message You must find and correct it This is called debugging your source Sometimes the error message tells you what went wrong such as miss ing a brace characters and which you will come to know and love or some command was not recognized due to being misspelled Many times the message is not very informative so you are advised to compile often That way you will know that what you did in the last few minutes contains the error Case 3 You got no messages Something went wrong and you need to ask for help If all went well the first thing to do is SAVE A BACKUP by copying your source file to another subdirectory or to a differe
24. command name is nul The preamble can become very long as we add our commands so it is useful to put them in a separate file say mydefs tex note the tex suffix Then we use the input command to have the latex compiler read 102 8 TAKING CONTROL it wherever it is placed In particular the preamble of this document contains the command input mydefs The suffix tex is assumed Different source files could simply input this same file so duplication of work is avoided 8 2 Your Own Names Titles and Numbers There are times when we prefer some name other than the default Table 22 shows the common names we might want to change For example in this document the Table of Contents was obtained by specifying the following in the preamble renewcommand contentsname Table of Contents Table 22 Intrinsic Name Parameters What it is How it is called keyword Abstract abstractname Appendix appendixname Chapter chaptername Contents contentsname Index indexname List of Figures listfigurename List of Tables Mlisttablename Part partname References refname for article style bibname for book and report styles You might want to change the numbering of some intrinsic counter We saw an example of this in changing the counters for enumeration lists p 43 The general form is renewcommand thecounter something Another example is to change section numbering in a report document style The
25. even LARGE larger still You can also make it huge huge You might want to make something small small or footnotesize smaller or even scriptsize smaller still You can make it really tiny tiny Figure 10 Some Font Sizes Source Result in Figure 11 You can make the text large or larger or even larger still You can also make it huge You might want to make some thing small or smaller or even smaller still You can make it really tiny Figure 11 Some Font Sizes Result Source in Figure 10 The use of braces to enclose a font size specification is like an environ ment Optionally we can explicitly use the environment syntax Nbeginisize end size For example begin large This is large end large produces the same result as large This is large The environment syntax is useful when you want to keep the size for a large block of text and the braces format is useful for short phrases There is no intrinsic environment for font styles It is straightforward to underline text just write Nunderlinetftezt We can also frame text just by writing Aframettext We can give frame some room around the edges by using fbox instead More on framing in 86 p 71 To overline is as straightforward but learning it must wait until we enter math mode Now consider ways to indent a block of text Here is an example using the quote environment which was generated by putting begin quote
26. examine from which a second latex compilation causes the bibliography to be created The execution looks like this same under unix and DOS latex myfile bibtex myfile latex myfile You might have to compile with latex more times until you do not have any unresolved bibliography citations Once this is successful you do not have to bibtex myfile again until you change your bib file or add a citation This added loop is illustrated in Figure 31 create edit view print print post compile convert latex dvips myfile tex myfile dvi myfile ps dvipdf myfile pdf bibtex Figure 31 Adding bibtex to the Command Sequence 3 2 The bib File 3 2 1 Main body For purpose of this introduction suppose your bibliography is in a file called mybiblio bib but that name is arbitrary as long as it ends with bib We 3 2 The bib File 29 begin with the most important part of your bib file which are the entries you want to include in its database Each entry has the following form type label field value For example Knuth s book 8 would be entered as follows article tex author Donald E Knuth title The TeX Book publisher Addison Wesley Publishing Company address Reading MA year 1989 edition 15th Most authors develop a style to labeling bibliographic entries The use of one keyword is somewhat simplistic and could cause problems with a great number of entries be
27. of this file which I shall describe in greater detail throughout this book This is myfile tex notes dodjoursell co as Anything following is ignored used for comments Preamble ta ificat ona oa blank lines do not matter documentclass options style e g declaring use of packages begin document Body This is the document environment end document All that follows is ignored could be used for comments Figure 1 The Structure of a TEX Document In the preamble there are many options depending upon the style the intrinsic document styles are article book letter report and slides Most publishers have their own style which they provide for you to down load Among these are professional societies notably the American Mathe matical Society amsmath style and the Society for Industrial and Applied Mathematics siam style The focus throughout this book is on the article style Further I shall be using defaults for almost everything concentrating on getting started with using TEX as quickly as possible Later some of the options like margin settings and other preamble specifications are covered as well as more advanced topics for customizing your document Are you ready to write your first INTEX document Copy the source file shown in Figure 2 and name it myfile tex Then at the command line enter latex myfile In an MS Windows system the command line is the DOS
28. postulates is that E mc72 A consequence of Einstein s postulates is that E mc 46 5 MATH MODE Table 9 Some Mathematical Operations Example Operation Symbol How it appears What you write subscript T3 x 3 superscript z x 3 multiply Ntimes axb aNtimes b divide div a b a div b 5 1 Mathematical Symbols The example also illustrates the use of the superscript operator Table 9 shows other common operations in math mode Each of the tables in this section applies only to math mode The braces enclose an expression that can be used to define a more com plex operand For example a b is written as x a b and x is written as x 1a 2 The order of subscripts and superscripts does not matter x atb c d gt 2 14 x c d _ a b gt xeta Table 10 shows some set notation The complement of A often appears as A produced by sim A but this is not universal notation some authors use A or A produced by A c and A7 prime respectively and some use A produced by overline A Preceding any symbol by not puts the line through the symbol as in the following examples A not subseteqB gt ACB x not in A cupB gt AUB A setminus B not supset B gt AMB ZB Table 10 Set Notation What it is How it appears What you write empty set Nemptyset intersection N cap union U cup set minus setminus element in Vin subset proper C subset subset or equal
29. tek or Lay tek is a col lection of macros built on top of TEX that represents a balance between functionality and ease of use 9 p xiii IATEX 2e is the current version developed by a team of volunteers Johannes L Braams David P Carlisle Alan Jeffrey Frank Mittelbach Chris Rowley and Rainer Sch pf 2 A comprehensive coverage of IXTEX and the many enhancements to it is given by the The IMTEX Companion 5 By contrast this book is designed to be a succinct introduction omitting many of the things ATEX 2e can do My goal is to offer enough of an introduction that someone not acquainted with ATEX or with TEX can write a term paper thesis or article using IXTEX 2e to produce high quality results Exercises are provided for guided instruction which should be just a few classes For one who is well acquainted with computers particularly unix the basics that are covered should take less than 10 hours and one could do all of the exercises For one who is just learning how to use a computer it will take longer especially getting used to functioning at the command line In any case the finer points require more study Happy ET EXing Harvey J Greenberg Denver Colorado Acknowledgments The author thanks the many contributors in the comp text tex newsgroup particularly Donald Arseneau Herman Bruyninckx David Carlisle Robin Fairbairns Jonathan Fine Denis Girou David Haller Dan Luecking Timo thy Murphy
30. to 2 ae ee end tabbing Sometimes we do not want to have the longest portion of text first yet it is needed to define the tab Table 5 illustrates how this is solved with the 2 6 Line Page and Word Breaks 23 kill command In the first tabbing the lines are in the order we want but the tab is set by the shorter string 1 3 making 4 6 8 extend past the tab The second tabbing puts the longer field first in order to set the tab correctly then specifies kill instead of to suppress or kill the printing of the line Table 5 The kill Tabbing Command What you see What you write begin tabbing 1 3 sting like a bee 1 3 sting like a bee 4 6 don t be late 4 6 8 gt don t be late end tabbing begin tabbing 4 6 8 don t be late kill 1 3 gt sting like a bee 4 6 8 don t be late 4 6 8 V don t be late MN end tabbing 1 3 sting like a bee Figures 29 and 30 illustrate the tabbing environment with fixed field widths It first uses the Nhspace command for horizontal spacing then it uses the name of the last field to set what follows begin tabbing X hspace 5in hspace 2in X Last field X kill gt Field 1 following tab 1 NN gt gt Field 2 on new line gt Last field MW gt gt gt Last field on new line end tabbing Figure 29 Tabbing Source Result in Figure 30 Field 1 following tab 1 Field 2 on new line Last field
31. where it is specified in the source if possible If there is not enough room it is to be located at the top of the following page Table 6 Figure and Table Location Options Option Meaning h Locate here where the environment is declared t Locate at the top of the next page b Locate at the bottom of the page or the next page if this page does not have enough room p Locate on a separate page called a float page which has no text only figures and tables The placement of a float is sometimes a source of frustration We might specify ht and find the float in an unexpected place perhaps on a page by itself One cause could be an accumulation of floats that should be cleared at some point before continuing This is done with the Nclearpage command This does the same as newpage except that it also prints all remaining floating objects It is also advisable to specify usepackage float in the preamble One of the enhancements is the placement option H which insists that the float be placed here note the capital H and no other option specified This option is used in many places in this book which is why you sometimes see pages with some blank space in the lower portion followed by a figure or table I did this to avoid confusion by having some float appear pages after it is cited and discussed The table environment is not to be confused with the tabular environment The latter makes tables but the table environ
32. 0x 50 Oy 0 Dx 10 Dy 5 dx 10 dy 5 ticks y lt gt 60 17 rput r 60 2 large score psline 1 0 1 6 10 6 10 0 rput 5 8 textsf F psline 11 0 11 2 19 2 19 0 rput 14 4 textsf D psline 20 0 20 11 29 11 29 0 rput 25 13 textsf C psline 30 0 30 8 39 8 39 0 rput 35 10 textsf B psline 40 0 40 5 50 5 50 0 rput 45 7 textsf A Figure 67 Source Code for Drawing Histogram of Test Scores After setting the units of measurement to 2mm the data file is read and its points plotted with the fileplot command Setting showpoints false 6 2 PSTricks 85 suppresses plotting the points in the psline commands The data file is plain text and has the following entries This is mydata dat 52 94 F 0 65 15 2 18 1 D 65 70 22 6 27 4 C 70 80 30 2 31135 4391 B 80 90 40 2 45 2 50 1 A 90 100 The plot itself is just the points specified by plotstyle dots There are other plot styles such as plotstyle line and there are 11 dot styles Here is one of the alternatives fileplot dotstyle plotstyle dots mydata dat gt Next axes are superimposed with the psaxes command psaxes params a xo yo 1 y1 22 ya where xo yo is the origin z1 y1 is the Southeast corner and 22 ya is the Northwest corner As in psline if xo yo is absent the origin is assumed to be at 0 0 If x1 y1 is absent i
33. 1 2 Graham Williams TgX Catalogue Online Technical report CTAN http www ctan org tex archive help Catalogue catalogue html Timothy Van Zandt PSTricks PostScript macros for Generic TeX World Wide Web http www tug org applications PS Tricks 1993 98 Index Bigg 63 Big 63 addtocounter 43 arraystretch 107 author 93 baselineskip 25 55 baselinestretch 25 108 bibliographystyle 36 bibliography 36 bigg 63 bigskip 11 big 63 boldmath 47 cdots 56 61 centerline 7 19 cite 37 clearpage 41 cline 16 dashbox 72 date 93 def 118 displaystyle 48 55 documentclass 1 93 dotfill 25 dots 8 dvi2tty 118 dvipdf 4 28 99 dvips 3 ensuremath 101 equal 108 fboxrule 42 fboxsep 42 fbox 9 41 55 71 74 footnotesep 99 frac 48 60 framebox 71 74 frame 9 hfill 10 12 25 hline 15 54 hrulefill 25 121 hspace 23 25 hspace 25 imath 114 input 101 117 itemsep 106 jmath 114 Will 23 label 39 53 left 56 117 linebreak 23 line 74 listoffigures 97 listoftables 97 makebox 72 makeindex 98 maketitle 93 mathbb 59 mathscr 59 mathfont 47 mbox 51 57 58 medskip 11 multicolumn 19 101 newcommand 36 100 118 newcounter 42 newenvironment 103 newline 24 newpage 24 41 newtheorem 61 62 nocite 37 nohyphens 24 noindent 10 nolinebreak 24 nopagebreak 24 oddsidemargin
34. 2020202 AA AN b2 b2 b2 b2 b2O b2 h2 h2h2 2 2 RP KH rR ee FP OWOONDTBRWNF 0 0 ONDUTUBRWNHF TOO ON TA KW b The Structure of a IATEX Document Your First ITEX Source File llle Command Sequence from Source to Postscript or PDF An Introductory Document Source Result in Figure 5 An Introductory Document Result Source in Figure 4 Positioning Paragraphs Source Result in Figure 7 Positioning Paragraphs Result Source in Figure 6 Centering Source Result in Figure 9 Centering Result Source in Figure 8 Some Font Sizes Source Result in Figure 11 Some Font Sizes Result Source in Figure 10 Skipping Line Spaces Source Result in Figure 13 Skipping Line Spaces Result Source in Figure 12 Description List Environment Itemize List Environment Result Source in Figure 15 Itemize List Environment Source Result in Figure 16 Enumerate List Environment Source Result in Figure 18 Enumerate List Environment Result Source in Figure 17 A 2x9 Table iuge Eon ide e o Gee A 2 x 3 Table with Horizontal and Vertical Lines A Table with Partially Spanning Horizontal and Vertical Lines Nested Tables Source Result in Figure 23 Nested Tables Result Source in Figure 22 parbox Source Result in Figure 25 parbox Result Source in Figure 24 Multicolumn Source Result in F
35. A Simplified Introduction to BT X Harvey J Greenberg University of Colorado at Denver Mathematics Department PO Box 173364 Denver CO 80217 3364 Harvey GreenbergUcudenver edu http www cudenver edu hgreenbe February 19 2006 Table of Contents List of Figures List of Tables Preface Acknowledgments Sources of TEX Software 1 Overview 2 Text 2 1 Fonts and Paragraphs 2 2 LAStS 5b eo a B Goon A y RUE o SUR XE dPs 2 3 Making Tables 0 e o Soa i eoa e 2 4 Special Characters o 2 5 T bbing 44 159 mh mx dr a eR ES 2 6 Line Page and Word Breaks 24 Spacing um obo cR RD wx b Rom m RO RR OE ee BXerclS68 za ke ak ew ee lt dem NOE ow ovo oue Wee d 3 Bibliography with BIBTEX 34 Overview ak cade ke n Roe Ee e e uA CAS B 3 2 The bib File ias ae bem x es oA owe E eR RE we bone 3 2 1 Main body 2 42223 868 bb ke ee 9o EE 3 2 2 Web citations 20 len 3 23 Additional features 2 04 3 8 Declaration and Citation 0 004 3 4 Some Controls 2 EXerciSeS a xoxo xv a 43 3 m Fe dod d eG ewe eed 4 Counters Labels and References 4 1 Basic Concepts ee 4 2 Intrinsic Counters scs o e e acs sie ai o OE k a o aa a a e a 43 Figures and Tables aaua aaa 44 Defining Your Own saaa aa e Exercises sonau d eac u duro c edsa uu ee d i iii vi viii ix ix 12
36. Big E mc72 Big gt E me Large E mc 2 Large E mel bigg langleE mc 2 bigg rangle s me 64 5 MATH MODE LARGE 1ang1e E mc 28 LARGES rangle E mc The remaining refinements use the amsmath package introduced on p 61 for obtaining better multiple integrals The gather and gather environments allow the new line specification in math mode They behave like the eqnarray and eqnarray environ ments respectively except the equations are not aligned Figures 55 and 56 illustrate this The same result with equation numbers is obtained by the gather environment begin gather a b 2 a 2 2ab b 2 NN cal L oplus M Warepsilon V HO A x My Aphi y cup_ fa in cal A Psi x end gather Figure 55 gather Environment Source Result in Figure 56 a b a 2ab Lcd eve A x y y UaeAV Figure 56 gather Environment Result Source in Figure 55 When writing a matrix within text we could produce p by spec ifying left begin array cc a amp b c amp d end array right An al ternative is with the amsmath smallmatrix environment 2 2 is obtained by left begin smallmatrix agb NN c amp d end smallmatrix right Note that there are no column specifications This is not equivalent to preceding the array specification with a text size environment in particular a scriptsize produces While the le
37. IATEX whose source is indicated by Figure 14 Basic Document Preparation Knowing how to setup the latex source file make paragraphs vary fonts and list items are enough to prepare a basic document without mathematics or tables like a resume Making Tables TEX provides a means to make tables with the tabular environment and its versatility puts it far ahead of word processors Bibliography Knowing how to create a bibliography in particular with BIBT RX Mathematics This is a power of IATEX and one reason why it has become standard in writing mathematical papers I will show you how to do virtually any mathematical expression in line with the text or in math display mode Graphics This has progressed a great deal in the past few years thanks to many people who have provided packages free of charge Other There are a great many things to learn beyond the simple introduc tion when using TEX to prepare a thesis report or article Two new things appear in the example the use of NLaTeX to produce IXTEX and the use of called tilde to enter a space Without the tilde the result would be IXTEX provides even with a space after NLaTeX in the source The reason is that a space or some delimiter is needed after LaTeX or any keyword in order to distinguish it completely and one might want a punctuation mark like a comma following NLaTeX which requires no space 2 2 Lists 13 begin description item Ba
38. NG SPECIAL PARTS Doing IATEX I M Rich U R Grand I C AI Smart University Street Smart Figure 77 Authors with same footnote Source in Figure 76 7 2 Abstract The abstract environment is in all document styles except article To have it specify titlepage as an option in documentclass even if you do not in tend to use maketitle This environment is defined to produce an abstract on a separate page placed wherever you put the environment specification with the header Abstract in boldface and centered The abstract itself is one paragraph and is printed without indentation Figures 78 and 79 il lustrate this Like the cover page the abstract is placed far from the top of the paper which is not shown in Figure 79 begin fabstract This shows that the ratio of the circumference to the diameter of any circle is the same constant value denoted pi We further prove that this constant is bounded by frac 223 71 lt pi lt frac 22 7 end abstract Figure 78 Making an Abstract Source Result in Figure 79 7 3 Other Front Matter 97 Abstract This shows that the ratio of the circumference to the diameter of any circle is the same constant value denoted m We further prove that this constant is bounded by E lt T lt 2 Figure 79 Making an Abstract Result Source in Figure 78 7 3 Other Front Matter The tableofcontents command makes a table of contents it is placed whereve
39. PPENDIX Table 26 Reference Tables Table Contents Text mode 27 Commands Environments for Font Appearance 28 Commands Environments for Controlling Position 29 Text Accents and Symbols 30 Commands for Counters 31 Commands Environments to Organize Document 32 Commands to Control Document Style Math mode 33 Commands to Control Fonts in Math Mode 34 Accents in Math Mode 35 Spacing Commands in Math Mode 36 Greek and Special Letters 3T Frequently Used Mathematical Symbols 38 Binary Operations 39 Operators and Quantifiers 40 Special Functions 41 Relation Symbols 42 Arrows 43 Dots Circles Triangles and Lines 44 Variable Size Symbols Table 27 Commands Environments for Text Font Appearance textbf textit textrm textsc textsf texttt tiny Scriptsize footnotesize small normalsize large Large LARGE huge Huge underline verb verbatim Table 28 Commands Environments for Controlling Text Position bigskip center centerline clearpage flushleft flushright hfill hspace hspace linebreak medskip newpage noindent nolinebreak nopagebreak pagebreak quotation quote raisebox samepage smallskip tabbing tabular verse vfill vspace vspace APPENDIX 113 Table 29 Text Accents and Special Symbols Va ufu c c X Nx e Nie Vian d d d z z i Vi HH b b b v Wivi o X fo 60 tfoo Mdots Nae ce Noe aa No E ME E NOE MA Q NO L AL KB ss i zs i 1 Table 30 Commands for Count
40. X Companion 5 6 1 Picture Environment If all we want is a series of boxes and arrows we can do this simply with fbox and a long arrow in math mode as follows fbox left longrightarrow fbox center longrightarrow fbox right gt left center right The framebox command can be used instead of fbox to produce the same result However framebox also has two optional arguments to control the length of the box and the position of the text within it For example framebox 2cm 1 left longrightarrow framebox 2cm c center 7 longrightarrow framebox 2cm r right gt gt left gt center right The at the end of the first line is to avoid having a blank between the center box and the longrightarrow that follows it The first optional argument of this framebox command is the width of the box given as 2 cm for each box The second optional argument is the position of the inscribed text 1 left c center and r right We can make the contents of a box obey all paragraph controls in text mode by the parbox command By itself it lets us stack short phrases 72 6 GRAPHICS top like middle note how the paragraph spacing adjusts Combined with bottom framebox we can create vertical diagrams easily as illustrated in Figures 59 and 60 begin center parbox 2cm framebox 2cm top NW c
41. Z gt Z Integer values mathbb Q gt Q Rational values TIn math mode Another alphabet is mathscr for which you specify usepackage mathrsfs in the preamble This gives the following alphabet mathscr ABCDEFGHI JKLMNOPQRSTUVWXYZ ABCDEFGH I fJ LMNCPIRS TUVW KYE In particular Z is often used to denote the Laplace transform or the Lagrangian 60 5 MATH MODE and is sometimes used to denote the Hamiltonian Compare with mathcal H which is also used by some authors 5 5 Derivatives and Integrals We can express a total derivative df x dx by writing df x dx or we can use the frac command to produce do The partial derivative symbol is written Xpartial so you can write Npartial f x partial x to produce O0 x 0x and large frac partial f x partial x to produce or The usual notation for the gradient of a function is the nabla denoted by the symbol V also called del which is an upside down delta introduced by Hamilton in 1853 In IATEX it is produced by nabla and its mathematical definition is the vector of first partial derivatives V f x 8f z 01 Of z 0v 5 Ileave it as an exercise to show the IATEX code that produced equation 5 The Hessian is the matrix of second partial derivatives vio L This was produced by the following code XT Nbeginfarray3 111 nabla 2f x amp amp left displaystyle frac partial 2f x
42. able in a long report To make an index we have three things to put into our source file 1 Put usepackage makeidx in the preamble 2 Put makeindex at the end of the preamble 3 Put printindex just before end document After a successful compilation with all references resolved enter at the command line makeindex myfile Then compile again This is analogous to the use of bibtex p 28 and is illustrated in Figure 81 To have entries in the index you use index entry For example the index in this book contains several occurrences of flushleft In the text 7 5 Footnotes 99 at each occurrence I specify index flushleft To put the entry as a subordinate use For example index package makeidx puts the entry makeidx under the entry package create edit view print print post compile convert latex dvips myfile tex myfile dvi myfile ps dvipdf myfile pdf makeindex Figure 81 Adding makeindex to the Command Sequence There are packages to make other back matter acronym makes a list of acronyms nomencl makes a list of nomenclature and gloss makes a glossary 7 5 Footnotes The thanks command is one way to have a footnote on the cover page and was shown on page 95 More generally the footnote command can be used anywhere Figures 82 and 83 illustrate Here is my first footnote footnote first here is my second footnote second Figure 82 Setting a Footnote S
43. ackage graphicx pst all graphics usepackage hyphenat enables control over hyphenation usepackage fancyvrb moreverb verbatim usepackage float enable float H option usepackage T1 fontenc to write textbf textsc usepackage ifthen ifthenelse condition true false usepackage makeidx index usepackage mathrsfs more math symbols viz mathscr usepackage multirow like multicolumn usepackage theorem enables more control over newtheorem usepackage url A Nur scone renewcommand contentsname Table of Contents Change Contents renewcommand url begingroup urlstyle sf Url put url in sf font input mydefs My commands and environments makeindex 4 make myfile idx input to makeindex at command line Figure 94 Most of the Preamble for this Book Appendix This contains complete tables of font information and basic IXTEX commands It is designed like a reference manual for easy lookup beginning with Ta ble 25 which gives conversion among three common units of measurement Table 25 Conversions of Common Units of Measurement pt in cm pt 1 01384 03515 in 72 27 1 2 54 cm 28 45 3937 1 Table 26 is a guide to how most of the remaining tables are organized Afterwards Table 45 gives special symbols that can be used in either text or math mode and Table 46 gives the commands for the picture environment 112 A
44. add the radius which is 2 since 2 is the diameter specified by circle 2 Thus the position of the arrowhead is zy yn Lt ye Ye r 65 1 5 1 65 4 and we set len Ay 4 which is what is specified lt vector 0 1 4 The next arrow is double headed so we use two Nvector commands to draw one arrow left to right then an arrow at the same end points but drawn right to left Further this involves more calculations because the arrow is not simply horizontal or vertical We begin the same way by computing the coordinates of the tail and head The left end point is at the y coordinate of the center of the circle and its z coordinate is to the right by the length of the radius 11 y1 e r yc 65 1 1 55 1 so that is where we put the first arrow The head is to be flush with the left edge of the fbox and this needs some trial and error The uncertainty is the width of the box we know only that the center of the box was put at 0 1 but we 6 2 PSTricks Tr do not know the width of the box With just a few iterations the end point was determined to be x 0 so len Ax 55 The reverse arrow begins at 0 1 and its slope is 1 0 which is why we have vector 1 0 55 The last vector also required trial and error due to not having the corner of the oval coordinates In this case the end points were determined to
45. all that is needed so you must obtain the PS Tricks User s Guide 15 a Graphic view of Pythagorean Theorem square of hypotenuse square of leg 2 hyplegeftuse square of leg 1 92 6 GRAPHICS b Network with arc data 2 4 45 851885 50 45 60 3 9 c The sin function y sin Zr X d Bernoulli family tree Nikolaus 1623 1708 Jacob I Nikolaus Jahann I 1654 1705 1662 1716 1667 1748 Nikolaus I Nikolaus II Daniel Johann II 1687 1759 1695 1726 1700 1782 1710 1790 Johann III Jocob II 1746 1807 1759 1789 93 7 Making Special Parts T 1 Cover Page The easiest way to make a cover page is with the Nnaketitle command This is usually done just following begin document The necessary pa rameters are author and title which can be defined anyplace before the maketitle Typically these are put into the preamble or right after begin document followed immediately by maketitle it depends upon your management style If you see a page number on your cover page suppress this by adding thispagestylefempty right after maketitle You might also need to initialize the page counter with setcounter page 0 Multiple authors are separated by and such as in the example shown in Figures 71 and 72 The jagged edges in Figure 72 mean that there is more space between the title and the top of the paper Specifying date is optional maketitle puts in the current date if the date i
46. ame as skipping one line it starts a new paragraph 1 2 Here is another subsection 2 Here is another section Figure 5 An Introductory Document Result Source in Figure 4 2 1 Fonts and Paragraphs Figure 6 shows the source to produce different paragraph positions cen tered flush left flush right and justified the default Note that these are environments a concept you need to understand about ATEX The general form of an environment uses the following syntax Xbegintenvironmenty Vendi environment begin center The text is centered because I have entered the center environment Text remains centered as long as we remain in this environment end center begin flushleft Now we are out of the centering environment and have begun the flushleft environment end flushleft begin flushright This is another paragraph but in the flushright environment You will have occasion to use all four paragraph positions end flushright I am back to normal justification The added space you see between the above paragraphs is due to entering those environments Figure 6 Positioning Paragraphs Source Result in Figure 7 2 1 Fonts and Paragraphs 7 The text is centered because I have entered the center environment Text remains centered as long as we remain in this environment Now we are out of the centering environment and have begun the flushleft environment This is another paragraph but in th
47. an be printed You can alternatively or also convert the dvi file to a pdf file by the command dvipdf myfile These steps are given in Figure 3 Execute these commands for the source file shown in Figure 2 The result should be one line of output Hello World Congratulations create edit view print print post compile convert latex dvips myfile tex myfile dvi myfile ps dvipdf myfile pdf Figure 3 Command Sequence from Source to Postscript or PDF Now change your document to specify a font size of 12pt default is 10pt by changing your first line to the following documentclass 12pt article The pt abbreviation for point is one of the units of measurement about 1 771 other units used in many parts of IATEX are in inches cm centime ters and em like the letter m which is a printer measure equal to the width of M in the current font This book is designed for quick entry into using TFX but do not be reluctant to read the last chapter It tells you how to define your own com mands and how to separate them into an input file that simplifies changing things like notation I also cannot elaborate just yet on using packages indicated in Figure 1 except to say that they are used to fulfill some func tion and I shall introduce specific packages throughout this book One of the strengths of IATEX is the community of people who provide packages for everyone to use at no cost The orientation her
48. an enclose mathematical expressions in a box sometimes used for empha sis For example fbox beginfarray 1cl MdisplaystyleNMint O Minfty xe7 tau x dx amp amp displaystyle frac 1 tau NN NN amp amp NdisplaystyleVoint a b tc Psi x dx end array re dx a 0 T b e j V x de We can use fbox within math mode such as writing x Mfboxiy z to produce x y 2 Note how the line height does not adjust to the frame causing an undesirable clash This could be overcome by putting a vertical space command just after the expression In particular putting vspace 2 baselineskip after x y z causes extra vertical space equal to 20 of the value of baselineskip which is the height of one line of normal text In the longrun it is better to use parameters like Nbaselineskip rather than absolute measurements for spacing because the former takes into account the font size which you might change 56 5 MATH MODE Now consider the following conditional assignment 1 if lt 0 Ha 0 if 0 l if x gt 0 produced by the following IATEX code f x left beginfarray r11 1 amp mbox if amp x lt 0 NN O mbox if x 1 amp mbox if amp x gt O end array right ll o MN Note the use of right after the array This is because left and right must balance i e there must be an equal number of each
49. ata file and Bezier approximations of four points are available Another widely distributed picture drawing system is MetaPost 6 7 written by John D Hobby also provided free of charge It is more difficult to learn than PSTricks but MetaPost is more open ended in its design which makes it potentially more versatile especially on varying the types of file outputs PSTricks is tied to postscript In particular pdf latex not covered here see 4 does not work with PS Tricks but it does with MetaPost There are many packages 4 typically available free of charge that do many of the things done by PS Tricks and some additional things Many of these are described in The ATEX Companion 5 All of the pst commands have options to override default settings for relevant parameters The defaults themselves can be set with the psset command psset parameter value For example the default unit of measurement is 1 cm and the default fill color is white but we can change them by specifying Npsset unit 1in fillcolor gray A fundamental command in pst is rput but unlike the put command in the picture environment this is not the only way to put objects The commands themselves can specify where to put them Table 19 gives 6 2 PSTricks 79 some of the common commands to draw objects and lines For those ex amples the unit of measurement was set to 1 mm For each command we can specify relevant options as paramet
50. be from 1 2 895 to 1 6 5 The former was found by trial and error but the latter was computed by knowing that the bottom right box starts at 1 5 and has a width of 1 2 so the midpoint of the bottom edge is at 1 6 5 Now the true slope of the line we want is SEN but the restrictions do not allow this The closest slope we can have is with Az Ay 1 1 which is what is specified Given this slope the best choice of len can be found as the average of the deviations len 4 4 395 3975 Thus we specify line 1 1 3975 to obtain the line shown in Figure 61 There are packages to extend the picture environment and we can plot curves called Bezier approximations to a set of points However I shall cover these in the next section with a powerful package called PSTricks Table 46 in the Appendix p 117 gives the commands in the picture environment but here are some things to note e Only boxes can have inscribed text the circles and ovals require sepa rate put commands which can take some trial and error to position e Some calculations and some trial and error are needed to align objects and lines e Moving a portion of the picture can be tedious requiring re calculations and more effort for the new positions e There is no direct way to control the size or style of the arrow heads and there is very limited control over line thicknesses These can make using the picture environmen
51. before the text and end quote after it 10 2 TEXT The construction of the real number system notably by Dedekind cuts was motivated by the need to fix calculus which ran into trouble due to insufficient rigor in dealing with limits The quote environment is intended for short quotes generally one short paragraph as above or a sequence of one line quotes separated by blank lines The quotation environment is used for long quotations having more than one paragraph separated by blank lines The indentation is the same as the quote except the first line of each new paragraph is indented Just as in the regular text this can be overridden by the noindent command Here is an example that was created by putting begin quotation before the text and end quotation after it Computers do not dream any more than they play We are far from certain what dreams are good for but we know what they indicate a great deal of information processing goes on far beneath the surface of man s purposive behavior in ways and for reasons that are only very indirectly reflected in his overt activity Alan M Turing There are reports that many executives make their decisions by flipping a coin or by throwing darts etc It is also rumored that some college professors prepare their grades on such a basis Sometimes it is important to make a completely unbiased de cision this ability is occasionally useful in computer algorithms f
52. cause the labels must be unique We cannot for example have two entries with tex as their label Here are two styles I have seen which you might consider Form Example author year knuth 89 author first keyword in title knuth tex With two authors you can put both of their names with more than 2 you can add et al Linguistically the use of the Latin et al in formal writing follows this rule In the first form if there are two publications by the same authors in the same year some people add a b after the year no blank In the second form if there are two publications by the same authors in the same year some people add another keyword You must discover what style works best for you Before listing each style article is one style and the fields they can or must have author is one field here are a few things to note e The label is arbitrary but do not use any IATEX special characters or blanks In the example the label is specified as tex and it must be followed by a comma Also labels are case sensitive so tex is not the same as TeX e Each bib entry must have a unique label so it can be cited without ambiguity in the source file 30 3 BIBLIOGRAPHY WITH BIBTEX e The order of the fields is arbitrary and fields are separated by commas hence the comma after the terminal quote The last field does not require a comma at the end but it will not hurt anything and it gives flexibility if you want
53. culties are overcome by specifying address Nurl http www columbia edu acis bartleby strunk The Nurl specification is not actually an intrinsic command in IATEX it is defined in a package Its main use is to determine where the url can be broken in order to put it on two lines if needed Another feature of the url package is that url prints special characters like To have the url command active in your document put the following declaration into your preamble usepackage url The default font it uses is tt but you can change this to TimesRoman or sans serif font with the specification urlstyle rm or urlstyle sf respectively There are occasions when we want to reference an entire web site One example is the IATEX 2e reference 2 given by misc latex2e author Johannes L Braams and David P Carlisle and Alan Jeffrey and Frank Mittelbach and Chris Rowley and Rainer Sch o pf title LaTeXe and the LaTeX 3 Project 34 3 BIBLIOGRAPHY WITH BIBTEX howpublished World Wide Web url http www latex project org latex3 htm1 year 1994 We have seen several packages so far and you shall learn more about packages in 86 where I describe enhancements for having graphics in ATEX However this is the first use of renewcommand about which I shall say more when I describe ways to customize your document in 3 2 3 Additional features One element of good style is to be consistent i
54. d postscript eps An exceptionally clear description of this including his torical context is given by Keith Reckdahl 12 He also goes deeper into customizing placements of pictures in figures Many systems that let us draw figures and those that plot mathematical functions or data have an option to export an eps file If you can get a ps file you could use psfig or there is a unix conversion utility ps2epsi On unix xfig is an excellent system to draw figures and the export options in clude the eps file format A basic plotting system for functions and data for both unix and DOS that produces eps files is gnuplot This is avail able free of charge at FTP ftp dartmouth edu pub gnuplot Octave ex tends the capabilities of gnuplot and is also available free of charge at http www che wisc edu octave There are also commercial systems like Maple Mathematica9 MATLAB and S PLUS which can produce eps files of plots Another way to obtain an eps file is with conversion The unix systems xv and Image Magick can do this for a large variety of graphic file formats including bitmap xbm gif and jpeg files There are free conversion systems on MS Windows notably jpeg2ps which converts jpeg files to eps and emftoeps which converts Windows Metafiles wmf to eps Once the file is in eps format we can import it using the Graphics Bun dle 3 written by David P Carlisle provided free of charge It comes with MiKTeX
55. d in the source renewcommand labelenumii theenumii the ap pearance parameter is labelenumii These changes remain in effect called a global setting so we must change them back if we want to restore the defaults shown in Table 8 44 4 COUNTERS LABELS AND REFERENCES renewcommand theenumi Roman enumi renewcommand theenumii Alph fenumii changes numeral type renewcommand labelenumii theenumii changes appearance Xbeginfenumerate Mtem Introduction Mitem Terms and Concepts begin enumerate item Groups and fields item Picnics and frolic end enumerate end enumerate Figure 36 Alternative enumerate Symbols Source Result in Figure 37 I Introduction II Terms and Concepts A Groups and fields B Picnics and frolic Figure 37 Alternative enumerate Symbols Result Source in Figure 36 Table 8 Default Settings for enumerate Counters What Counter changes Command enumi numeral renewcommand theenumi arabic enumi label renewcommand labelenumi theenumi enumii numeral renewcommand theenumii alph enumii label renewcommand labelenumii theenumii enumiii numeral renewcommand theenumiii roman enumiii label renewcommand labelenumiii theenumiii enumiv numeral renewcommand theenumiv Alph enumiv label renewcommand labelenumiv theenumiv Exercises Submit a printed copy of the IATEX source tex file and printed copy o
56. dding one line at a time and observe each effect begin center psset unit 1cm Nodes Xcnodeput 2 0 1 1 cnodeput 0 0 2 2 cnodeput 2 1 3 3 cnodeput doubleline true 2 1 4 4 pnode 3 0 f1tail ncline gt 1itail 1 tailess arc into 1 Arcs with labels ncline gt 1 2 aput U 1 2 Naput puts label above arc ncline gt 2 3 aput U 2 3 ncline gt 2 4 bput U 2 4 bput puts label below arc ncarc gt 3 4 Aput small 3 rightarrow 4 Aput keeps ncarc gt 4 3 Aput small 4 rightarrow 3 label horizontal ncloop angleB 180 loopsize 5 arm 2 linearc 2 gt 3 3 Bput 5pt loop Bput keeps label horizontal and 5pt is 4 the space added between label and arc ncloop angleA 180 loopsize 5 arm 2 linearc 2 lt 4 4 Bput 5pt loop end center Xvspaceticm Figure 65 Graph Source Result in Figure 66 6 2 PSTricks 83 Figure 66 Graph Result Source in Figure 65 Now I describe curves that go through perhaps approximately given points The examples that follow use the following pst settings psset unit 5cm showpoints true The showpoints true setting is what causes the points to be included in the picture you see We begin with the parabola whose command syntax is parabola a xo yo z1 y1 where zo yo is one point on the parabola and x1 y1 is the unique point having dy dx 0 parabola specifies fi
57. dinate is xo len Then the new y coordinate is yo len Qe The actual length of 2 the line segment is leny 1 22 yo Ay slope AU y yo lena New point Original point Yo To xo len zo Ax Figure 63 Line Parameters As if this unnatural definition of the line segment were not enough there is an important restriction Az Ay must be integer valued and within 6 to 6 Suppose our original point is zo yo and we want our destination point to be a y If zx xo the calculation is simple set Ax 0 len yr yo and _ l if ye gt yo Ay 1 otherwise If x Z zo we could have problems with approximating the results Suppose for example we want xz yz xo 1 3 yo 1 5 If we we set len 1 3 to obtain the correct x coordinate how should we set the slope parameters Ideally we would set Re 12 but the restrictions do not permit this The closest we could come is A Fixing len x Xo then searching for a nearest slope approximation is not necessarily the best overall approximation We could setup a least squares estimation problem but trial and error in selecting the parameters tends to be just as efficient Either way we have some work to do The first vector command in Figure 62 starts at 65 1 which I calculated to be from the top left box to the center box 76 6 GRAPHICS width height box begins here
58. ding the math mode with large The general form is frac numerator denominator where the numerator and denominator can be any expression Here is a more complex equation in math display mode A x s written as NL A frac x72 y_ alpha 1 frac eta x72 1 M Note how the sizes of the fractions adjust automatically Some mathematical symbols adjust their size to fit the expression Table 12 shows some of the most common of these and I present more examples below In the case of the integrals note the use of between the integrand and dx This inserts a thin space compare the results by writing the expression with and without the ln JATEX symbols whose size you would want to adapt to expressions are gen erally designed to do so Figures 38 and 39 illustrate this with another example which uses the sqrt and prod functions NE sqrt frac prod_ n 1 N left sum_ i in I n x i nWMight sqrt 3 sum_ i in I Minfty x_i M Figure 38 Variable Sizes Source Result in Figure 39 N ID er x V Pers Ti Figure 39 Variable Sizes Result Source in Figure 38 Notice that even though it is written in math display mode the indices on the sums and product appear as they would in line IXTEX compilers make judgments about the layout but you can force either of the two styles with the displaystyle and Ntextstyle commands Figures 40 and 41 illustrate this 5 2 Fractions and Variable Size Functio
59. e equation numbering To illustrate Figures 45 and 46 show how to present a matrix equation Also note how z is specified Table 15 shows other ways to denote the transpose of a vector Table 15 Transpose of a Vector What you write How it appears x gt a xt gt y x T gt gl x mathsf T gt af x WnboxfNtiny T gt a Xbeginfequation Ax7 prime left beginfarray rrr 1 1 amp 1 2 1 3 21 0 amp 22 0 amp 2 1 NN Vend array Night left beginfarray cc x_1 x 2N x 3 endfarray right end equation Figure 45 Matrix Equation Source Result in Figure 46 T1 11 12 13 I Ar 910 220 21 e X3 Figure 46 Matrix Equation Result Source in Figure 45 Array environments can be nested as illustrated in Figures 47 and 48 Notice how the vertical line was drawn by the column specification c c and the hori zontal line separating the blocks is obtained by specifying hline before the second row of the outer array 5 3 Arrays and Equations 55 Meft beginfarray clc beginfarray ccc A 11 amp A 12 A 13 NN A 121 amp A 22 amp A 23 Vend array amp O NN hline O amp beginfarray cc B 11 B 12 NN B 21 B 22 Vend array Vend array right Figure 47 Nested Arrays Source Result in Figure 48 Ai Az Ais 0 Az Az 423 0 Bi Bi Ba B Figure 48 Nested Arrays Result Source in Figure 47 We c
60. e flushright environment You will have occasion to use all four paragraph positions I am back to normal justification The added space you see between the above paragraphs is due to entering those environ ments Figure 7 Positioning Paragraphs Result Source in Figure 6 Instead of the center environment you can use the Ncenterline com mand they differ in that the environment skips a line before and after the paragraph shown in Figures 8 and 9 This precedes center environment begin center This line is centered end center This continues after centering This precedes centerline centerline This line is centered This continues after centering Figure 8 Centering Source Result in Figure 9 8 2 TEXT This precedes center environment This line is centered This continues after centering This precedes centerline This line is centered This continues after centering Figure 9 Centering Result Source in Figure 8 You can also suppress indentation of the first line of a paragraph with the Nnoindent command Here is an example noindent This paragraph is not indented produces This paragraph is not indented Table 1 lists the fonts that are intrinsic in a basic latex installation More fonts are available in packages usually free of charge In technical writing you will have particular use for the italic font as it is used when introducing a new term For example A textit grou
61. e is by function beginning with how to write text 2 Text We begin by illustrating the most common text formatting much like you would want in a word processor The power of IATEX will be evident when we get to mathematical expressions but even some text especially tables will demonstrate the superior quality of the IXTEX results First consider how to make sections and subsections in article style Figure 4 is the source that produces the result in Figure 5 showing how sections and subsections are defined Note the automatic numbering and how extra spaces and blank lines have no effect documentclass 12pt article 4 We have defined the document to be an article using 12 point font Blank lines mean nothing here in the preamble begin document Begin document environment section This is a Section subsection This is a subsection This is the body of the subsection I can move to a new line anytime and I can put in lots of blanks with no effect Skipping four lines is the same as skipping one line it starts a new paragraph subsection Here is another subsection section Here is another section end document Figure 4 An Introductory Document Source Result in Figure 5 6 2 TEXT 1 This is Section 1 1 This is a subsection This is the body of the subsection I can move to a new line anytime and I can put in lots of blanks with no effect Skipping four lines is the s
62. e statements whose truths are established relative to the underlying logic This is so fundamental that LXTEX has the facility to define a special environment that includes a keyword like Theorem and a name which is not only the name of the environment but is also the name of the associated counter Consider the following example Theorem 5 1 For n gt 2 there is no solution to z y z for T Y 2 Zi Notice how Theorem 5 1 appears all text is in italic and we have the counter value thetheorem 5 1 This was defined in the preamble by newtheorem theorem Theorem section Then the theorem was produced by the following IATEX code begin theorem For n gt 2 there is no solution to x n y n z n for newline x y z in LZ_ end theorem 62 5 MATH MODE Other theorem like environments can be defined to have the same properties This requires both a keyword like Theorem and a unique name for the environment like theorem also used as a counter Here is the syntax newtheorem name tkeyword within The name defines the environment name and it defines a counter so it must be different from all other environment and counter names The within option defines the counter to be within some other which can be intrinsic or some other counter defined by the newcounter command p 42 or by some other newtheoren In this document I defined the theorem environment to be numbered within the sec
63. eJ keK keK Another package in the ams family is amscd which makes it easy to draw commutative diagrams Figures 57 and 58 illustrate this Specify Nusepackagefamscd in the preamble The horizontal arrows are specified by gt gt gt left to right with any expression placed above or below The 66 5 MATH MODE vertical arrows are specified by VVV down or CAAA up with an expression placed to its left or right All possible horizontal and vertical placements are illustrated begin CD A gt a gt gt B 0 gt gt gt C NN alpha VV beta V gamma CAAA QVVVNdelta NN D gt gt d gt E gt e gt gt F end CD Figure 57 Commutative Diagram Source Result in Figure 58 A Wc B mn aja Y lo De oy E a Figure 58 Commutative Diagram Result Source in Figure 57 There are many more refinements and more packages to make things nicer Many of these are described in The ATEX Companion 5 Chapter 8 and you can see an online catalog of packages at CTAN 4 5 8 Grammar When writing mathematical expressions people make some common errors The general guide is to treat a mathematical expression linguistically In English this means that every sentence has a subject and predicate clauses are separated by commas and phrases are appropriately punctuated Here are some of the most common elements of grammar to consider 1 Punctuate math display mode The expression usually needs a comma or period F
64. ecedent A ends and the consequent C begins In English however this is not correct 6 Equivalence needs commas The expression A if and only if B should be written as A if and only if B Exercises Submit a printed copy of the IATEX source tex file and of the associated postscript result ps file Be sure your name is on each Lookup special symbols in the Appendix 1 Produce each of the following in math display mode a x B AAC implies z y B AAC b If AF 44 Fh it follows that A 2E 4 AF TEN c geld x i r20 0 otherwise 2 Produce the following in math display mode with the array environ ment and or with the eqnarray environment A Fa P2 2F p41 En 2Fn Fa 3 Produce each of the following formulas in line with text construct your own sentences that contain them and include proper punctuation a In e z b sin 0 27 sin 0 68 5 MATH MODE c te DE 9i gt Una Dy Tia Fa 9 ft E n 0 q gf fau fe f Mtgen 0 6Mn0 M re 4 Produce the following equation in math display mode 11 1 2 El an az J E a f ae 21 22 23 bi b2 bg A 0 5 Produce the expression in the Preface 6 Produce equations 5 and 6 7 Produce each of the following expressions a z y mod n z y kn for some k 0 1 NETO b dic z y 8 Produce each of the following in line with text that you compo
65. ecedes or equals x preceq succeeds gt succ succeeds or equals e succeq We have seen how to embed math mode into text but we can also do the reverse with the mbox command Compare each of the following zi lt Oforalli 1 written as x i lt O for all i 1 dots xi lt 0 for all i 1 written as x i lt 0 for all i 1 dots xi lt 0 for all i 1 written as x i lt O mbox for all i 1 dots The first line points out that blanks mean nothing in math mode and all letters are in the math form of italic not quite the same as the italic in text mode The use of mbox is particularly convenient in math display mode which I shall illustrate in the next section 5 3 Arrays and Equations The array environment is to math mode what tabular environment is to text mode and more It has the form 52 5 MATH MODE beginfarray column specs options first row spec NN last row spec NN options end array The column specifications and options are the same as in the tabular environment but the body is in math mode The following table has text headers and math body so it can be generated in either of two ways with the tabular environment using the math mode designation for each body entry or with the array environment using mbox for each header entry Variable Current Value Limit x 1 234567 1 y 9 87 12 2 This can be generated by either of the following two ways begi
66. ed with default parameter values 4 4 Defining Your Own In the preamble you can define your own counter with the newcounter command newcounter name within where name is the unique name of the counter cannot be the same as one of the intrinsic counter names The initial value of the counter is 0 For example newcounter mycounter defines a counter whose name is mycounter You can also define the counter to be within another counter For example newcounter mycounter section defines mycounter to be within the section counter This will cause the value of mycounter to be reset to 0 when entering a new section Further instead of the printed values being 1 2 they will be 1 1 1 2 within section 1 more generally the values of mycounter will be of the form s 1 s 2 when printed within section s The counter values are printed in Arabic numerals but you can specify the type of numeral shown in Table 7 44 Defining Your Own 43 Table 7 Numerals to Print Counters What you see What you write a b c d alph mycounter A B C D Alphi mycounter Pe Dp ids 4 arabic mycounter 1 d Hb Wea roman mycounter I IL HI IV Roman mycounter Counter values can be incremented with the addtocounter command For example addtocounter mycounter 1 adds 1 to the value of mycounter If we just want to increment the counter by 1 we can specify stepcounter mycounter Counter
67. ee Exercise 1 The first put in Figure 62 specifies the position at the origin and the stuff is a filled circle with diameter 1 inches centered at the origin put 0 0 circle 1 gt e The next three commands put three different kinds of boxes each be ginning at 5 inches below the origin ie y 5 The first is similar to framebox in text mode but its syntax is different In picture mode it enables control over not only the width but also the height and this ex tends the position options to a second character t top b bottom The 74 6 GRAPHICS general form of the framebox command in the picture environment is as follows framebox width height posn text In the example shown in Figure 62 the specifications are width 7 inches and height 3 inches the position is centered because that is the default The next put puts a dashed box having the same dimensions as the framed box with the length of the dash set to 01 inches The next dashed box has the dash length set equal to 1 inches resulting in fewer dashes to compose the box The box length is set to 1 2 inches and the text is at the bottom right because of the optional specification br Now we come to the circle specification located at coordinates 65 1 from put with diameter 2 inches The 1 inside the circle required an other put and some trial and error was needed to establish its position We know the ce
68. effect e This is item 2 and we shall limit to just this few A blank line within an item does create a new paragraph using the indentation of the itemize environment A second nested itemized list changes the bullet and indents another level Figure 16 Itemize List Environment Result Source in Figure 15 14 2 TEXT begin itemize item This is item 1 and our task has just begun Blank lines before an item have no effect item This is item 2 and we shall limit to just this few A blank line within an item does create a new paragraph using the indentation of the itemize environment begin itemize item A second nested itemized list changes the bullet and indents another level end itemize end itemize Figure 15 Itemize List Environment Source Result in Figure 16 Finally I describe the enumerate list environment where the default numbering is with Arabic numerals With nested enumeration the number ing changes at each level Figures 17 and 18 illustrate with three levels of nesting begin enumerate item This is item 1 and we are having fun item This is item 2 and it s time to number anew begin enumerate item Back to item 1 but we are not yet done item Two is new begin enumerate item One again item Two b or knot 2b end enumerate end enumerate end enumerate Figure 17 Enumerate List Environment Source Result in Figure 18 2 8 Making Table
69. efix subsec here This helps me to distinguish labels for different things For equations I use the prefix eqn Some people use this same form but with different prefixes such as ss for subsection and e for equation You can choose any labeling convention that is meaningful to you If you have a lot of labels and need to keep track of them by printing each label and citation in your drafts see the showkeys package at CTAN 4 4 3 Figures and Tables In this section I describe figure and table environments which have the same syntax begin figure options begin table options caption caption label label caption caption label label F eapetent caption label label Neapetant caption labe1 label end figure end table The caption if present can go at the top or bottom where you put it is where it will appear The label to reference a figure or table is put inside the caption If you put it outside the caption as given in 9 it will not be understood even though you will get no error message Because figures and tables are not split their exact location depends upon how much room there is For that reason they are called floating objects or floats The environment options define where the float is to be located The four choices 4 3 Figures and Tables 41 are shown in Table 6 In this document most tables and figures are specified with ht which means they are to be placed here the place
70. ent The reason is that we can maintain one large bib file and write many documents that use it There are times when we want to be sure a particular bib entry appears but we do not want to cite it in the text This is done with the nocite command In particular if we want to have every entry in our bib file appear we specify nocite If we want only some particular list of entries to appear we use nocite with their labels such as nocite tex to be sure Knuth s TEX book appears even if it is not cited explicitly Figure 32 shows a complete source file for having all entries in mybiblio bib appear and that is the entire document Xdocumentclass 12pt article begin document nocite bibliographystyle plain bibliography mybiblio end document Figure 32 A Document to Print the Bibliographic Database We can specify more than one bib file such as bibliography mybiblio another The bibtex program will search them sequentially for any citation If we have the same label in both bib files the entries must be identical otherwise we will get a fatal error message Repeated entry telling us which label is repeated If we have the same entry with different labels they will appear twice if both labels are used or if we used nocite 3 4 Some Controls You might want to have the bibliography single spaced even if the main document is spaced differently Just before the bibliography statement put
71. enterline downarrow NN framebox 2cm middle NN centerline downarrow NN framebox 2cm bottom end center Figure 59 Vertical Diagram Source Result in Figure 60 top i middle bottom Figure 60 Vertical Diagram Result Source in Figure 59 The boz created by parbox has its center aligned with the text but it has an optional argument to align its top or bottom with the text This is done by specifying Nparbox t width text or Nparbox b width tezt respectively These commands can be combined along with other box commands but there is a need for more versatility like ovals and diagonal arrows and more control over positioning A basis for this is the picture environment To begin Figure 61 shows a more elaborate chart which was created by the picture environment whose source is shown in Figure 62 Going through its parts will serve to explain the various commands center bottom right a C Figure 61 Variety of Objects in Picture Environment The first command begins a center environment and I use the setlength command to set the units of measurement to be 1 inch This means that when 6 1 Picture Environment 73 begin center setlength unitlength 1lin begin picture 0 0 put 0 0 circle 1 Xput 0 5 framebox 7 3 center put 1 5 dashbox 01 7 3 tl top left Xput 1 5 das
72. er value For example to produce a solid circle with radius 1 cm centered at the origin we write pscircle fillstyle solid 0 0 1 having already set fillcolor gray The origin is determined by where you are when issuing a pst command no environment is entered Thus I can put that circle right here All commands use the linewidth parameter to control the thickness of the lines used in the drawing and objects that could be made solid like boxes and circles use the fillstyle parameter I shall illustrate the commands in Table 19 first showing the ease and versatility of PSTricks then I shall show some additional shapes and commands This is meant to be an introduction so many features are not presented here The User s Guide 15 is freely available and clearly written Table 19 Some Basic Drawing Commands in PSTricks psframe xo yo Gri yi Draws rectangle with a corner at psframe 0 1 10 2 o Yo and opposite corner at 21 y1 pscircle z y r Draws circle centered at x y with pscircle 5 0 2 radius r psellipse z y rz ry Draws ellipse centered at x y with horizontal radius r and psellipse 3 0 5 2 vertical radius ry psline a xo yo n Yn Draws line or arrow determined by a psline 0 0 10 0 no arrow gt forward arrow psline lt gt lt gt double arrow lt backward arrow 0 0 5 2 1 0 there are more along path given by psl
73. ers addtocounter label newcounter pageref ref refstepcounter setcounter stepcounter thecounter value Table 31 Commands Environments to Organize Document abstract addcontentsline addtocontents appendix bibliography bibliographystyle listoffigures listoftables makeindex maketitle printindex section subsection subsubsection subsubsubsection tableofcontents thanks thebibliography Table 32 Commands to Control Document Style markright markboth pagenumbering pagestyle renewcommand setlength thispagestyle Table 33 Commands to Control Fonts in Math Mode left boldmath set in text mode cal displaystyle mathbf mathcal mathit mathnormal mathrm mathsf mathtt mbox overbrace overline right textstyle underbrace underline 114 APPENDIX able 34 Accents in Math Mode Ncheck a brevefe i acute i gravefo amp dot x y ddot y Z bar z y vec v 2 hat imath J tilde jmath h hbar 7y2 widehat xyz abc widetilde abc Note that it is better style to use imath rather than i and jmath rather than j to avoid the clash between the accent and dot Table 35 Spacing Commands in Math Mode What you write What you see x y gt ry no space xN y gt ry thin space x 3Y gt y medium space xNquad y gt cy space lem x qquad y gt d y space 2em x ly gt wz negative thin space x negmedspace y gt y negative medium space x neg
74. et to A and the text Node A is put there with no frame The syntax for rnode is rnode name stuff The next two commands put nodes named B and C each enclosed with a frame The ncline command has the same arrow options as psline but with the following syntax nclinefa name of node A name of node B 82 6 GRAPHICS The first Ancline in Figure 64 draws a plain line from node A to node B The nodesepA 3pt option gives 3 pt separation between the end of the line and node A Otherwise the line would touch Node A text which is not what we want The separation is exaggerated to 5 pt in the arrow from node C to node A The default value is nodesep 0pt which is what we want when the nodes are enclosed boxes like B and C In general node separation can be specified for either end point or for both end points by specifying nodesepA n nodesepB n or nodesep n respectively nodesepA and nodesepB are keywords and have nothing to do with the names we assign to our nodes begin center psset unit 1cm rput 0 0 rnode A Node Aj rput 2 1 rnode B psframebox Node B Xrput 2 1 rnode C psovalbox Node C ncline nodesepA 3pt AT BT ncline nodesepA 5pt lt A C ncline lt gt B C end center vspace 5in Figure 64 PSTricks Source for Connecting Nodes Figure 66 shows a graph that could represent any number of things Its source using PSTricks is shown in figure 65 Try a
75. f the associated postscript result ps file J Be sure your name is on each 1 Write a document with at least two pages and two sections Put an enumer ated list of items near the beginning of your document and use the Nref or Xpageref command to reference each of the following a Reference 82 by a label that you assign to section 2 make whatever 45 label name you like b Somewhere near the end of your document reference the page number of the first section c Reference item 2 of your enumerated list 2 Include two tables and figures in your document and reference them by label Also reference the page that they appear 3 Produce Figure 35 4 Produce lists using the enumerate environment with the following appear ance li ues lebe 1 2 s 2 2 l aes 2 2 2s 5 Produce two numbered lists such that the second starts its numbering where the first leaves off For example produce the following 1 List 1 item 1 2 List 1 item 2 Now we are out of list 1 begin list 2 3 List 2 item 1 4 List 2 item 2 5 Math Mode One can write mathematical expressions by entering math mode signified by de limiters or NL VM The delimiter keeps the mathematical expression in the text like this A consequence of Einstein s postulates is that E mc 2 gt A consequence of Einstein s postulates is that E me The other form is math display mode like this A consequence of Einstein s
76. f you need to apply this to a portion of the document such as an abstract you can put that portion into a skeleton latex file and compile it Using the above structure this is particularly easy to obtain the word or line count of any section Commenting text Besides putting in column 1 you can logically delete a block of text by if 0 fi This is a good way to manage a document when you might want to remove some text with the idea that you it might be restored at least in part if 0 stuff here is ignored NEL See 8 5 for more general control newcommand vs def It is generally better to use Nnewcommand because you will get an error ifthe command name is already defined such as by some package The syntax is newcommand name what to do for example newcommand note 1 texttt Note 1 defines a note command that has one argument When you specify note hello you will get Note hello in the text def is to be used only when you want to allow an over ride without warning Its syntax is def name what or NdefNnamesti what if there is one argument To suppress printing all notes defined by the above Anote command you can specify def note 1 This says to do nothing when seeing note stuff You can have an input file with many commands and environment definitions that you use repeatedly It might have something like the following REFERENCES 119 newcommand note 1 texttt note 1 NdefNno
77. first level of division is assumed to be a chapter so the numbering will be chapter section subsection If you have no chapters it will number the first section as 0 1 Making the first level division chapters will overcome the numbering problem but the format of chapters is different similar to a book Making the document class an article will also solve the problem since the section is the first level division This might not be appropriate due to other considerations such as entering the document into a database using 8 3 Your Own Environments 103 BIBTEX where you want it to be counted as a report not as an article The way to do this is as follows makeatletter renewcommand thesection arabic c section makeatother The preceding command makeatletter is to make the character a letter The succeeding command makeatother restores to its special meaning is for certain spacing equal to about 2 spaces 8 3 Your Own Environments The newenvironment command enables us to define our own environments and the renewenvironment command enables us to revise an existing en vironment They have the same syntax newenvironment name n begin end renewenvironment name n begin end where name is the name of the environment n number of arguments omit 0 for n 0 begin is what is executed upon entering the environment and end is what is executed upon leaving the environment For example the followi
78. g 2 MetaPost 78 MiK TeX 3 77 86 nodes 81 package ix 1 4 8 acronym 99 algorithm 110 amscd 65 amsmath 61 64 amssymb 58 babel 22 bibunits 38 110 bm 48 c pascal 110 chemsym 110 fancyvrb 111 float 41 fontenc 9 frankenstein 110 geometry 104 gloss 99 graphicx 87 graphtex 110 hyphenat 24 ifthen 108 listings 110 longtable 20 makeidx 98 mathrsfs 59 moreverb 111 nomencl 99 psfrag 88 pstricks 77 INDEX qsymbols 110 setspace 25 108 showkeys 40 SIunits 110 theorem 63 url 33 wasysym 110 xypic 110 page numbering 108 paragraph positions 6 preamble 1 35 103 110 quotation marks 10 rotate 81 section 5 SIAM 1 spacing 12 104 7 24 horizontal 25 line 11 25 list 106 math mode 48 50 107 vertical 11 25 special character 1 12 15 20 21 24 29 45 103 textspec 21 in url 33 special function 58 stacking 65 subscript 46 stack 65 subsection 5 superscript 46 tabbing commands 22 table 15 ticks 85 transpose 54 trigonometric functions 58 units of measurement 4 16 72 78 79 81 84 111 INDEX unix 3 28 86 wc 118 word count 118 xdvi 3 YAP 3 125
79. gle Table 45 Special Symbols in Both Text and Math Modes i dag NS copyright ii ddag Y NP Npounds ldots Table 46 Commands and Parameters in Picture Environment put x y stuff multiput x y Ax Ay number stuff line x y length framebox width height p text vector x y length dashbox dash ize width height p text circle radius makebox width height p text circle radius oval width height p linethickness dimension p 1 r t b 1t 1b rt rb For oval it is the portion selected for boxes p is where the text goes Some Tips Here are some tips that apply in special situations Structuring large documents Theses books and other large documents are best managed with the input command The document might look like this 118 Some Tips Preamble Preamble begin document begin document input Abstract input Abstract input Chapter1 input Chapter1 input Chapter2 input Chapter2 end document end document a Separate chapters in a document b Compiling just Chapter 1 input files are Abstract tex Chapterl tex This is also a good structure for co authoring Counting words Under linux enter dvi2tty file dvi wc words This takes file dvi as input into the program dvi2tty which con verts it into a plain text file without latex commands That output file is passed to the command wc which counts the words I
80. gure and Table Location Options Numerals to Print Counters llle Default Settings for enumerate Counters Some Mathematical Operations Set Notation 4 04 moe ese x be kG oe ea ae Ra Ree The mathfont Commands Variable Size Mathematical Operation Symbols Some Symbols in Logic llle Order Relations e eee eee Transpose of a Vector Some Common Mathematical Functions Examples of Mathematical Functions Notation Using mathbb Fonts from amssymb Package Some Basic Drawing Commands in PSTricks Boxes in PSTricks 2l Parameters for psaxes e o Intrinsic Name Parameters len Margin Parameters eee eee Spacing Parameters 000022 eee Conversions of Common Units of Measurement Reference Tables o Commands Environments for Text Font Appearance Commands Environments for Controlling Text Position Text Accents and Special Symbols Commands for Counters 2 2 a Commands Environments to Organize Document Commands to Control Document Style Commands to Control Fonts in Math Mode Accents in Math Mode Spacing Commands in Math Mode Greek and Special Letters 2n Frequently Used Mathematical Symbols Binary Operations
81. h font style in Table 1 is used for one complete word c Each font style in Table 1 is used for two consecutive complete words Write two paragraphs in article and letter style with each of the fol lowing properties a Default indentation on both paragraphs b c d No paragraph is indented Both paragraphs are indented Rx Ns NA NA There is added space between paragraphs Write a paragraph in article style and make a cover page with the following properties like the cover page of this document e All lines are centered e The title appears first in very large letters e Your name appears second in letters that are not as large as the title but larger than normal size and it is preceded by extra space e Your e mail address appears third e Your web address appears fourth e Course number and title appears next with extra space preceding it e Date appears last with extra space preceding it Give an enumeration of at least three things you like about mathemat ics Give the same list without numbers Produce the following table Colors Primary Secondary Red Green Blue Orange Yellow Purple Produce the following table including the accents and alignments 2 7 Spacing 27 7 Produce the following table 10 11 12 Mathematician Birth Death Gabrielle Emilie Le Tonnelier de Breteuil Marquise du Ch telet 1706 1749 Benjamin Banne
82. hbox 1 1 2 3 br bottom right put 65 1 circle 2 put 7 1 05 1 put 1 1 oval 5 25 put 85 1 05 oval put 0 1 fbox beginfarray c a b c end array put 3 35 vector 1 0 3 put 65 5 vector 0 1 4 put 35 5 vector 4 3 5 put 55 1 vector 1 0 55 put 0 1 vector 1 0 55 put 32 1 vector 1 0 43 put 1 2 895 line 1 1 3975 end picture end center vspace 1in Figure 62 Source for Figure 61 I specify some length 5 I am specifying 5 inches The parameter that de termines this is unitlength and the default for the picture environment is 1pt Then we enter the picture environment stating that the point of entry is the origin indicated by the coordinates 0 0 There is an alternative way to begin the picture environment which is not described here The filled circle shows where 0 0 is in this picture Every picture command begins with put which is exclusively for the picture environment The complete syntax is Nput x y stuff where stuff can be text or some picture object The x y coordinates are relative to where the position is when the picture environment is entered This could be at the left margin as in beginning a paragraph with noindent it could be a column in a table defined within the tabular environment or it could be in the middle of a sentence just as the smiley face appears here s
83. he default justify and you will see that the spacing gives a poor appearance The problem is that flushleft skips a line which ruins the alignment even though t is specified The solution is to use the raggedright command as shown in figures 53 and 54 In addition the raisebox command is used to lower the small matrix giving it some space below the horizontal line renewcommand arraystretch 1 2 begin center begin small begin tabular 111 Matrix amp Definition amp Example hline parbox t 9in Covariance parbox t 2in flushleft A_ ij E X i Wnu i X_j mu_j where X_i are random variables and E cdot is the expected value operator with mu_i E X_i parbox t 1 4in scriptsize left beginfarray rrrrr frac 1 2 amp 0 NN 0 amp frac 1 2 endfarray right flushleft for X_2 X_172 and Pr X_1 x NN left beginfarray 111 fourth amp mbox for amp x 1 vspace 05in AN half amp mbox for amp x 0 vspacef 05in fourth amp mbox for amp x 1 Vend array Nright vspace 1in NN hline end tabular end small end flushleft renewcommand arraystretch 1 Figure 51 flushleft in parbox Source Result in Figure 52 Matrix Definition Example i Covariance 2 E 0 3 Aij El X wi X5 uj E NEE p where X are random Pri X variables and E is the l dog gol f 4 expected value operator with 1 5
84. heorem defn Definition section Then in the text begin defn The circumference of a sphere is the circumference of any great circle on the sphere end defn Compare this with the following Definition 5 1 The circumference of a sphere is the circumference of any great circle on the sphere This was created by first entering in the preamble theorembodyfont rmfamily newtheorem mydefn Definition section Then in the text begin mydefn The textit circumference of a sphere is the circumference of any great circle on the sphere end mydefn For more customization the theorem package enables a wide range of varia tions over the font style among other things 5 7 Refinements Mathematical delimiters like parentheses and braces must be varied to en close some expressions Whereas left and right commands adjust the size of a mathematical delimiter to fit the enclosed expression we can also enlarge these delimiters ourselves One way is with a size command for example Marge E mc72 large gt E mc There are however delimiter size control commands which apply to a single character big Big bigg and Bigg For example big E mc72 big E mc The use of text font environments comes close to the corresponding math size large big HugeeBigg but they are different especially the thicknesses This is more evident with the square and angular brackets
85. ifferent document types Further at least one entry must have more than two authors 3 Produce a document with one paragraph that cites three bibliographic items one for each of the following types a A technical report on the web b A book on the web c An entire web site 4 Produce a document that has only a bibliography composed of the following three entries in the order shown 1 I M Rich editor Impossible Dreams volume I MacTaco second edition 1999 2 LM Rich editor mpossible Dreams volume II MacTaco 1990 a I M Smart U R Tu and V F Money How to Square a Circle chapter 1 Volume IT of Rich 2 1990 39 5 Produce an annotated bibliography of the following form note the indenta tions on left and right margins 1 P R Halmos Naive Set Theory Van Nostrand Princeton NJ 1960 This is a good book which I assign to my Ph D students The first 100 pages seem simple The next 100 reveal lack of understanding the first 100 2 G Polya How To Solve It Princeton University Press Princeton NJ 1945 This is a seminal book that articulates the problem solving i e theorem proving process There are many editions and there are modern descendants such as 4 Counters Labels and References 4 1 Basic Concepts A counter is a numerical value that refers to something that is being numbered such as pages sections figures and equations A label is the identificati
86. igure 27 Multicolumn Result Source in Figure 26 Obtaining Brackets in a Description List Environment Tabbing Source Result in Figure 30 Tabbing Result Source in Figure 29 Adding bibtex to the Command Sequence A Document to Print the Bibliographic Database Framed Figure 34 Source o e Framed Figure with Caption at Bottom Framed Figure with Caption at Top Alternative enumerate Symbols Source Result in Figure 37 Alternative enumerate Symbols Result Source in Figure 36 Variable Sizes Source Result in Figure 39 Variable Sizes Result Source in Figure 38 displaystyle Source Result in Figure 41 displaystyle Result Source in Figure 40 111 e oco I 1Cc c c gmmerb 15 16 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 79 76 TT 78 79 80 81 82 83 84 Examples to Compare Text and Display Modes eqnarray Environment Source Result in Figure 44 eqnarray Environment Result Source in Figure 43 Matrix Equation Source Result in Figure 46 Matrix Equation Result Source in Figure 45 Nested Arrays Source Result in Figure 48 Nested Arrays Result Source in Figure 47 Horizontal Braces Source Result in Figure 50
87. in psovalbox this oval Boxes need not be enclosed like makebox and they can be scaled by specifying one of the following scalebox size stufft scales stuff keeping the same aspect ratio scalebox width height stuff scales the width and height individually Here are some examples 6 2 PSTricks 81 Halving scalebox 5H pscirclebox the begin tabular c Halving NN the NN circle circle end tabular scalebox 2 psframebox Opinas textsl Doubling Tall scalebox 1 3 Tall Wide scalebox 3 1 Wide There are times when we want to rotate stuff Here is how rotateleft Left rotatedown Down Left rotateright Right Rigdown One application is given by the following Who is the founder of TEX Who is the founder of TeX rotatedo nsyer Donald E Knuth Answer aco Knuth So far I have described a variety of shapes by themselves and as enclo sures for boxes These can be connected by psline with a great variety of styles including variations of arrowhead shape To avoid the tedious cal culations in locating the coordinates of the tail and head the objects being joined can be referenced by name In PSTricks the named objects are called nodes Consider the following example Node A Node B Node C The source code is shown in Figure 64 After entering the centering envi ronment and setting the default units of measurement the rput command puts a node with the rnode command The name is s
88. in tabular c MU ra QU 2 Was Pythagoras a square QS end tabular e These operations are available because the programs that perform them are used in the includegraphics command Although it is feasible to perform the operation after importing a graphic it is more efficient to specify that option in the includegraphics Here are some examples 90 6 GRAPHICS includegraphics protractor eps includegraphics width 25 textwidth height protractor eps includegraphics height 5in width angle 90 origin c protractor eps Exercises Submit a printed copy of the IATEX source tex file and printed copy of the associated postscript result ps file Be sure your name is on each 1 Use the picture environment to draw the smiley face on page 73 2 Draw the following graph with the picture environment where thicklines is specified and Nunitlength 1mm 3 Use PS Tricks to draw Figure 3 p 4 6 3 Importing pictures 91 4 Use PS Tricks or the picture environment to draw the following rhombus 5 Use PSTricks or the picture environment to draw the following 6 Make a figure in some system that lets you save it as an eps file or use some conversion program Then include it in your document 7 Use whatever means you prefer or that your instructor requires to include each of the following figures in your document They were drawn here with PS Tricks but this section did not describe
89. inef coordinates 0 0 10 2 pspolygon xo yo n Yn Draws closed polygon with given pspolygon 0 0 coordinates same as psline 0 3 6 3 except figure is closed by drawing line from n Yn to xo yo In using these commands we do want the rput command in order to put text into various objects The idea of a box is to have some shape enclose text PSTricks extends the rectangle in framebox by having a variety of shapes shown in Table 20 A parameter used by these commands is the distance 80 6 GRAPHICS between the border and the text inside called framesep len where the default value of len is 3pt As usual other parameters include linewidth linestyle linecolor and fillcolor The pst figures are drawn after specifying psset unit 1mm fillcolor white Table 20 Boxes in PSTricks psframebox stuff Draws rectangle but could have rounded corners framebox psframebox framebox framebox psframebox framearc 4 framebox psshadowboxt stuff Adds shadow to psframebox shadow added psshadowbox shadow added psdblframebox stuff Draws double frame double frame psdblframebox double frame pscirclebox stufft Draws circle around stuff circle pscirclebox linewidth 2pt circle psovalbox stufft Draws oval around stuff oval psovalbox linestyle dotted oval These commands can be used in the text For example we obtain this oval by writing we obta
90. ing itemsep space added to parsep between items in a list parindent indentation at beginning of paragraph parsep space between paragraphs in the same item of a list parskip space between paragraphs In the case of list parameters they must be set within the list environ ment For itemsep this can occur just after the begin statement De faults are restored after leaving For example the lists in 2 2 p 12 are spaced by default values Here is what happens when we change itemsep e The default value of itemsep is 4 5pt plus 2 0pt minus 1 0pt and I have saved it by setlength mylength itemsep See the above spacing between items What you see next is with setlength itemsep Opt What you see next is with setlength itemsep 10pt e Next is back to normal by setlength itemsep mylength We are back to normal with itemsep 4 5pt plus 2 0pt minus 1 0pt Figure 87 shows two enumerate lists varying by the value of itemsep 1 This list specified setlength itemsep 12pt right after Nbeginfitemize 1 This list specified setlength itemsep 0pt right after Nbeginfitemize 2 This item is fairly close to the 2 This item is farther from the first one first one Figure 87 Varying itemsep to control item spacing in a list The left margin parameter is leftmargini for a level 1 list note the i at the end This must be set before the begin command Figure 88 give
91. ing mbox to achieve the same result Among the special functions are the complete set of trigonometric functions For example we write tan theta frac sin theta cos theta to pro duce tan 322 Appendix Table 40 p 115 has a much longer list of special cos 0 Fancfigpg a ASU 23 the agr OPS ANS BS HAR OPRAH Bhi Bre with usepackage amssymb This gives the following alphabet with the mathbb font mathbb ABCDEFGHI JKLMNOPQRSTUVWXYZ gt ABCDEFGHIJKLMNOPQRSTUVWXYZ 5 4 Special Functions and Alphabets 59 Table 16 Some Common Mathematical Functions Function How it appears What you write limit lim lim lim inf lim inf liminf log log log maximum max max tangent tan tan Table 17 Examples of Mathematical Functions How it appears textstyle displaystyle What you write maso lim wp Mim nNrightarrowNinfty x n Nn 00 lim inf 0108 Tn dea ia log x Mliminf_fnXdownarrow 0 log x_n TL maxs ex f x max f x max_ x in X f x TE tan 0 4 7 tan 9 BB T frac tan theta pi H ln x ln z In x For example the real line is sometimes denoted by R rather than R which is the IATEX special symbol Re Table 18 shows how mathbb can be used for specifying other numerical spaces Table 18 Notation Using mathbb Fonts from amssymb Package What you write How it appears What it means mathbb R gt R Real values mathbb C gt C Complex values mathbb
92. itializes the page counter 98 7 MAKING SPECIAL PARTS The same format as the abstract can be used for other front matter that we want to format the same way The only change we require is another header name This is done by re defining the Nabstractname parameter used by the abstract environment The renewcommand enables us to do this 8 has more to say about using this command to customize many things For now consider the following example that illustrates how to have an Acknowledgments page renewcommand abstractname Acknowledgments beginfabstract I thank my family and friends for all of their support I also thank the contributors to the Comprehensive TeX Archive Network CTAN Vend abstract Alternatively we might want something to look like a section and au tomatically added to the table of contents but we do not want it to have a section number This is achieved by the Nsection command where the suppresses the numbering For example section Preface puts Pref ace in the same style as any section but with no number and the section counter remains unchanged 7 4 Back Matter After the main part of the document is finished we put the bibliogra phy see 3 and 8 6 We might first want to have appendices that fol low the main text This could be done with the appendix environment begin appendix end appendix The last portion in the back of any book is its index This could also be desir
93. ker 1731 1806 Sophie Germain 1776 1831 Julius K nig 1849 1913 R zsa P ter 1905 1977 Payoffs Player A Player B JE 2E 516 516 trary length using about 3 of the page width each How can you have an entire table whose columns are of fixed width Create a 3 column text such that each column is a paragraph of arbi Use the tabbing environment to produce the following apples grapefruit sum integral derivative difference variables constants Use the tabbing environment to produce what you see on page 30 Produce the following rate of mass accumulation in the compartment net rate of mass entering the compartment by convection net rate of mass entering by diffusion 28 3 BIBLIOGRAPHY WITH BIBTEX 3 Bibliography with BIBTEX 3 1 Overview It might seem strange to have this section so early instead of with 87 4 That is because I require students to produce an annotated bibliography early in the semester and I want them to use BIBTEX So here we are BIBTEX 11 was developed by Oren Ptashnik and is available free of charge It reads a plain text file called a bib file plus one of the files created by the latex compiler about which you need not be concerned The bib file contains the bibliographic database which could extend beyond one document The bibtex program that you apply to your source creates another file which you need not
94. land Mainz Germany Alexander Samarin Geneva Switzerland 1994 Figure 73 Adding Addresses to Authors There are times when we want to acknowledge support for one or more of the authors The thanks command does this by creating a footnote using different footnote marks for each one Figures 74 and 75 illustrate this along with some variation in the date 7 1 Cover Page 95 title Pieces of pi thanks Renamed index texttt backslash thanks index footnote author Archimedes thanks Supported by the army Syracuse Sicily and Pythagoras Samos Ionia date 210 sc bc revision of earlier version 510 sc bc Figure 74 Footnotes in the Cover Page Source Result in Figure 75 Pieces of 71 Archimedes Pythagoras Syracuse Sicily Samos Ionia 210 BC revision of earlier version 510 BC Renamed Supported by the army Figure 75 Footnotes in the Cover Page Result Source in Figure 74 Figure 76 shows how to use only one footnote for authors having the same affiliation This uses the footnotemark command which puts the footnote mark without any new text Prior to that the value of the footnote counter is set back to the first footnote mark title Doing LaTeX author I M Rich thanks Smart University and U R Grand thanks Street Smart and I C All addtocounter footnote 2 footnotemark Figure 76 Authors with same footnote Result in Figure 77 96 7 MAKI
95. led by vspace vspace and vfill The height of one line of normal text is in the keyword baselineskip so vspace baselineskip skips one line at the next new line The verti cal space is not added if this goes to the top of a new page that is what vspace does In particular at the very beginning of your document if you want to make your own title page you use vspace 2in to put a 2 inch margin at the top vspace would not insert the space The easiest way to control line spacing throughout your document is to specify usepackage setspace in your preamble This gives you three commands singlespacing onehalfspacing doublespacing Right after you specify one of these that spacing will commence You can however specify renewcommand baselinestretch 1 2 to increase the spacing modestly actual increase depends upon the font size This acts like renewing the arraystretch setting and remains in effect until changed However one difference is that you need to change font size before this change goes into effect You could write renewcommand baselinestretch 1 2 small normalsize Exercises Submit a printed copy of both the IXTEX source tex file and the associated postscript result ps file Be sure your name is on each 1 Write a paragraph in article and letter style with the following prop erties 2 TEXT a Each font style in Table 1 is used as one letter in a word that has more than one letter b Eac
96. lling the parabola For example psgrid subgriddiv 1 griddots 10 gridlabels 7pt 1 0 4 4 parabola lt gt 4 3 2 0 Xparabolax fillcolor black showpoints false 1 1 2 3 Question What is the pst command to draw the parabola given by y ax bx c where a 0 Answer Aparabola 0 c 2 o i The following shows two commands pscurve and psccurve the latter being a closed curve that joins the last point with the first pscurve gt 0 0 1 1 1 1 1 1 1 1 Xpsccurve 0 0 1 1 1 1 1 1 1 1 84 6 GRAPHICS The Bezier curve joins two end points and comes as close as possible to two intermediate points The command syntax is psbezier parameters CaY xo yo 21 y1 12 Y2 vs Y3 psbezier 0 0 1 3 2 1 3 4 We can read data from a file perhaps produced by mathematical soft ware like gnuplot Octave Maple9 Mathematica 9 MATLAB and S PLUSO The data file just needs pairs of coordinates which can be sepa rated by a comma or just blank and can have parenthesis braces or nothing around each pair The following histogram was plotted by the source code in Figure 67 which I shall explain The data file had y number of students with test score x 4 50 The offset of 50 was used in establishing the origin in the plot 15 10 B 50 60 70 80 90 100 score psset unit 2mm showpoints false fileplot plotstyle dots mydata dat psaxes
97. mber of ways including the unix command lpr myfile ps The same conversion program can be run under DOS and comes with MiK TeX and you might want to obtain myfile ps for a variety of reasons including posting it on the web To view or print a postscript file under DOS you can run a program called ghostview You will need to find out more about viewing and printing postscript files that suit your particular needs Summarizing you begin by entering a plain text editor In unix this could be pico emacs vi or vim In DOS you can use EDIT at the command line or you can use Notepad Wordpad or MS Word If you use a word processor however you must take absolutely no advantage of its formatting You should even put in hard return characters i e press Enter at the end of a line instead of letting the word processor do it for you and never use tabs In MS Word when saving the file be sure to specify plain text and you must continue to specify the suffix as tex otherwise it will use doc as its suffix If you want to check that the file is really plain text enter EDIT myfile tex 4 1 OVERVIEW at the DOS command line and see how the file appears There are some free text editors on the web use your favorite search engine to find them Once you have your source ready to compile enter latex myfile and if allis well enter your dvi viewer Under unix or DOS use dvips to convert the dvi file to a postscript ps file which c
98. ment does not have to contain a table it differs from a figure only in its name and they have separate counters The figures and tables in this document appear as the form Figure number caption vs Table number caption That s it As a matter of style we generally use the figure environment to present what we usually think of as figures notably pictures and we generally use the table environment to present information in tabular form However neither of these conditions is necessary for their IATEX environments Floats can be framed using the fbox command For example Figures 33 and 34 illustrate how to frame a figure with a thick border 42 4 COUNTERS LABELS AND REFERENCES begin figure ht begin center setlength fboxrule 3pt make border lines thick setlength fboxsep 2in increase distance to border fbox This is a framed figure end center caption Framed Figure with Caption at Bottom label fig fboxbottom end figure Figure 33 Framed Figure 34 Source This is a framed figure Figure 34 Framed Figure with Caption at Bottom The parameter settings have returned to their default values upon leaving the figure environment This is called a local setting Thus the frame in Figure 35 has thin lines and no extra padding around the border Also note how the caption is put at the top see exercise 3 Figure 35 Framed Figure with Caption at Top This is fram
99. mmand arraystretch 1 Bxp by 500by NB cg 300cp B xp gt bg 300 TNN lt cy 300cy Line spacing is controlled by Nbaselinestretch but it is easier to use the setspace package You will have control of the whole document or just some lines whose space you want to control 8 5 Your Own Output Control You can write conditionals to do one thing or another with the ifthen package The syntax is ifthenelse condition action if true M action if false For example suppose your preamble contains newcommand printsol 2 ifthenelse equal 1 1 textsf textbf Solution 2 This will test the condition if your first argument equals 1 If so it will print Solution followed by your second argument if not it will do nothing This is illustrated in figures 92 and 93 How much is 2 2 printsol sol 4 Figure 92 ifthenelse Source Results in Figure 93 def sol 0 def sol 1 How much is 2 2 How much is 2 2 Solution 4 Figure 93 ifthenelse Results Source in Figure 92 Another example is to decide on page numbering Suppose that you want no page numbering if there is only one page If there is more than one page suppose you want to use headings in the header with page num bers You can do this as follows First just before end document put label lastpage Just after begin document put the following ifthenelse equal pageref lastpage 1 pagestylef emp
100. n farray ccc mbox Variable amp mbox Current Value amp mbox Limit hline x amp 1 234567 amp 1 y amp 9 87 amp 12 2 AN hline end array M Or begin center begin tabular ccc Variable amp Current Value amp Limit hline x 1 234567 1 NN y 9 87 amp 12 2 NN hline end tabular end center You can align a series of equations to appear this way gz 52 y 2 5 z TT7 1 y The above was produced by the following use of math display mode which is always centered NT beginfarray 1c1 x amp amp 5 2 NN y amp k 2 5 z amp amp 7 7 N x y end array The specifies a space otherwise 7 7 x y gt T T x y 5 3 Arrays and Equations 53 Another environment is eqnarray This is like a 3 column array with specifica tions 1cl as above but each row is numbered z y 1 y 2 2 Another difference is that the eqnarray environment uses displaystyle We use the eqnarray environment directly without entering math display mode so the above is produced by the following begin eqnarray x amp amp y Mabelfeqn xy NN y amp amp z labelfegn yz end eqnarray The label statements are to illustrate that we can reference these by writing ref eqn xy to produce 1 and ref eqn yz to produce 2 Note that ref gives just the number parentheses are added The relation need not literally be an equation
101. n your terms including abbre viations and names of publishers One sometimes sees Kluwer other times Kluwer Academic Publishers and still other times Kluwer Pub To help be consistent and to save some work in the long run when we write many different documents and produce more bib files we can define strings with the entry Ostring name string Then we can refer to the string anywhere in the value of a field by excluding the quotes That is why we needed the quotes before when we wrote literals For example suppose we define string kluwer Kluwer Academic Publishers Then we can enter publisher kluwer to produce the publisher value Kluwer Academic Publishers Besides consistency an advantage is that if some name changes we merely change the one string value and recompile We can concatenate strings and or literals with For example suppose we write Ostring mom My Mother string dad My Father author mom title mom dad editor dad Then the three field values are equivalent to author My Mother title My MotherMy Father editor My Father 3 2 The bib File 35 Note the absence of a space between the string values in the title To ensure a space use the space character as a literal title mom dad The same title as the above is obtained by any of the following title My Mother dad title mom My Father Another
102. nality 49 Table 12 Variable Size Mathematical Operation Symbols Operation How it appears What you write sum x sum n b du sum_ i 1 n x i i 1 integral f Mint b f x dx Mint a b f x dx parentheses Meft right left fractxHity Wright braces left right Es left sum_i x i Wright brackets Meft Wright f x de Meft Nint O Minfty f x dx right 0 XE sqrt frac displaystyle Mprod n 1 N Meft sum_ i in I n x i nWight sqrt 3 displaystyle sum_ i in I Minfty x_i M Figure 40 Ndisplaystyle Source Result in Figure 41 In text mode you can force the display style of placing these subscripts and superscripts on functions as well as sizing the expression as though it were in display mode Figure 42 gives more examples to compare in line text and display mode using textstyle and displaystyle to override the default form for the mode The default is not always predictable in particular math display mode does not always use displaystyle 50 5 MATH MODE Figure 41 displaystyle Result Source in Figure 40 What to write What to write Appearance in text mode in display mode 5 frac x 2 textstyle frac x 2 gt displaystyle frac x 2 frac x 2 MaAXrexX max_ x in X textstyle max_ x in X max displaystyle max_ x in X max_ x in X Figure 42 Examples to Compare Text and Display Modes Table 13 shows symbols used in logical ex
103. nclosing them in braces One example is the description list environment illustrated in Figure 28 Another is in the tabular environment page 15 but I omitted a discussion of position options that are specified by brackets How it appears What you write begin description This is option for item item This is option for item end description begin description This is not option for item Mtem This is not option for item end description Figure 28 Obtaining Brackets in a Description List Environment Table 2 Writing Special Characters Character How you Other fonts Roman write it italic large NM 12 SSH LSE XM8Z8 90684 amp textbackslash di textasciicircum i textasciitilde j textregistered 111 Another way to print the unprintable is with the verbatim environment or the verb command Unlike all other commands verb does not use braces to delimit its argument It uses any other character to delimit a string which can contain any character except itself For example we can write verbO to generate the string delimited by which is printed in typewriter font style The verbatim environment uses the usual syntax begin verbatim end verbatim 22 2 TEXT This is how the source code was created for the figures like Figure 26 p 20 Another class of special characters are letters with accents Table 3 shows
104. ne drawing is by using 16 2 TEXT How it appears What you write begin tabular 1 clr hline 110 120 12 130 110 amp 120 amp 130 hline 210 220 230 210 amp 220 amp 230 hline end tabular Figure 20 A 2 x 3 Table with Horizontal and Vertical Lines Nclinedfirst col last col instead of hline This is illustrated in Figure 21 How it appears What you write begin tabular 1 cc Name Test 1 Test 2 Name amp Test 1 amp Test 2 NN cline 1 1 Bob 67 72 Bob amp 67 amp 72 Sue 79 67 Sue amp 72 amp 67 NN cline 2 3 end tabular Figure 21 A Table with Partially Spanning Horizontal and Vertical Lines We can have tables nested within tables Figures 22 and 23 illustrate this while showing more variation with lines and using various fonts Here are some things to note e The entire table uses sans serif font style This is done by specifying textsf before entering the tabular environment and closing with just after it Within the tables fonts are varied Roman is in the Roman font speci fied by textrm Roman Greek is in italic specified by textit Greek and upper case is in small caps specified by textsc upper case e A new column specification is introduced p length where any unit of measure can be used as the length of the spacing In this example 3 inches is specified Note that this counts as a column so you see amp amp to se
105. ne solution is to insert new rows and break up the text manually 18 2 TEXT begin tabular 1 1 hline This amount of text is too long to fit on one amp This is column 2 line of the page amp hline end tabular This amount of text is too long to fit on one This is column 2 line of the page Instead one can assign a fixed width to a column by specifying p length For example begin tabular p 2in 1 hline This amount of text is too long to fit on one line of the page amp This is column 2 NN hline end tabular This amount of text is too long This is column 2 to fit on one line of the page Another solution is to use the parbox command short for paragraph box This has the form parbox option width tezt where the option is the placement t top and b bottom default is center Here are two examples begin tabular 1 1 hline parbox 2in This amount of text is too long to fit on one line of the page amp This is column 2 hline end tabular This amount of text is too long This i 1 9 is is column 2 to fit on one line of the page begin tabular 1 1 hline parbox t 2in This amount of text is too long to fit on one line of the page amp This is column 2 hline end tabular This amount of text is too long This is column 2 to fit on one line of the page They differ only in the placement
106. ng creates a proof environment newenvironment proof begin flushleft begin description item textit textbf Proof begin proof hfill rule 2 1mm 2 1mm end description end flushleft end proof Then begin proof First suppose dots linebreak Thus the theorem follows end proof produces Proof First suppose Thus the theorem follows E 8 4 Your Own Margins and Spacing The default margins and spacing are set with purposeful values and you will usually not need to change them When you do however they can be changed by setting certain parameters in the preamble The margins 104 8 TAKING CONTROL of the document are controlled by the parameters shown in Figure 86 and described in Table 23 See Table 25 for conversion factors in particular 1 pt 72 27 in For example if we are using 83 x 11 paper the current settings shown in Table 23 break down the horizontal parts as follows 6 14 295 pt 72 27 pt 39pt 390 pt 113 025 pt begin body stuff end body stuff lin 54in 5 396 in 1 564in 8 5in We can increase the text width by setting textwidth length in the preamble For example textwidth 6in increases the text width to 6 inches The body expands to the right unless we also change Noddsidemargin Margin settings can be negative for example we raise the body 1 inch by specifying topmargin 1in in the preamble This might be accompanied by increasing the text length The geometry
107. nt name In unix do this by entering cp p myfile tex myfile 1 tex The p is to keep the date and time of the source file Change 1 to another qualifier each time e g 2 so you have a collection of backups If you are running under DOS use copy myfile tex destination where the destination is either a or some backup file name If you are familiar with DOS nothing more need be said if not you need to learn how to create edit and save plain text files Next you want to view the result If you are in a unix environment you can view the result with the dvi viewer xdvi At the command line enter xdvi myfile and it will come on your screen There is more to do if you are working remotely in which case you might ask someone for help If you are using DOS the viewer that comes with MiKTeX 13 a free software system by Christian Schenk is called YAP At the DOS command line you enter YAP myfile You will see various options for viewing and printing Under unix xdvi does not have a print option so you first need to convert the dvi file to postscript This is done with the program dvips At the command line enter dvips myfile o The o tells the system you want the output to go to a file rather than just print your installation might already have file output as the default in which case the o is not needed This will result in the creation of the postscript file myfile ps You can print it by any nu
108. nter of the circle is at 65 1 but that is not where we want to put the inscribed text to be centered Unlike the box family we cannot include the centering of text within the circle command The same applies to the oval specification followed by putting text that required some trial and error to locate The oval itself has dimensions 5 x 25 inches where 5 measures the entire width S width height After the oval specification I use the fbox command This is the same as I used in text mode except here I use it to frame an array defined as usual in math mode the array has three rows and one column which is centered Now the code begins to draw the vectors which are lines with arrow heads Both Nvector and Mine have the same syntax line Az Ay len vector Az Ay len If Az 0 the line is vertical and len is the amount of change above or below the original point it does not matter what the magnitude of Ay is only its sign matters If Ay 0 the line is horizontal and len is the amount of change to the right or left of the original point it does not matter what the magnitude of Az is only its sign matters Otherwise if Ax 4 0 the actual change in x is still len and the slope of the line is AU This is undoubtedly confusing so consider Figure 63 The new point is determined by moving 6 1 Picture Environment 75 Ay from zo yo along the line with slope De until the new x coor
109. of the paragraph box the latter being at the top to align it with column 2 in the manner shown When making a column or parbox small the spacing can become un sightly due to being justified This is overcome with the flushleft environ ment Figures 24 and 25 illustrate this and note that it contains other commands that can be in any paragraph 2 8 Making Tables 19 begin center begin tabular 11 parbox t 3in begin flushleft This is column i and I might want to display something medskip centerline fbox How sweet it is medskip This is not the same as medskip fbox centerline How sweet it is end flushleft parbox t 1in begin flushleft textsf This is column 2 which I have put in sans serif font end flushleft end tabular end center Figure 24 parbox Source Result in Figure 25 This is column 1 and I might want to This is column display something 2 which have How sweet it is put in sans serif font This is not the same as How sweet it is Figure 25 parbox Result Source in Figure 24 Any measurement such as the width of a paragraph box can be deter mined by some length parameter rather than a fixed constant For example see exercise 9 at the end of this chapter and consider parbox 3 linewidth If we want some heading to span several columns this is done by the command multicolumn number col spec entry The first argumen
110. on of a particular value and a reference is a citation to a label The IATEX syntax for labeling a counter is label label placed where the counter s value is set where label is unique in the document The IATEX syntax for referencing a label is ref label For example in this book I defined section Bibliography with Bibtex label sec Bibliography Now I can refer to 83 by S ref sec Bibliography The choice of label is ar bitrary except do not use IATEX special characters or blanks just as the labels in the bib file entries There are times when you just want to produce the counter value without a label This is done by thecounter For example thepage produces the page number On the other hand if you want to use the counter s numerical value as an argument in a command specify value counter In the next section I describe intrinsic counters and illustrate how to label and reference them Then I shall introduce the figure and table environments which have intrinsic counters associated with them 4 2 Intrinsic Counters Anything to which TEX assigns a number has a counter associated with it Here I illustrate some of those that are in all document styles Counters that depend upon the style like a chapter in a book can be labelled and referenced in the same manner You are looking at page 39 which I was able to print by writing Nthepage Similarly you are reading subsection 4 2 of section 4 whose numbers I could w
111. or example note the colon before the display and the comma at its end which is incorrect to omit A symmetric rearrangement of a matrix has the following form R P MP where P is a permutation matrix 2 Define before use As you read articles notice that those that are among the most confusing are when the authors used a term that is not defined until pages later For example we might see The distin guishing property of an abelian group is the commutivity But a group had not yet been defined 5 8 Grammar 67 3 Reference object is located after the reference For example a figure appears after its first reference TFX does this automatically but you might want to take control over locating figures 4 An object has only one definition For example if we write au bv we cannot later refer to u v Sometimes we define the complete object P u v au bv then tell the reader something like We shall use 9 instead of P u v when there is no risk of confusion The overriding principle is clarity and it is important that the reader be told of this 5 If then is not correct Suppose A and C are expressions We can write either If A C or Suppose A Then C The first form is preferred if A and C are simple expressions If either A or C are compound the second form is clearer The form If A then C seems like it ought to be all right and the comma is used to clarify where the ant
112. or example in situations where a fixed decision made each time would cause the algorithm to run more slowly Donald E Knuth The quotes are by two pioneers of algorithms Alan M Turing and Donald E Knuth Their names appear on the right after their quote by skipping a line and entering hfill which means horizontal fill to make the line flush right Here are some other things to notice about this example e There are left and right quotation marks I used not to create this more stylistic quotation punctuation e The dash that appears before each name is created by three minus signs The more minus signs you use the longer the dash The convention is that one dash is for hyphenation two are for ranges such as page numbers and three are for punctuation i e use preceding i e 2 1 Fonts and Paragraphs 11 e There is extra space between the two quotations This was done with the bigskip command Figures 12 and 13 illustrate three levels of skipping small medium and big Later we shall look at a way to have a much finer range of vertical spacing This is a first line bigskip The space you see above is a big skip medskip The space you see just above is a medium skip smallskip The space you now see just above is a small skip This is just an ordinary line space Figure 12 Skipping Line Spaces Source Result in Figure 13 This is a first line The space you see
113. or r 1 Or m 1 Figure 52 flushleft in parbox Result Source in Figure 51 58 5 MATH MODE begin center begin small begin tabular 111 Matrix amp Definition amp Example hline parbox t 9in Covariance parbox t 2in raggedright A_ ij E X i Wnu i X_j mu_j where X_i are random variables and E cdot is the expected value operator with mu_i E X_i amp parbox t 1 4in scriptsize raisebox 1lin left beginf array rrrrr frac 1 2 amp 0 NN 0 amp frac 1 2 end array right flushleft for X_2 X_172 and Pr X_1 x NN left beginfarray 111 fourth amp mbox for amp x 1 vspace 05in half amp mbox for amp x 0 vspace 05in fourth amp mbox for amp x 1 endfarray right vspace 1in NN hline end tabular end small end center Figure 53 raggedright in parbox Source Result in Figure 54 Matrix Definition Example Covariance Aij El X pi X 15 i 0 where X are random 0 4 variables and E is the n 2 expected value operator with for X2 Xj and Pr X1 x hi E Xi l fo 1 4 gt for 0 i for g 1 Figure 54 Nraggedright in parbox Result Source in Figure 53 5 4 Special Functions and Alphabets Math mode recognizes a collection of special functions Table 16 shows some com mon ones These special functions are used to make the source clearer rather than us
114. ource Result in Figure 83 Here is my first footnote here is my second first 2 second Figure 83 Setting a Footnote Result Source in Figure 82 thefootnote gives the counter for footnotes and you can change from numbers to letters by renewcommand thef ootnote alph footnote You can also change to common footnote symbols by specifying renewcommand thefootnote fnsymbol footnote as shown in fig ures 84 and 85 The distance between the line that underlies part of the last line of text to the footnote is footnotesep which can be controlled by setlength 100 8 TAKING CONTROL renewcommand thefootnote fnsymbol footnote Here is my first footnote footnote first here is my second footnote second Figure 84 Setting a Footnote Source Result in Figure 85 Here is my first footnote here is my second first second Figure 85 Setting a Footnote Result Source in Figure 84 Exercises Submit a printed copy of both the IATEX source tex file and the associated postscript result ps file Be sure your name is on each 1 Write an article with a title page and abstract Make the main body have at least three sections Introduction Main Results and Conclu sions 2 Extend exercise 1 to have acknowledgments and references using BIBTEX 3 Combine exercises 1 and 2 and add a table of contents showing not only all sections and subsections but also the abs
115. ource in Figure 76 Making an Abstract Source Result in Figure 79 Making an Abstract Result Source in Figure 78 Some Front Matter Specifications for This Document Adding makeindex to the Command Sequence Setting a Footnote Source Result in Figure 83 Setting a Footnote Result Source in Figure 82 Setting a Footnote Source Result in Figure 85 85 86 87 88 89 90 91 92 93 94 Setting a Footnote Result Source in Figure 84 100 Document Margins e 105 Varying itemsep to control item spacing in a list 106 Changing the Left Margin of a List Result in Figure 89 107 Changing the Left Margin of a List Source in Figure 88 107 Array with Fixed Width Column Source Result in Figure 91 107 Array with Fixed Width Column Result Source in Figure 90 107 ifthenelse Source Results in Figure 93 108 ifthenelse Results Source in Figure 92 108 Most of the Preamble for this Book 111 vi List of Tables o nN oan du Corb HE Ho 4 C20 02020202 Q2 02 AA A b2 b2 b2 b2 b2 b2 b2 hb2 bh2 h2 FRR RP RRP LLLA SAO r0 d Oo q1O 0 4 0 Fr2rno0 0 o00o ICc o0 U 4 0 N OoOD0 Soc UNEO Intrinsic Font Styles o 0008 Writing Special Characters e Some Accents for Letters 0 The Tabbing Environment The kill Tabbing Command Fi
116. ow Box and having defined the NBox command we can use it in other new commands For example in the preamble I specified newcommand chkbox Box surd Then chkbox gt Some commands are specifically for math mode but we want them to work in any mode This is achieved by the command ensuremath math stuff For example consider newcommand Gs 1 G_ 1 If we are already in math mode Gs it j is replaced by G_fi j to produce Gj otherwise if Gs i j is specified in text mode it is replaced by G_ it j to put it into math mode first Thus we can specify Gs subscript no matter which mode we are in and obtain the correct result Another reason to have our own commands is for consistency particularly of notation Suppose we have a key term like the null space of a matrix Some authors write A A some write nul A and there are still more symbols people use We can choose one and define newcommand nul ensuremath mathcal N Then we can write nul A to obtain N A and we can be in text or math mode when we write this Some publishers have their own notation so we must be careful not to override them with ours A way to do this is to choose a different name like mynul then add to the preamble newcommand usenul mynul and specify usenul in the document If you need to use the publisher s simply change the one line to newcommand usenul nul where the publisher s
117. p is defined on a set of elements dots A group is defined on a set of elements The gt symbol can be read as produces Note the use of the dots command which produces the ellipsis Table 1 Intrinsic Font Styles What you write How it appears This is textbf boldface This is boldface This is textit italic This is italic This is textrm roman This is roman This is Mtextsc small caps This is SMALL CAPS This is textsf sans serif This is sans serif This is textsl slanted This is slanted This is texttt typewriter This is typewriter VLLL Some combinations of font styles can be produced For example textbf textit bolditalic gt bolditalic The argument of Ntextbf is textit bolditalic The general form is textfont text where font is one of bf it rm sc sf sl tt as seen in Table 1 2 1 Fonts and Paragraphs 9 Not all combinations are in the basic ATEX 2e installation In particular you must put Nusepackage T1 fontenc in your preamble to obtain textbf textsc bold small caps gt BOLD SMALL CAPS Font size can also be varied at will Figures 10 and 11 give the source and result for common variations Notice how the paragraph spacing changes to accommodate the variation in font size These size variations can be combined with font styles such as using Large textbf heading for some heading You can make the text large large or Large larger or
118. package provides easy specifica tions for page layout The hspace and vspace commands provide a great deal of control over horizontal and vertical spacing respectively We might want some global settings to make repeated use of these unnecessary Table 24 lists some you can set with the setlength command showing their default values used in this document Table 23 Margin Parameters Current Parameter Setting Meaning Xfootskip 30 0pt space between bottom of body and top of headsep 25 0pt n between bottom of header and top of body headheight 12 0pt height of header hoffset 0 0pt horizontal offset to add to indentation of body oddsidemargin 29 0pt extra space added at left applies only to odd numbered pages if the style is two sided in which case there is also an evensidemargin parameter paperheight 794 96999pt height of the paper paperwidth 614 295pt width of the paper textheight 585 38744pt height of the body textwidth 360 0pt width of the body topmargin 21 0pt space added before the top of the header voffset 0 0pt vertical offset to add to indentation of body Printed using theparameter 8 4 Your Own Margins and Spacing 105 pagewidth lin voffset topmargin header headheight headsep textheight g textwidth pageheight body oddsidemargin g footskip footer lin hoffset Figure 86 Document Margins 106 8 TAKING CONTROL Table 24 Spacing Parameters Parameter Mean
119. parate the two tables each being a column of the main table e The underline command is used to underline Table 1 which is col umn 1 of the main table whereas cline 3 3 is used to underline all of column 3 of the main table headed by Table 2 There are times when we want to put a good bit of text into some columns 2 8 Making Tables textsf begin tabular l1p 3in 1 NN underline Table 1 amp amp Table 2 cline 3 3 begin tabular 1c hline Object amp Symbols used hline variable amp lower case textrm Roman parameter amp textit Greek constant amp textsc upper case textrm Roman NN end tabular amp amp Begin Table 2 begin tabular rcc hline 1 amp 2 cline 2 2 amp 3 amp 4 NN cline 1 1 cline 3 3 end tabular end tabular end sf Figure 22 Nested Tables Source Result in Figure 23 Table 1 Table 2 Object Symbols used variable lower case Roman q1 2 parameter Greek 3 4 constant UPPER CASE Roman Figure 23 Nested Tables Result Source in Figure 22 of a table Suppose for example we write the following begin tabular 1 1 hline This amount of text is too long to fit on one line of the page amp This is column 2 NN hline end tabular The result will be to run off the edge of the paper 17 This amount of text is too long to fit on one line of the page This is column 2 O
120. port published by some institution Required fields author title institution year Optional fields type number address month unpublished is a document with an author and title but not formally published even as a technical report Some note of explanation is required Required fields author title note Optional fields month year In addition to the optional fields listed which vary by the type of entry the note field is always an option This lets you enter a note that will appear at the end of the citation To have a comment that is not printed enter an unrecognized field such as comment this is ignored with no error message given If a required field is missing when you compile you will get an error message Possibly there will be some standard fixup but it is best if you provide the missing field value If a document has no author you must provide a key for sorting For example consider the following entry for IXTEX 2e 10 which has no person as an author The bibliography will be sorted with the key LaTeX2e used to order this entry relative to author 32 3 BIBLIOGRAPHY WITH BIBTEX names The key will not be printed manual usrguide key LaTeX2e title LaTeXe for authors type World Wide Web site institution Comprehensive TeX Archive address CTAN url macros latex doc usrguide ps see cite CTAN for replacing CTAN year 1995 99 When there are mul
121. pressions For example to have ze A x B amp ACB write x in A Rightarrow x in B Leftrightarrow A subseteq B To have vzdy gt Plz Q v write NL forall x exists y ni P x wedge Q y M The quantifiers in this last example seem a bit crowded so we might want to add some spacing between terms In math mode a full space is obtained by specifying and a half space by Here is how each looks forall x exists y Vad forall x exists y gt Vady forall x exists y gt Vr dy e There are other spacing commands including negative spacing shown in Appendix Table 35 Table 14 shows some relations for ordered sets besides those on the keyboard lt gt Here are some examples infty 0 x ni x Me 0 gt 00 0 2 gt 1 lt 0 a_j prec b i equiv b i succ aj gt ajx bi bi gt aj forall yN Mx x not prec y not subset cal A gt Vy a rxky GA 5 3 Arrays and Equations 51 Table 13 Some Symbols in Logic Logical Term How it appears What you write existential quantifier j exists universal quantifier V forall negation i neg disjunction V Nvee conjunction wedge implication gt rightarrow gt Rightarrow equivalence Leftrightarrow equiv such that 3 Mni Table 14 Order Relations Relation How it appears What you write less than or equal lt Me greater than or equal gt ge not equal A ne precedes lt prec pr
122. r you put the command which should be right after the cover page Then you can include lists of figures and tables with the listoffigures and Mistoftables commands respectively The table of contents generally includes numbered parts like sections and subsections To include other front matter IXTEX provides the Naddcontentsline command For example the table of contents in this document was obtained with the specifications given in Figure 80 newpage pagenumbering roman pagestyle myheadings tableofcontents newpage addcontentsline toc section List of Figures listoffigures newpage addcontentsline toc section List of Tables listoftables newpage Figure 80 Some Front Matter Specifications for This Document The pagenumber specification causes the page numbers for the front matter to be put into Roman numerals That is why you see the Table of Contents on page i first numbered page just after the cover Then I declare listoffigures which is on page v followed by the list of tables Each of these are put on a new page Just above each declaration I use the addcontentsline to add it to the table of contents indicated by the toc specification The section parameter tells the latex program to format it like a section flush left The page numbering is reset when we finish the front matter by specifying newpage pagenumberingfarabic pagestyle headings This switches to the Arabic numerals and in
123. renewcommand baselinestretch 1 selectfont 38 3 BIBLIOGRAPHY WITH BIBTEX The selectfont command is needed to activate the change in baselinestretch If you also want to change the font size or style that will do Thus you could specify renewcommand baselinestretch 1 small to have the bibliography set in small font size and single spaced selectfont is not needed You can change the heading put by bibtex The default is Bibliography but you might want to have it be References You do this by specifying sometime before the bibliography renewcommand refname References for article style renewcommand bibname References for book and report styles You can have more than one bibliography by using the bibunits package which is available at CTAN 4 This will let you put different bibliographies throughout your document and you can change the properties such as the heading Exercises Submit a printed copy of the IATEX source tex file the BIBT RX data bib file and the associated postscript result ps file Be sure your name is on each 1 Produce a document with one paragraph that cites three bibliographic items one for each of the following types a An article in a journal b An entire book with at least three authors c d A technical report A chapter in a book 2 Produce a document that lists your entire database which consists of at least one entry for each of six d
124. rite by thesubsection and thesection respectively To illustrate how I can reference other parts of this document the following labels were defined when the subsection and subsubsection were first written 40 4 COUNTERS LABELS AND REFERENCES subsection The bib File label subsec bibfile subsubsection Web citations label subsubsec webcite Then I can refer to these as follows S ref subsec bibfile gt 3 2 S ref subsubsec webcite 83 2 2 I can also refer to their page numbers p pageref subsubsec webcite gt p 32 p Wageref subsec bibfile gt p 28 For any counter pageref counter gives the page number where its label is defined just as ref counter gives its value Recall from p 24 that is used to have a space without a linebreak which is an element of good style Equation 6 page 60 was labelled label eqn hessian so in this sentence I wrote its number by ref eqn hessian with parenthesis added and its page number by Npageref eqn hessian In the exercise to list what you like about mathematics I entered the label label exer likeaboutmath page 26 which I can now reference as exercise 4 by writing ref fexer likeaboutmath The choice of label such as subsubsec webcite is any string you want to use that does not contain embedded blanks or special characters used by IATEX In my choice of label I used the structure prefix name That is a matter of style and I used the pr
125. s an example 8 4 Your Own Margins and Spacing 107 setlength leftmargini 2in begin itemize setlength itemsep Oin item Item 1 of list with 2in left margin item Item 2 of list with 2in left margin end itemize Figure 88 Changing the Left Margin of a List Result in Figure 89 e Item 1 of list with 2in left margin e Item 2 of list with 2in left margin Figure 89 Changing the Left Margin of a List Source in Figure 88 Figures 90 and 91 show the presentation of an array with a p column to put horizontal space between the other two columns Note how congested it is So we want to increase its vertical spacing NE beginfarray lp 3in 1 B x_B b_N frac i 2 theta delta b_N amp amp pi_N B c B frac 1 2 theta delta c B NN B x B gt b B Mfract1 12Hthetaldelta b B amp amp pi_N N lt c N frac 1 2 theta delta c N end array M Figure 90 Array with Fixed Width Column Source Result in Figure 91 BxrB bNy 300by ND CB 100cp B rp bp 300b TNN lt cN 505cNn Figure 91 Array with Fixed Width Column Result Source in Figure 90 Here is 1 3 line spacing renewcommand arraystretch 1 3 Bap bnt 505bNn ND cp 300cp B rzp bp 300bg NN lt cy 300cN Here is 1 6 line spacing renewcommand arraystretch 1 6 Bzp byw c 300by TNB CB 100cp B rzp bp 506bp NN lt cy 100cN 108 8 TAKING CONTROL Back to default renewco
126. s 15 1 This is item 1 and we are having fun 2 This is item 2 and it s time to number anew a Back to item 1 but we are not yet done b Two is new i One again ii Two b or knot 2b Figure 18 Enumerate List Environment Result Source in Figure 17 2 3 Making Tables A table is made with the tabular environment which has the following syntax begin tabular column specs options first row spec last row spec NN options end tabular As indicated each row ends with two backslashes Each column spec ification can be left center or right abbreviated by just one character 1 c or r respectively In the body of the table each column is separated by amp Figure 19 shows an example of a 2 x 3 table How it appears What you write begin tabular 1cr left center right left amp center amp right 1 2 3 1 amp 2 amp 3 end tabular Figure 19 A 2 x 3 Table We can draw a horizontal line before any new row by specifying hline To draw a line after the last row enter hline the is simply part of the syntax and does not add an extra row to the table The column specifications can have on either side to indicate a vertical line Figure 20 illustrates a combined use of these options We could draw lines that span some rows and or columns The way to vary vertical line drawing is with the column specifications put only where you want a vertical line The way to vary horizontal li
127. s a major source of information There is no universally accepted standard for how to reference web documents but here is one way If it is a book use the book type and specify 3 2 The bib File 33 publisher World Wide Web address url Here is an example book Strunk author William Strunk Jr title Elements of Style publisher World Wide Web address http www columbia edu acis bartleby strunk year 1999 note This is the web version of the classic book by Strunk and White cite StrunkWhite The reference cite StrunkWhite presumes there is the entry for the original publication The use of the braces in the name is to be sure that the author appears as intended William Strunk Jr Otherwise without the braces the comma would signal the bibtex program that Jr is the first name of the author and it would appear as Jr William Strunk If the document is a technical report use that style but include the url as a note or in the address field Eventually you will run into some difficulty with writing urls For one thing the url could contain special characters in particular is in many urls and writing it will produce a space not the tilde Also a url could become very long and with latex having no place to break you will see a line with lots of spaces for justification followed by the url An unsightly line with spaces could also appear after the url These diffi
128. s not defined The cover page is by itself and is not numbered title The LaTeX Companion author Michel Goosens and Frank Mittelbach and Alexander Samarin date 1994 maketitle Figure 71 Title Page Source Result in Figure 72 The IXTEX Companion Michel Goosens Frank Mittelbach Alexander Samarin 1994 Figure 72 Title Page Result Source in Figure 71 Since articles often have this information on the first page of the article rather than a separate page titlepage must be specified as an option in the Ndocumentclass command For example the following does this while specifying 12pt font as another option 94 7 MAKING SPECIAL PARTS documentclass 12pt titlepage article Addresses affiliations and other information about each author can be added using to create new lines For example Figure 73 shows how the authors appear when the author definition in Figure 71 is changed to the following author Michel Goosens Geneva Switzerland and Frank Mittelbach Mainz Germany and Alexander Samarin Geneva Switzerland As illustrated in Figure 73 maketitle puts the third author on a sep arate line This is because the added width of author information makes it too long to fit on one line All three authors would be put on separate lines if the address information were extended further or if the names were very long The TEX Companion Michel Goosens Frank Mittelbach Geneva Switzer
129. se and in math display mode a A SES S5 5 b F x Pl lt a a11 012 a21 022 c CB BC 9 Produce each of the following formulas in math display mode with punctuation 2m G a q G gt max A G 2 if G z Darren o ro en 5 8 Grammar 69 10 11 12 13 14 Combine your knowledge of derivatives conditional assignment with array environment and mathematical symbols to produce the follow ing called the truncated gradient max 0 0f r Or if xj aj V f z 4 O0f z 0x if aj lt j lt bj min 0 0f r Or if x b Produce the following symbols Extended reals Ro Strictly positive integers Z a b c d Non negative rational n vectors Q Complex n vectors C Produce the following RU T X Produce the following Definition 1 A matrix is singular if its determinate is zero Definition 2 A matrix is non singular if it is not singular Theorem 1 Every non square matrix has an inverse Proof The determinate of a non square matrix cannot be zero because it is not defined Therefore the matrix is non singular This implies it has an inverse What is grammatically wrong with each of the following segments a A key is how to add velocities the formula is u v 1 WE where c is the velocity of light b A result of these assumptions is the following equation E mc Einstein first noticed this equivalence be
130. shing Company Reading MA 15th edition 1989 end thebibliography These will appear in the document s list of references even if they are not cited They can be cited in the same way described in 83 by cite companion and cite tex respectively When citing Knuth s book for example we obtain 2 in the text Alternatively we can exercise the option bibitem Knuth 1989 tex Donald E Knuth in which case cite tex Knuth 1989 Some publishers give you no choice but if you are writing a report and have control over the formatting it generally helps the reader to know some thing about the citation Thus Knuth 1989 is preferred to 2 because it immediately gives the reader information about the document without having to flip to the bibliography section With you in control there is no format monitoring so each entry appears however you put it even if there are inconsistencies in style This is one reason it is usually better to use BIBTEX even though you lose control over what appears i e they will be numbers The bib style file such as 110 8 TAKING CONTROL plain bst applies in either case Most installations come with more than the basic plain and its three variations given on p 36 Alternative bst files are achicago from the frankenstein package apalike and plainnat from natbib which give the author and year such as Knuth 1989 instead of 8 These packages provide even more versatilit
131. sic Document Preparation Knowing how to setup item Making Tables LaTeX provides a means item Bibliography Knowing how to create a bibliography item Mathematics This is the power of LaTeX and one item Graphics This has progressed a great deal in the item Other There are a great many things to learn end description Figure 14 Description List Environment The text within the square brackets is an option If present as in this example it is printed in boldface With no option the description list is one way to have text indented the opposite of a normal paragraph the first line is at the left and subsequent lines are indented For example begin description item textsf This is how one item in a description list environment looks with no optional text at the beginning end description produces the following result This is how one item in a description list environment looks with no optional text at the beginning Unlike the verse environment the first line goes almost to the left margin and the lines extend all the way to the right margin Next Figures 15 and 16 illustrate the itemize list environment which prints bullets Note the indentation of each item and the spacing between items You see the nesting of two itemize lists but any type of list can be nested within any other type e This is item 1 and our task has just begun Blank lines before an item have no
132. t Commands Font Style Command Example Result boldface mathbf Ax1 2 calligraphic mathcal Ax OBE italic mathit Ax1 2 normal mathnormal Ax 1923 roman mathrm Ax1 2 sans serif mathsf Axi 2 typewriter mathtt Ax1 2 The calligraphic style applies only to capital letters causing unintended results when applied to other symbols as shown in Table 11 The calligraphic alphabet looks like this and it is available only in math mode ABCDEFGHIJKCMANOPQRSTUVWXYyZ Write cal P A B to produce P A B without the braces the calli graphic fonts remain in effect Ncal P A B gt P A B Greek letters are defined only in math mode and they are specified by spelling them as keywords For example to produce a B A 6 48 5 MATH MODE write Nalpha beta Delta delta As Lamport 9 p 43 says Making Greek letters is as easy as 7 or II written pi or Pi Not every Greek letter is included see Appendix Table 36 The mathbf does not make Greek letters boldface We could use boldmath to achieve this but there is a package that not only provides the boldface font but also produces proper spacing In the preamble specify usepackage bm then bm beta gt 5 2 Fractions and Variable Size Functionality To make fractions we could write x y 4 to make x y 4 but if we want LIB we use the frac command frac xt y 4 We can make this appear larger as SM by prece
133. t is the number of columns to span starting where multicolumn is specified This must be in the range 1 to however many columns remain from the current position The second argument is any valid column specification such as 1 c r with or without a vertical line specification on either side Finally the third argument is the text The multicolumn command can also serve to override some column specification Suppose for example we want the columns to be left justified but we want the headers to be centered Figures 26 and 27 illustrate these uses of multicolumn The first is used to center Test number over columns 2 and 3 The line in the source begins with amp to skip column 1 then the 20 2 TEXT multicolumn specifies 2 columns centered with vertical lines before and after The second use simply centers the Student header The last use of multicolumn centers Taken in class over columns 2 and 3 Unlike the first use the vertical line at the end is missing because c was specified instead of cl begin center begin tabular 1 cc c multicolumn 2 cl Test number MM multicolumn i c Student amp 1 2 amp Average hline Bill amp 67 amp 72 amp 70 5 Charleetah amp 72 amp 67 amp 70 5 NN hline amp multicolumn 2 c Taken in class cline 2 3 end tabular end center Figure 26 Multicolumn Source Result in Figure 27 Test number Student 1
134. t is assumed to be equal to the origin Here are some examples 2 1 psaxes unit 5cm gt 4 0 8 3 gt 9g 0123 2 1 psaxes lunit 5cm 4 gt 3 0 0 1 1 0 2 1 2 1 gt 10 1 2 Note that ticks are uniformly spaced on each axes This is suppressed for the z axis in Figure 67 by specifying the option ticks y The other pa rameter settings are described in Table 21 The default values dx dy 0 cause the spacing to be equal approximately by using Dx psxunit and Dy psyunit respectively 86 6 GRAPHICS Table 21 Parameters for Npsaxes Horizontal Vertical Default Meaning Ox n Oy n 0 Label at origin Dx n Dy n 1 Label increment dx n dy n 0 Label spacing The next command rput r 60 2 large score puts score in large font flush right indicated by r at the coordinates 60 2 Thus when I superimpose the commands fileplot psaxes and rput we ob tain the data plot The remaining commands draw the histogram boxes and put the letter grade above each box in sans serif font Leaving off the score Figure 68 shows the sequence of how each psline and rput adds to the picture To fit the picture and the code next to it this is scaled simply by specifying psset unit 1mm We shall stop here but this does not exhaust the PSTricks commands See 15 for lots more including many examples 6 3 Importing pictures The way to import a picture into IATEX is to convert it to encapsulate
135. t time consuming and rather unpleasant There is a better way 6 2 PSTricks PSTricks 15 was written by Timothy Van Zandt and is provided free of charge It is not standard with MiKTeX but you can obtain it at CTAN 4 In the preamble specify usepackage pst al1 for the entire system You can use parts in which case you specify the parts you use instead of pst all see 15 for loading individual portions 78 6 GRAPHICS One thing you need to know is that not all of the pst results can be seen with a dvi viewer Some require converting to postscript and viewing the ps file T his is especially true of commands that involve rotations PS Tricks pst for short is designed to overcome difficulties with using the picture environment some of which were listed above Here are some of the features of PS Iricks that I shall illustrate e Circles and ovals in addition to boxes can have inscribed text e Lines and arrows have the same command identifying any of a great variety of arrowheads simply e Only one command is needed to put lines through a sequence of points and slopes need not be calculated e Objects can be named as nodes and lines and arrows can be drawn between them by naming the tail and head thereby eliminating the need for calculation or trial and error e Arrow heads are adjustable e Shapes are highly variable e Drawing curves is simple including plots of points that can come from a d
136. te 1 activate to suppress printing notes A better alternative avoiding def is to use 4 renewcommand note 1 activate to suppress printing notes The note command is useful when collaborating and you could define a separate one for each author showing initials There is also the providecommand This has the same syntax as newcommand but it does not issue an error if the command is al ready defined It does nothing if the command exists otherwise it defines the command Making clear It is good practice to use Nell in math mode when you want the letter ell because it is easier to distinguish Nell from the number 1 Compare vs l with 1 also compare the source el1 vs 1 with 1 Also consult the TgX Catalog Online 14 References 1 2 3 4 5 6 Johannes L Braams Babel a multilingual style option system for use with IXTEX s standard document styles TUGboat 12 2 291 301 1991 Available at CTAN 4 Johannes L Braams David P Carlisle Alan Jeffrey Frank Mittelbach Chris Rowley and Rainer Sch pf TEX 2 and the LaTeX3 project World Wide Web http www latex project org latex3 html 1994 99 David P Carlisle Packages in the graphics bundle World Wide Web CTAN macros latex required graphics see 4 for replacing CTAN 1994 99 Comprehensive TEX archive CTAN UK ftp tex ac uk tex archive Germany ftp dante de tex
137. thickspace y gt UY negative thick space Table 36 Greek and Special Letters a Nalpha 0 theta o o T tau B beta vartheta m pi U upsilon 4 gamma L iota w varpi o phi delta k Nkappa p Nrho p varphi Vepsilon A Mambda Q NXvarrho x Nchi Nvarepsilon pw mu o Nsigma U Npsi NXzeta Vv nu Warsigm w Vomega 7 Neta xi T Gamma A NLambda X9 MSigma V Psi A NDelta E Wd Y N opsilon Q Omega O Theta II Pi Phi N Naleph l Nell R Me S Mim A Z mathcal A Z APPENDIX 115 Table 37 Frequently Used Mathematical Symbols superscript prime oo infty emptyset subscript _ Table 38 Binary Operations pm 1 Ncap U Ncup O Nodot mp 1 sqcap U Nsqcup amp Notimes x times wedge uplus O Noslash div V Nee Voplus ominus V setminus f bigcap U Nbigcup O bigodot V Nbackslash V bigvee Q bigoplus 9 bigotimes WJ biguplus A bigwedge bigsqcup Table 39 Operators and Quantifiers V nabla partial y surd go wp V forall 3 exists neg Table 40 Special Functions arccos arcsin arctan arg cos cosh cot coth csc det dim exp gcd hom inf ker lg lim liminf limsup 1n log max min Pr sec sin sinh sup tan tanh Table 41 Relation Symbols X Neg gt Ngeq A neq equiv lt prec gt succ sim doteq X preceq Nsucceq
138. tion so you see Theorem 5 1 rather than Theorem 1 To further illustrate here is a corollary environment Corollary 5 1 1 The sum of cubes cannot be a cube It was defined in the preamble as follows newtheorem corollary Corollary theorem Note that this is within the theorem counter which is valid by having been defined by its own newtheorem Then the above corollary was written as begin corollary The sum of cubes cannot be a cube end corollary The following creates an axiom environment that is not within any other counter newtheorem axiom Axiom The Axiom of Choice can then be stated thusly Axiom 1 From any infinite family of sets a new set can be created that contains exactly one element from each set in the family This was created by the following code begin faxiom label axm choice From any infinite family of sets a new set can be created that contains exactly one element from each set in the family end axiom The label allows us to refer to the Axiom of Choice as Axiom 1 on page 62 by writing Axiom ref axm choice on page pageref axm choice The environment created by newtheorem puts the text in italics but this is generally not desirable for a definition Consider the following example Definition 5 1 The circumference of a sphere is the circumference of any great circle on the sphere This was created by first entering in the preamble 5 7 Refinements 63 newt
139. tiple authors we separate them with and no com mas For example 5 in this document has the following BIBTEX entry Book companion author Michel Goosens and Frank Mittelbach and Alexander Samarin title The LaTeX Companion publisher Addison Wesley Publishing Company address Reading MA year 1994 Y The use of the braces in LaTeX is to tell the bibtex program to take everything inside just as it is written for the latex program to process Otherwise the bibtex program might try to process it itself and produce an unintended result This applies to accents too In ordinary IATEX we write G o del to produce G del but this will not work in BIBTEX Instead we write G o del or simply G o del The use of braces to force a particular result is necessary in other in stances such as writing Fourier analysis to force the capital F oth erwise the bibtex program will produce fourier analysis the plain style produces article titles in lower case except the first letter of the first word Some authors however use this feature inappropriately by putting braces around everything That defeats one of the primary advantages of using IATEX and BIBTEX in the first place we want to let the style files deter mine the final form so we can switch styles and use the same source tex and bib files 3 2 2 Web citations When BIBTEX was developed the World Wide Web did not exist Now it i
140. to add a field or change the order e Fields do not have to be on separate lines but it is more readable that way e The field value can be anything recognized by TFX even mathemat ical symbols in math mode e There is a final to close the entry type Remember to put each author s name as first last or last first If you put Knuth Donald the compiler will think the first name is Knuth and the last name is Donald Here is a list of standard entry types with their required fields What are optional fields in BIBT EX are not necessarily optional as far as having a complete bibliography citation For example the volume and page numbers of an article are necessary to include even though they are optional to sat isfy BIBTEX syntax What is necessary depends upon the standard one applies but most journals require the volume of the journal and the page numbers for the cited article Fields that are neither required nor optional are ignored even if they are valid fields in other types of entries article refers to an article from a journal or magazine Required fields author title journal year Optional fields volume number pages month book refers to a book with an explicit publisher Required fields author or editor title publisher year Optional fields volume or number series address edition month booklet refers to a bound printed document but without an explicit publisher
141. tract acknowledgments and references 8 Taking Control This section introduces you to fundamentals of customizing your document It is still in the context of an introduction choosing only a few of the things you can change A key to these changes are the newcommand and Xrenewcommand commands which enable you to define your own commands and change parameter values of existing commands 8 1 Your Own Abbreviations and Commands The command that gives us the ability to make our own has the following form Nnewcommand Nname n whatever where n is the number of argu ments and whatever is whatever you want the command to do Here are two examples simply to abbreviate commands with long names newcommand ul underline newcommand mc multicolumn 8 1 Your Own Abbreviations and Commands 101 The first lets us write ul something to underline something The second lets us write mc 3 c stuff to enter a multicolumn in either a tabular or an array environment spanning 3 columns and centered The latex compiler will not let you use a name that is already being used For example if you specify newcommand fbox you will get a fatal error message since there is already a fbox command A related use is when the command requires some lines of code Consider the following example newcommand Box mbox begin picture 0 0 put 2 0 framebox 7 7 end picture mbox is used to ensure text mode N
142. tters inside the matrix are ap proximately the smallmatrix size the spacing and parentheses are not the same The amsmath package has a command to put dots across any number of columns in an array Its syntax is hdotsfor spacing n where spacing determines the spacing between the dots and n is the number of columns it spans For example 5 7 Refinements 65 left beginfarray ccccc 1 amp 2 amp 3 amp 4 amp 5 NN 1234 5 hdotsfor 3 MR I cca tea era amp hdotsfor 3 eee hdotsfor 2 5 NN pete e mnn hdotsfor 5 5 oH end array right The stackrel command lets us put characters over a relation For example n stackrel mathrm def n 1 nt 9 n41 With more generality the Noverset and Nunderset amsmath commands enable us to put any characters over or under any character For example Noverset aM X gt underset b Y gt oyes e E overset a underset b Z gt This can be used to stack subscripts displaystyle sum_ stackrel mbox scriptsize i in I j in J F Y A_ ij underset j in J underset i in I sum A ijj gt Y Aj Ai icI iel jel jeJ Nesting the underset command can be unwieldy but you can use the smallmatrix environment or the substack command displaystyle sum_ substack i in I j in J k in K A_ ij underset begin smallmatrix i in I j in J k in K end smallmatrix sum A_ ij gt MAS 5 Aj icI icr jeJ j
143. tween energy E and mass m 70 5 MATH MODE c Let x be an n vector and w a scalar and define y Az wb where A is an m x n matrix and b is an m vector Now suppose y w is specified and we want to find z d Now we consider adding velocities Figure 1 Adding velocity vectors u v Figure 1 above shows how to add velocities simply as vectors e Theorem If x y z Z and zx y 2 then n lt 3 The remaining exercises are more difficult You are to produce the mathe matical expressions shown in math display mode 15 The following is tricky to get the evaluation expression t 4 to be the right size and location d 2v qu e f pi 1 2 1 1 t D 16 Note the row and column labels outside the matrix a bcd e 1 1 00 0 1 A 2 1 1010 3 0 1 1 0 0 410 0 1 1 1 17 Row pointers P 11 12 rowsin 1 21 22 rows in 2 this arrow is closer to matrix 18 Column pointers 11 12 e A T T columns columns inl in 2 71 19 Row and column pointers E xl rows in 1 21 22 rows in 2 1 1 columns columns in 1 in 2 6 Graphics Graphics may be part of a IXTEX document by one of three ways 1 Use standard IXTEX 22 commands notably the picture environment 2 Use a graphics package to draw within the document 3 Use a package to import some standard graphics file I illustrate each but I do not provide a complete list of the relevant packages see CTAN 4 and The BTEg
144. ty pagestyle headings This will test if the value of pageref lastpage is equal to 1 If so there is only one page and the first statement applies pagestyle empty If not there is more than one page and the second statement applies pagestyle headings 8 6 Your Own Bibliography 109 8 6 Your Own Bibliography You can choose not to use BIBTEX and use thebibliography environment instead You will have complete control over the formatting and there will be no sorting the list of references will appear in the order you put them Instead of the BIBTEX commands Nbibliographyimybiblio and bibliographystyle plain specify the following begin thebibliography n bibitem what appears label that you cite entry end thebibliography where n is the width of the widest label you want to allow It works if you specify 99 Each bibitem is an entry as described for BIBTEX in 83 p 28 with label the unique identifier used by the cite command The option is an alternative to having the references numbered and you can enter whatever you like Here is a complete example with two references which I formatted to agree with the plain style of BIBTEX begin thebibliography 99 bibitem companion Michel Goosens Frank Mittelbach and Alexander Samarin textit The LaTeX Companion Addison Wesley Publishing Company Reading MA 1994 bibitem tex Donald E Knuth textit The TeX Book Addison Wesley Publi
145. useful feature of BIBTEX is the crossref field for cross refer encing For example suppose we have the following entry kluwer is a string the other values are literals OProceedings Byrnes FAA 89 editor J S Byrnes and Jennifer L Byrnes title Recent Advances in F ourier Analysis and its Applications Proceedings of the NATO A dvanced S tudy I nstitute publisher kluwer year 1990 Then we can have the following entry InProceedings Artemiadis FAA 89 311 crossref Byrnes FAA 89 author N K Art e miadis title Results on the Absolutely Convergent Series of Functions and of Distributions pages 311 316 If these were the only references the result would appear as follows 1 N K Art miadis Results on the absolutely convergent series of functions and of distributions In Byrnes and Byrnes 2 pages 311 316 2 J S Byrnes and Jennifer L Byrnes editors Recent Advances in Fourier Analysis and its Applications Proceedings of the NATO Advanced Study Institute Kluwer Academic Press 1990 BIBTEX also recognizes a preamble in our bib files to enable us to define some IATEX commands The general form is Preamble string where string is any concatenation of literals and strings Here is an ex ample 11 that is useful for guiding the sorting of references in a special circumstance 36 3 BIBLIOGRAPHY WITH BIBTEX Preamble newcommand noopsort 1
146. values can be set to some absolute value with the setcounter command For example setcounter mycounter 5 sets the value of mycounter to 5 This can also be used to transfer the value of one counter to another For example setcounter mycounter value page sets the value of mycounter to the current page number value of the intrinsic counter page When using a counter for some non intrinsic sequence we want to be able to label it for future reference This is done with the refstepcounter command which also increments its value For example to increment mycounter by 1 and establish a label to its value at the place this is done write refstepcounter mycounter label mylabel Then we can use ref mylabel and pageref mylabel wherever we like The default numeral type is arabic but you can change the appearance to be any of those listed in Table 7 by applying the renewcommand to thecounter For example setcounter mycounter 0 renewcommand themycounter roman mycounter stepcounter mycounter themycounter stepcounter mycounter themycounter dots FERT This can be used for intrinsic counters too For example consider the enumerate list environment where the types of numerals for the four levels are arabic alph roman and Alph We can change these to be any type we want such as illustrated in Figures 36 and 37 The second level whose counter is enumii had its label changed to what is specifie
147. y in how the citations appear see 4 or 5 Chapter 13 If you want to have several bibliographic units in one document such as at the end of each chapter of a book use the bibunits package which you obtain from CTAN 4 Closing Remarks Now you know how to write a mathematical document in ATEX 2e and you know there is much more you can learn to gain refinements Besides what you can do yourself to elevate the quality of the results there are many packages available from CTAN 4 Figure 94 shows the preamble used for this document As you begin to use packages it is necessary to become aware of updates You can visit CTAN from time to time or you can join their newsgroup at comp text tex can be done in Google by clicking on Groups You will find other packages useful depending upon your technical area Here are some packages that give you special symbols chemsym qsymbols Slunits wasysym and xypic Also the algorithm package enables an environ ment to write source code with standard language elements and there are others with similar properties or for particular programming languages viz c pascal and listings The graphtex package specializes in all sorts of graphs including those commonly found in automata theory APPENDIX 111 usepackage amsmath formerly amstex usepackage amssymb ams symbols mathbb fonts usepackage amscd draws commutative diagrams usepackage bm bold math fonts mathbm usep
148. y specifying usepackagefhyphenat in the preamble You might have to download the package from CTAN 4 and follow the simple installation instructions Then to suppress hyphenation you specify the nohyphens command For example the first sentence of this paragraph has a hyphen to suppress it enter nohyphens Word breaks are hyphenations that LaTeX does for you Sometimes however you want to suppress hyphenation Then you obtain the following Word breaks are hyphenations that LXIEX does for you Sometimes however you want to suppress hyphenation 2 7 Spacing 25 2 7 Spacing We have already seen the use of to insert one space and hfill to put the remaining text flush right The most versatile method to insert horizontal spaces is with hspace and Mhspace These have one argument the amount of space to be inserted For example I insert 3 in hspace 3in here insert 3 in here The hspace command has no effect at a line boundary but the Nhspace inserts the space no matter what For example the previous sentence is written as The verb hspace command has no effect at a line boundary but the verb hspace hspace 1lin inserts the space no matter what That is why you see the 1 inch space at the beginning of the second line hspace would not insert the 1 inch but hspace does Two variations of hfill are NOG AAA A A Bethan Son Seer hrulefill Analogously vertical spacing is control

Download Pdf Manuals

image

Related Search

Related Contents

Firex COQ1 Owner's Manual  Simply Seamless BFPHTL Installation Guide  V7 Executive Leather Notebook Case  Samsung 2433BW Manual de Usuario  Hughes & Kettner Montana Acoustic Guitar Amplifier User's Manual  1. はじめに - AirPen  K 2160 - 2195 TS u. TST - schmitz  e+p C 101    Eaton SF8RM surge protector  

Copyright © All rights reserved.
Failed to retrieve file