home *** CD-ROM | disk | FTP | other *** search
/ Der Mediaplex Sampler - Die 6 von Plex / 6_v_plex.zip / 6_v_plex / DISK5 / DOS_18 / INTRODUC.ZIP / INTRODUC.TEX
Text File  |  1990-04-18  |  427KB  |  5,211 lines

  1. %% Thanks for your interest in A Gentle Introduction to TeX.  At the            
  2. %% moment it is in draft form, i.e., subject to correction, but it              
  3. %% is pretty close to the final copy.  Any comments on this manual              
  4. %% would be appreciated: these may be typesetting, English, or                  
  5. %% TeX criticisms.                                                              
  6. %%                                                                              
  7. %% This file is a complete TeX input file.  Just run it                         
  8. %% through TeX and print out the resulting "DVI" file. If you are               
  9. %% familiar with TeX, the macros at the top of the file have a few              
  10. %% switches which you may want to set.  If you have problems or                 
  11. %% can't run TeX at all, write to me and I'll send you a hard copy.             
  12. %%                                                                              
  13. %% You should feel free to photocopy and/or distribute this manual.             
  14. %% My only request is that it remain in one piece and not be chopped            
  15. %% up.  The only machine dependent section (#1.2) may need to be                
  16. %% rewritten for your local site, of course.                                    
  17. %%                                                                              
  18. %%%                Michael Doob                                                 
  19. %%                 Department of Mathematics                                    
  20. %%                 The University of Manitoba                                   
  21. %%                 Winnipeg, Manitoba  R3T 2N2                                  
  22. %%                 Canada                                                       
  23. %%                 mdoob@uofmcc                    (bitnet)                     
  24. %%                 mdoob@ccu.umanitoba.ca          (internet)                   
  25. %%                                                                              
  26. %% Here is a character listing to check to be sure that no                      
  27. %% unwanted translations took place within the bowels of the net.               
  28. %% Upper case letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ                               
  29. %% Lower case letters: abcdefghijklmnopqrstuvwxyz                               
  30. %% paretheses, brackets, braces: ()  []  {}                                     
  31. %% Exclaim, at, sharp, dollar, percent: ! @ # $ %                               
  32. %% Caret, ampersand, star, underscore, hyphen: ~ & * _ -                        
  33. %% vertical bar, backslash, tilde, backprime, plus: ! \ ~ ` +                   
  34. %% plus, equal, prime, quote, colon: + = ' " :                                  
  35. %% less than, greater than, slash, question, comma: < > / ? ,                   
  36. %% period, semicolon: . ;                                                       
  37. %%                                                                              
  38. %%                                                                              
  39.                                                                                 
  40.                                                                                 
  41.                                                                                 
  42.                                                                                 
  43. %%%%%%%% Here are the fonts other than the sixteen defined in %%%%%%%%          
  44. %%%%%%%%%%%%%        plain.tex that are used        %%%%%%%%%%%%%%%%%%          
  45.                                                                                 
  46.        %%%% first, choose between amr or cmr fonts %%%                          
  47. \newif \ifamrfonts                                                              
  48. \amrfontsfalse  % use this line if you use the cmr fonts                        
  49. %\amrfontstrue  % use this line if you use the old armfonts                     
  50.                                                                                 
  51. \ifamrfonts \font\brm=amr10 scaled \magstep1                                    
  52.       \else \font\brm=cmr10 scaled \magstep1 \fi                                
  53. \ifamrfonts \font\halfrm=amr10 scaled \magstephalf                              
  54.       \else \font\halfrm=cmr10 scaled \magstephalf \fi                          
  55. \ifamrfonts \font\bbrm=amr10 scaled \magstep2                                   
  56.       \else \font\bbrm=cmr10 scaled \magstep2 \fi                               
  57. \ifamrfonts \font\bbbrm=amr10 scaled \magstep3                                  
  58.       \else \font\bbbrm=cmr10 scaled \magstep3 \fi                              
  59. \ifamrfonts \font\bbbbrm=amr10 scaled \magstep4                                 
  60.       \else\font \bbbbrm=cmr10 scaled \magstep4 \fi                             
  61. \ifamrfonts \font\bbbbbrm=amr10 scaled \magstep5                                
  62.       \else \font\bbbbbrm=cmr10 scaled \magstep5 \fi                            
  63. \ifamrfonts \font\sf = amssmc10                                                 
  64.       \else \font\sf = cmss10 \fi                                               
  65. \ifamrfonts \font\chapfont=ambx10 scaled \magstep2                              
  66.       \else \font\chapfont=cmbx10 scaled \magstep2 \fi                          
  67. \ifamrfonts \font\secfont=ambx10 scaled \magstep1                               
  68.       \else \font\secfont=cmbx10 scaled \magstep1 \fi                           
  69. \ifamrfonts \font\sc= amcsc10                                                   
  70.       \else \font\sc= cmcsc10 \fi                                               
  71. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%           
  72.                                                                                 
  73.                                                                                 
  74. %%%%\vbadness=10000 %%%%%% I don't want to hear about underfull vboxes          
  75. \raggedbottom                                                                   
  76. \hsize=5.5in                                                                    
  77. \vsize=7in                                                                      
  78. \voffset=.75in                                                                  
  79. \parskip=\baselineskip                                                          
  80. \widowpenalty=1000 \clubpenalty=1000  %%% I hate widows and orphans! %%%        
  81.                                                                                 
  82. %%%%%%%%% choosing between Canadian and American spellings %%%%%%%%%            
  83. \newif \ifcanspell                                                              
  84. \canspelltrue      %%%% Canadian spelling                                       
  85. %\canspellfalse    %%% use this line for American spelling                      
  86.                                                                                 
  87. \def\aesthetic{\ifcanspell \ae{}sthetic\else esthetic\fi}                       
  88. \def\analogue{\ifcanspell analogue\else analog\fi}                              
  89.      \let\analog=\analogue                                                      
  90. \def\cancelled{\ifcanspell cancelled\else canceled\fi}                          
  91.      \let\canceled=\cancelled                                                   
  92. \def\centimetre{\ifcanspell centimetre\else centimeter\fi}                      
  93.      \let\centimeter=\centimetre                                                
  94. \def\centre{\ifcanspell centre\else center\fi}                                  
  95.      \let\center=\centre                                                        
  96. \def\centred{\ifcanspell centred\else centered\fi}                              
  97.      \let\centered=\centred                                                     
  98. \def\our{\ifcanspell our\else or\fi}                                            
  99. \def\postcode{\ifcanspell postalcode\else zipcode\fi}                           
  100. \def\province{\ifcanspell province\else state\fi}                               
  101. \def\theatre{\ifcanspell theatre\else theater\fi}                               
  102.      \let\theater=\theatre                                                      
  103. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%           
  104.                                                                                 
  105.                                                                                 
  106. %%%%%%%%%%%%%%%%% headline when in draft mode %%%%%%%%%%%%%%%%%                 
  107. \newif \ifdraft                                                                 
  108. \drafttrue                                                                      
  109. \def\draftheadline{%                                                            
  110.     \vbox {\hrule%                                                              
  111.         \line {\strut \vrule \quad \tenrm DRAFT:                                
  112.               \ifcanspell Canadian \else U.S. \fi spelling                      
  113.               \hfil                                                             
  114.               \ifnum \secnum > 0 Section \the\secnum: \fi \sectiontitle \quad   
  115.               \vrule}%                                                          
  116.         \hrule}%                                                                
  117. }                                                                               
  118. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
  119.                                                                                 
  120. %%%%%%%%%%%%%%%%%% supress headline on title pages %%%%%%%%%%%%%%%%%%           
  121. \newif \iftitlepage    \titlepagetrue                                           
  122. \headline=                                                                      
  123.   {\iftitlepage \hfil \global\titlepagefalse \else \draftheadline \fi}          
  124. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%           
  125.                                                                                 
  126. %%%%%%%%%%%%%%%%%%%% define contents and index files %%%%%%%%%%%%%%%%%%%%%%     
  127. %%% Normally the contents and index are hard coded into the input file. %%%     
  128. %% To generate new ones, use \writingcontentstrue and \writingindextrue. %%     
  129.                                                                                 
  130. \newif \ifwritingcontents                                                       
  131. \newif \ifwritingindex                                                          
  132. \newwrite\contents         \newwrite\index                                      
  133.                                                                                 
  134. \writingcontentsfalse      \writingindexfalse                                   
  135. %%% \writingcontentstrue  %%% use this line to make the contents                
  136. %%% \writingindextrue     %%% use this line to make the index                   
  137.                                                                                 
  138. \ifwritingcontents \openout\contents=contents.tex     \fi                       
  139. \ifwritingindex \openout\index=index.tex                                        
  140.           \def\toindex#1{\immediate\write\index{#1 \the\pageno}}                
  141.           \else \def\toindex#1{} \fi                                            
  142. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
  143.                                                                                 
  144. %%%%%%%%%%%%%%%%%%%% determine whether answers are printed %%%%%%%%%%%%%%%%     
  145. \newif \ifwritinganswers                                                        
  146. \writinganswersfalse        %%% use this line to suppress answer section        
  147. \writinganswerstrue         %%% use this line to include answer section         
  148. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
  149.                                                                                 
  150.                                                                                 
  151.                                                                                 
  152.                                                                                 
  153.                                                                                 
  154.                                                                                 
  155.                                                                                 
  156. %%%%%%%%%%%%%%%% exercise, section, and subsection macros %%%%%%%%%%%%          
  157. \newcount\exno                   %%%%%% counter for exercises %%%%%%%%          
  158. \newcount\secnum \secnum=0       %%%% counter for section numbers %%%%          
  159. \newcount\subsecnum                                                             
  160.                                                                                 
  161. \def\section#1{                                                                 
  162.             \vfill\eject %%%%% new section starts on a new page                 
  163.             %%%\ifodd\pageno \else\ \vfill\eject \fi %start on an odd page      
  164.             \advance\secnum by 1 \subsecnum=0 \exno=0                           
  165.             \ifnum \secnum = 1 \pageno=1 \fi                                    
  166.             \ifnum \secnum > 0                                                  
  167.                  \leftline{\chapfont Section \the\secnum}                       
  168.                  \vskip 3pt \fi                                                 
  169.             \leftline{\chapfont #1}                                             
  170.             \def\sectiontitle{#1}                                               
  171.             \vskip\baselineskip                                                 
  172.             \hrule                                                              
  173.             \vskip 1cm                                                          
  174.             \ifwritingcontents \write\contents{\string\line\string{#1           
  175.                    \string\dotfill{}                                            
  176.                    \ifnum \pageno < 0 \romannumeral-\pageno                     
  177.                    \else \the\pageno \fi                                        
  178.                    \string}}\fi                                                 
  179.             \titlepagetrue}                                                     
  180.                                                                                 
  181. \def\subsection#1{\advance\subsecnum by 1                                       
  182.                \vskip 30pt                                                      
  183.                \leftline{\secfont \the\secnum .\the\subsecnum\ #1}              
  184.                \nobreak                                                         
  185.                \ifwritingcontents                                               
  186.                      \write\contents{\string\line\string{\string\qquad{}#1      
  187.                      \string\dotfill{} \the\pageno\string}}\fi                  
  188.                  }                                                              
  189.                                                                                 
  190. \def\exercise{\advance \exno by 1                                               
  191.          \vskip\baselineskip                                                    
  192.          \noindent $\triangleright$ Exercise \the\secnum.\the\exno\quad         
  193.          }                                                                      
  194. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
  195.                                                                                 
  196.                                                                                 
  197. %% definitions of control sequences for characters in the typewriter font %%%   
  198. %%%% for short phrases this is easier than using a literal construction %%%%    
  199. \def\\{\char92{}}          %%%%% backslash %%%%%                                
  200. \def\lb{\char'173{}}       %%%%% left brace %%%%%                               
  201. \def\rb{\char'175{}}       %%%%% right brace %%%%%                              
  202. \def\sp{\char32{}}         %%%%% special space symbol %%%%%                     
  203.                                                                                 
  204. \def\beginliteral{                                                              
  205. \vskip\baselineskip                                                             
  206. \begingroup                                                                     
  207. \tt                                                                             
  208. \obeylines                                                                      
  209. %{\obeyspaces\global\let =\ }                                                   
  210. \catcode`\@=0                                                                   
  211. \parskip=0pt\parindent=0pt                                                      
  212. \catcode`\$=12\catcode`\&=12\catcode`\~=12\catcode`\#=12                        
  213. \catcode`\_=12\catcode`\~=12                                                    
  214. \def\par{\leavevmode\endgraf}                                                   
  215. \catcode`\{=12\catcode`\}=12\catcode`\%=12\catcode`\\=12                        
  216. }                                                                               
  217.                                                                                 
  218. \def\endliteral{\endgroup}                                                      
  219. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%           
  220.                                                                                 
  221.                                                                                 
  222. %%%%%%%%%%%%%% inhibit hyphenation of typewritter text %%%%%%%%%%%%%%           
  223. \hyphenchar\tentt=-1                                                            
  224.                                                                                 
  225.                                                                                 
  226. %%%%%%%%%%%% grouping to make input listing in typewriter type %%%%%%%          
  227. \def\beginuser{\vskip\parskip                                                   
  228.                \begingroup                                                      
  229.                \tt \obeylines \parskip=0pt \parindent=0pt}                      
  230.                                                                                 
  231. \def\enduser{\endgroup}                                                         
  232.                                                                                 
  233.                                                                                 
  234. %%%%%%%%%%% macro to construct tables (easily) %%%%%%%%%%%%%%%%                 
  235. %%% parameters: title goes between brackets, rest of the                        
  236. %%%             paragraph is the table                                          
  237. \def\maketable[#1]#2\par{                                                       
  238. \setbox1=\vbox{#2}                                                              
  239. $$\vbox{                                                                        
  240.         \hbox to \wd1{\bf \hss #1 \hss}                                         
  241.         \vskip 12pt                                                             
  242.         \box1                                                                   
  243.        }                                                                        
  244. $$                                                                              
  245. }                                                                               
  246. %%%%%%%%%%%  end of macro to construct tables  %%%%%%%%%%%%%%%%                 
  247.                                                                                 
  248.                                                                                 
  249.                                                                                 
  250. %%%%%%%%%%% macro to put a box around the text %%%%%%%%%%%%%%%%                 
  251. \def\makebox#1#2#3% vsize, hsize, inserted text                                 
  252. {\hbox{\vrule                                                                   
  253.        \vbox to  #1{\hrule \vss                                                 
  254.                    \hbox to #2{\hss#3\hss}\vss                                  
  255.                    \hrule}\vrule}}                                              
  256. \def\displaytext#1{$$\hbox{#1}$$}                                               
  257.                                                                                 
  258. \def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em                   
  259.    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}                              
  260.                                                                                 
  261. \def\AMSTeX{{$\cal A$}\kern-.1667em\lower.5ex\hbox                              
  262.  {$\cal M$}\kern-.125em{$\cal S$}-\TeX}                                         
  263.                                                                                 
  264.                                                                                 
  265. %%%%%%%%%%%% macro to put TeX references in right margin %%%%%%%%               
  266. \newdimen\theight                                                               
  267. \def \TeXref#1{%                                                                
  268.              \vadjust{\setbox0=\hbox{\sevenrm\quad\quad\TeX book: #1}%          
  269.              \theight=\ht0                                                      
  270.              \advance\theight by \dp0    \advance\theight by \lineskip          
  271.              \kern -\theight \vbox to \theight{\rightline{\rlap{\box0}}%        
  272.              \vss}%                                                             
  273.              }}%                                                                
  274. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%       
  275.                                                                                 
  276. %%%%%%%%%%%% macro to write the date out the date and time %%%%%%%%%%%          
  277. %%%%%%%%%%%%          TeXbook   p. 406 for date            %%%%%%%%%%%          
  278. \def\today{\ifcase\month\or January\or February\or March\or April\or            
  279. May\or June\or July\or August\or September\or October\or November\or            
  280. December\fi \space\number\day, \number\year}                                    
  281.                                                                                 
  282. \newcount\hour \newcount\minute                                                 
  283. \hour=\time  \divide \hour by 60                                                
  284. \minute=\time                                                                   
  285. \loop  \ifnum \minute > 59 \advance \minute by -60 \repeat                      
  286. \def\writetime{\ifnum \hour<13 \number\hour:%  % supresses leading 0's          
  287.                       \ifnum \minute<10 0\fi%  % so add it it                   
  288.                       \number\minute                                            
  289.                       \ifnum \hour < 12 \ A.M. \else \ P.M. \fi                 
  290.       \else \advance \hour by -12 \number\hour:%  % supresses leading 0's       
  291.                       \ifnum \minute<10 0\fi%     % add it in                   
  292.                       \number\minute \ P.M. \fi}                                
  293.                                                                                 
  294. \def\datestamp{%                                                                
  295.     \rightline{\sevenrm Run through \TeX{} on \today{} at \writetime}}          
  296. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%           
  297.                                                                                 
  298. \titlepagetrue                                                                  
  299. {\nopagenumbers                                                                 
  300. \def\sectiontitle{Introduction}                                                 
  301. \topinsert \vskip 6 cm \endinsert                                               
  302. \centerline{\chapfont A Gentle Introduction to \TeX{}}                          
  303. \vskip 15 pt                                                                    
  304. \centerline{\secfont A Manual for Self-study}                                   
  305. \vskip 3cm                                                                      
  306. \leftline{Michael Doob}                                                         
  307. \leftline{Department of Mathematics}                                            
  308. \leftline{The University of Manitoba}                                           
  309. \leftline{Winnipeg, Manitoba, Canada R3T 2N2}                                   
  310. \vskip\baselineskip                                                             
  311. \leftline{MDOOB@UOFMCC.BITNET}                                                  
  312. \leftline{MDOOB@CCU.UMANITOBA.CA}                                               
  313.                                                                                 
  314. \vfill\eject                                                                    
  315. \titlepagetrue.                                                                 
  316. \vfill\eject                                                                    
  317. }                                                                               
  318. \secnum=-2 \pageno=-1                                                           
  319.                                                                                 
  320. \section{Introduction}                                                          
  321.                                                                                 
  322. First the bad news: \TeX{} is a large and complicated program that              
  323. goes to extraordinary lengths to produce attractive typeset material.           
  324. This very complication can cause unexpected things to happen at times.          
  325. Now the good news: straightforward text is very easy to typeset using           
  326. \TeX\null.  So it's possible to start with easier text and work up to           
  327. more complicated situations.                                                    
  328.                                                                                 
  329. The purpose of this manual is to start from the very beginning and              
  330. to move towards these more complicated situations.  No previous knowledge       
  331. of \TeX{} is assumed. By proceeding a section at a time, greater                
  332. varieties of text can be produced.                                              
  333.                                                                                 
  334. Here are a few suggestions: there are some exercises in each                    
  335. section.  Be sure and do them! The only way to learn \TeX{} is by               
  336. using it.  Better yet, experiment on your own; try to make some                 
  337. variations on the exercises.  There is no way that you can damage               
  338. the \TeX{} program with your experiments.  You can find an answer               
  339. to most exercises by looking at the \TeX{} source file that was                 
  340. used to produce this document.  You'll notice that there are                    
  341. references in the right margin to {\bf The \TeX book}\null.  When you           
  342. feel that you want more information on a topic, that's where to                 
  343. look.                                                                           
  344.                                                                                 
  345. Incidently, there are a few fibs that appear in this manual;                    
  346. they are used to hide complications (I look at this as something                
  347. like poetic license).  As you become more experienced at using                  
  348. \TeX{}, you'll be able to find them.                                            
  349.                                                                                 
  350. \TeX{} is a public domain program that is available for no license              
  351. fee.  It was developed by Donald Knuth at Stanford University as                
  352. a major project.                                                                
  353. In the profit-oriented market place,                                            
  354. the program would certainly cost many thousands of dollars.  The                
  355. \TeX{} Users Group (TUG) is a nonprofit organization which distributes          
  356. copies of \TeX{}, updates software, and gives information about                 
  357. new developments in both hardware and software in its publications              
  358. TUGboat and \TeX niques.  Joining this users group is inexpensive;              
  359. please consider doing so.  The address is:                                      
  360. \vskip\baselineskip                                                             
  361. \centerline{\TeX{} Users Group}                                                 
  362. \centerline{P.O. Box 9506}                                                      
  363. \centerline{Providence, RI 02940}                                               
  364. \centerline{U.S.A.}                                                             
  365.                                                                                 
  366. This manual would not have come into being without the aid of others.           
  367. In particular the proofreading and suggestions of the following                 
  368. people have been invaluable:                                                    
  369. Waleed A.~Al-Salam (University of Alberta),                                     
  370. Nelson H.~F.~Beebe (University of Utah),                                        
  371. Bart Childs (Texas A.~\&~M\null. University),                                   
  372. Mary Coventry (University of Washington),                                       
  373. Dimitrios Diamantaras (Temple University),                                      
  374. Roberto Dominimanni (Naval Underwater Systems Center),                          
  375. Victor Eijkhout (University of Nijmegen),                                       
  376. Moshe Feder (St. Lawrence University),                                          
  377. Jonas de Miranda Gomes                                                          
  378.         (Instituto de Matematica Pura e Aplicada - Brazil),                     
  379. Rob Gross (Boston College),                                                     
  380. Klaus Hahn (University of Marburg),                                             
  381. Anita Hoover (University of Delaware),                                          
  382. J\"urgen Koslowski (Macalester College),                                        
  383. John Lee (Northrop Corporation),                                                
  384. Robert Messer (Albion College),                                                 
  385. Emily H.~Moore (Grinnell College),                                              
  386. Young Park (University of Maryland),                                            
  387. Craig Platt (University of Manitoba),                                           
  388. Kauko Saarinen (University of Jyv\"askyl\"a),                                   
  389. Jim Wright (Iowa State University),                                             
  390. and                                                                             
  391. Dominik Wujastyk (Wellcome Institute for the History of Medicine).              
  392.                                                                                 
  393. In addition several people have sent me parts or all of their local             
  394. manuals.  I have received a few others on the rebound.                          
  395. In particular Elizabeth Barnhart (TV Guide),                                    
  396. Stephan v.~Bechtolsheim (Purdue University),                                    
  397. Nelson H.~F.~Beebe (University of Utah)                                         
  398.              and Leslie Lamport (Western Digital Corporation),                  
  399. Marie McPartland-Conn and Laurie Mann (Stratus Computer),                       
  400. Robert Messer (Albion College),                                                 
  401. Noel Peterson (Library of Congress),                                            
  402. Craig Platt (University of Manitoba),                                           
  403. Alan Spragens (Stanford Linear Accelerator Center, now of Apple Computers),     
  404. Christina Thiele (Carleton University),                                         
  405. and Daniel M.~Zirin (California Institute of Technology)                        
  406. have written various types of lecture notes that have been most helpful.        
  407.                                                                                 
  408. \vfill \eject                                                                   
  409. \section{Contents}                                                              
  410.                                                                                 
  411. \line{Introduction \dotfill{} i}                                                
  412. \line{Contents \dotfill{} iii}                                                  
  413. \line{1. Getting Started \dotfill{} 1}                                          
  414. \line{\qquad{}1.1 What \TeX{} is and what \TeX{} isn't \dotfill{} 1}            
  415. \line{\qquad{}1.2 From \TeX{} file to readable output,                          
  416.                                         the big set up \dotfill{} 2}            
  417. \line{\qquad{}1.3 Let's do it! \dotfill{} 4}                                    
  418. \line{\qquad{}1.4 \TeX{} has everything under control \dotfill{} 7}             
  419. \line{\qquad{}1.5 What \TeX{} won't do \dotfill{} 8}                            
  420. \line{2. All characters great and small \dotfill{} 9}                           
  421. \line{\qquad{}2.1 Some characters are more special than others \dotfill{} 9}    
  422. \line{\qquad{}2.2 Typesetting with an accent \dotfill{} 10}                     
  423. \line{\qquad{}2.3 Dots, dashes, quotes,                                         
  424.        $\textfont0=\tenbf \mathinner {\ldotp \ldotp \ldotp }$ \dotfill{} 13}    
  425. \line{\qquad{}2.4 Different fonts \dotfill{} 14}                                
  426. \line{3. The shape of things to come \dotfill{} 18}                             
  427. \line{\qquad{}3.1 Units, units, units \dotfill{} 18}                            
  428. \line{\qquad{}3.2 Page shape \dotfill{} 19}                                     
  429. \line{\qquad{}3.3 Paragraph shape \dotfill{} 21}                                
  430. \line{\qquad{}3.4 Line shape \dotfill{} 25}                                     
  431. \line{\qquad{}3.5 Footnotes \dotfill{} 26}                                      
  432. \line{\qquad{}3.6 Headlines and Footlines \dotfill{} 27}                        
  433. \line{\qquad{}3.7 Overfull and underfull boxes \dotfill{} 28}                   
  434. \line{4. $\Bigl\{$Groups, $\bigl\{$Groups,                                      
  435.         $\{$and More Groups$\}\bigr\}\Bigr\}$ \dotfill{} 30}                    
  436. \line{5. No math anxiety here! \dotfill{} 32}                                   
  437. \line{\qquad{}5.1 Lots of new symbols \dotfill{} 32}                            
  438. \line{\qquad{}5.2 Fractions \dotfill{} 36}                                      
  439. \line{\qquad{}5.3 Subscripts and superscripts \dotfill{} 37}                    
  440. \line{\qquad{}5.4 Roots, square and otherwise \dotfill{} 38}                    
  441. \line{\qquad{}5.5 Lines, above and below \dotfill{} 38}                         
  442. \line{\qquad{}5.6 Delimiters large and small \dotfill{} 39}                     
  443. \line{\qquad{}5.7 Those special functions \dotfill{} 40}                        
  444. \line{\qquad{}5.8 Hear ye, hear ye! \dotfill{} 41}                              
  445. \line{\qquad{}5.9 Matrices \dotfill{} 42}                                       
  446. \line{\qquad{}5.10 Displayed equations \dotfill{} 44}                           
  447. \line{6. All in a row \dotfill{} 47}                                            
  448. \line{\qquad{}6.1 Picking up the tab \dotfill{} 47}                             
  449. \line{\qquad{}6.2 Horizontal alignment with more sophisticated patterns         
  450.       \dotfill{} 50}                                                            
  451. \line{7. Rolling your own \dotfill{} 54}                                        
  452. \line{\qquad{}7.1 The long and short of it \dotfill{} 55}                       
  453. \line{\qquad{}7.2 Filling in with parameters \dotfill{} 56}                     
  454. \line{\qquad{}7.3 By any other name \dotfill{} 59}                              
  455. \line{8. To err is human \dotfill{} 60}                                         
  456. \line{\qquad{}8.1 The forgotten bye \dotfill{} 60}                              
  457. \line{\qquad{}8.2 The misspelled or unknown control sequence \dotfill{} 60}     
  458. \line{\qquad{}8.3 The misnamed font \dotfill{} 62}                              
  459. \line{\qquad{}8.4 Mismatched mathematics \dotfill{} 62}                         
  460. \line{\qquad{}8.5 Mismatched braces \dotfill{} 63}                              
  461. \line{9. Digging a little deeper \dotfill{} 66}                                 
  462. \line{\qquad{}9.1 Big files, little files \dotfill{} 66}                        
  463. \line{\qquad{}9.2 Larger macro packages \dotfill{} 67}                          
  464. \line{\qquad{}9.3 Horizontal and vertical lines \dotfill{} 68}                  
  465. \line{\qquad{}9.4 Boxes within boxes \dotfill{} 70}                             
  466. \line{10. Control word list \dotfill{} 74}                                      
  467. \ifwritinganswers                                                               
  468.     \line{11. I get by with a little help\dotfill{} 77}                         
  469. \fi                                                                             
  470.                                                                                 
  471.                                                                                 
  472.                                                                                 
  473. \section{Getting Started}                                                       
  474.                                                                                 
  475. \subsection{What \TeX{} is and what \TeX{} isn't}                               
  476.                                                                                 
  477. First of all, let's see what steps are necessary to produce a                   
  478. document using \TeX\null.  The first step is to type the file                   
  479. that \TeX{} reads. This is usually called the \TeX{} file or the                
  480. input file, and it can be created using a simple text editor (in                
  481. fact, if you're using a fancy word processor, you have to be sure               
  482. that your file is saved in ASCII or nondocument mode without any                
  483. special control characters). The \TeX{} program then reads your                 
  484. input file and produces what is called a DVI file (DVI stands for               
  485. DeVice Independent). This file is not readable, at least not by                 
  486. humans. The DVI file is then read by another program (called a                  
  487. device driver) that produces the output that is readable by                     
  488. humans. \TeXref{23} Why the extra file? The same DVI file can be                
  489. read by different device drivers to produce output on a dot                     
  490. matrix printer, a laser printer, a screen viewer, or a                          
  491. phototypesetter. Once you have produced a DVI file that gives                   
  492. the right output on, say, a screen viewer, you can be assured                   
  493. that you will get exactly the same output on a laser printer                    
  494. without running the \TeX{} program again.                                       
  495.                                                                                 
  496. The process may be thought of as proceeding in the following way:               
  497. $$                                                                              
  498. \lower .3cm \makebox{1cm}{2.5cm}{\TeX{} input file}                             
  499. {\hbox{\quad \TeX{} program \quad} \atop \longrightarrow}                       
  500. \lower .3cm \makebox{1cm}{2.5cm}{DVI file}                                      
  501. {\hbox{\quad device driver\quad} \atop \longrightarrow}                         
  502. \lower .3cm \makebox{1cm}{2.7cm}{readable output}                               
  503. $$                                                                              
  504.                                                                                 
  505. This means that we don't see our output in its final form when it               
  506. is being typed at the terminal. But in this case a little                       
  507. patience is amply rewarded, for a large number of symbols not                   
  508. available in most word processing programs become available. In                 
  509. addition, the typesetting is done with more precision, and the                  
  510. input files are easily sent between different computers by                      
  511. electronic mail or on a magnetic medium.                                        
  512.                                                                                 
  513. Our focus will be on the first step, that is, creating the \TeX{}               
  514. input file and then running the \TeX{} program to produce                       
  515. appropriate results.  There are two ways of running the \TeX{}                  
  516. program; it can be run in batch mode or interactively.  In                      
  517. batch mode you submit your \TeX{} input file to your computer;                  
  518. it then runs the \TeX{} program without further intervention and                
  519. gives you the result when it is finished.  In interactive mode                  
  520. the program can stop and get further input from the user, that                  
  521. is, the user can interact with the program.  Using \TeX{}                       
  522. interactively allows some errors to be corrected by the user,                   
  523. while the \TeX{} program makes the corrections in batch mode as                 
  524. best it can. Interactive is the preferred mode, of course. All                  
  525. personal computer and many mainframe implementations are                        
  526. interactive.  On some mainframes, however, the only practical                   
  527. method of running \TeX{} is in batch mode.                                      
  528.                                                                                 
  529.                                                                                 
  530. \subsection{From \TeX{} file to readable output, the big set up}                
  531.                                                                                 
  532. {\parskip = 0pt \noindent                                                       
  533. [Note from MD:                                                                  
  534. {\sl This is the only system dependent section in the                           
  535. manual. No reference is made to it outside of the section itself.               
  536. The following local information should be included:                             
  537. \item{$\bullet$} What initial steps, if any, should be taken by the reader      
  538. to permit the running of \TeX{} and your local device driver(s).                
  539. \item{$\bullet$} How to run \TeX\null.                                          
  540. \item{$\bullet$} How to read the log file.                                      
  541. \item{$\bullet$} How to preview and/or print the dvi file.                      
  542.                                                                                 
  543. The following sample is applicable here at the University of                    
  544. Manitoba.  We use a locally written editor (MANTES) on an                       
  545. Amdahl running MVS; I'm fairly certain that it's the worst possible case.}]     
  546. }                                                                               
  547.                                                                                 
  548.                                                                                 
  549. In this section we'll see how to run \TeX{} at the University of                
  550. Manitoba.  It is assumed that the reader is familiar with MANTES                
  551. and can create text files using it.                                             
  552.                                                                                 
  553. First, there are several things that must be done {\bf one time                 
  554. only}. To start you must do the following (you type in the                      
  555. material that looks like typewriter type):                                      
  556. \item{(1)} allocate the files that \TeX{} will use by typing the                
  557. following lines (while in MANTES):                                              
  558. \itemitem{}  C: {\tt alloc da=source.tex format=vb,256,6144}                    
  559. \itemitem{}  C: {\tt alloc da=dvi format=fb,1024,6144}                          
  560.                                                                                 
  561. \item{(2)} Create a file called RUNTEX in your MANTES aggregate                 
  562. containing the following JCL:                                                   
  563. \par\noindent\vbox{                                                             
  564. \beginuser                                                                      
  565. //        JOB  ,'RUN TEX'                                                       
  566. //        EXEC TEXC                                                             
  567. //SRC     DD DSN=<userid>.SOURCE.TEX,DISP=SHR                                   
  568. //DVI     DD DSN=<userid>.DVI,DISP=OLD                                          
  569. \enduser                                                                        
  570. }                                                                               
  571.                                                                                 
  572. The name {\tt <userid>} is replaced by your own user id, of                     
  573. course. The use of upper case and the spaces must be followed                   
  574. exactly.                                                                        
  575.                                                                                 
  576. \item{(3)} Create a file called PRINTTEX in your MANTES aggregate               
  577. containing the following JCL:                                                   
  578. \par\noindent\vbox{                                                             
  579. \beginuser                                                                      
  580. //        JOB  ,'PRINT TEX'                                                     
  581. //        EXEC TEXP                                                             
  582. //DVIFILE DD DSN=<userid>.DVI,DISP=SHR                                          
  583. \enduser                                                                        
  584. }                                                                               
  585.                                                                                 
  586. Once you have completed these three steps, you are ready to run a               
  587. \TeX{} job. The files you have created will allow you to produce                
  588. about ten pages of ordinary text.                                               
  589.                                                                                 
  590. Here are the steps you use {\bf each time you run a job}.                       
  591.                                                                                 
  592. \item{(1)} create a MANTES file containing your \TeX{} input.                   
  593. \item{(2)} save and submit your file using the commands                         
  594. \itemitem{} C: {\tt save f/l to da=source.tex noseq}                            
  595. \itemitem{} C: {\tt submit runtex}                                              
  596. \item{(3)} when you get a message saying that your job is finished,             
  597. enter the command                                                               
  598. \itemitem{} C: {\tt out <jobname>; list ttyout}                                 
  599.                                                                                 
  600. In this command, {\tt <jobname>} is replaced by your user id with               
  601. a dollar sign appended.  This file listing will tell you of any                 
  602. errors that might have occured.  It is an abbreviated version of                
  603. what is called the ``log file''; we will use the term ``log                     
  604. file'' to refer to the ttyout file produced by \TeX\null.                       
  605.                                                                                 
  606. If you want, you can check on the status of your job while it is                
  607. executing by using the command                                                  
  608. \itemitem{} C: {\tt q <jobname>}                                                
  609.                                                                                 
  610. When you are finished looking at the log file, the command {\tt                 
  611. end scratch} will throw away the log file while the command {\tt                
  612. end release} will send the log file to the printer, and it can                  
  613. then be picked up with your \TeX{} output.                                      
  614.                                                                                 
  615. \item{(4)} when your output from RUNTEX program is error free, \TeX{}           
  616. will have created a legal DVI file.  To print it, use the                       
  617. command                                                                         
  618. \itemitem{} C: {\tt submit printtex nohold}                                     
  619.                                                                                 
  620. As in (3), you can check on the status of your job while it is                  
  621. executing.                                                                      
  622. \item{(5)} Pick up your output at the I/O window, sixth floor                   
  623. Engineering building.  It usually takes about twenty minutes for the            
  624. output to be ready.  Ask for it by ``{\tt <jobname>}''.                         
  625.                                                                                 
  626. The files created are large enough for running \TeX{} jobs of about             
  627. 10 pages.  A job of that size will take about one second of CPU time            
  628. to run through \TeX\null.  It will take about 15 seconds of CPU time to         
  629. print 10 pages on the Xerox 8600 using the current device driver.               
  630.                                                                                 
  631. \subsection{Let's do it!}                                                       
  632.                                                                                 
  633. So, from our viewpoint, the name of the game is to create the \TeX{}            
  634. file that produces the right readable output. What does                         
  635. a \TeX{} file look like? It consists of characters from an                      
  636. ordinary terminal, that is, upper and lower case letters,                       
  637. numbers, and the usual punctuation and accent characters (these                 
  638. are the usual ASCII characters). Text, for the most part, is just               
  639. typed normally. Special instructions usually start with one of a                
  640. few special symbols such as {\tt \#} or {\tt \&} (these will be                 
  641. described in more detail later). Here is an example of a \TeX{}                 
  642. input file:                                                                     
  643. \vskip\parskip                                                                  
  644.                                                                                 
  645. \beginuser                                                                      
  646. Here is my first \\TeX\\ sentence.                                              
  647. \\bye                                                                           
  648. \enduser                                                                        
  649. \toindex{TeX{} } \toindex{ }                                                    
  650.                                                                                 
  651.                                                                                 
  652. First note that the characters in this example look like                        
  653. typewriter type. We use these characters with all examples that                 
  654. are meant to be typed from the computer terminal. Second, note                  
  655. that the backslash appears three times in the text. We'll soon                  
  656. see that this is one of the special symbols mentioned                           
  657. previously, and it is used very frequently when making \TeX{}                   
  658. documents. Make a file containing this example. Use the \TeX{}                  
  659. program to make a DVI file and a device driver to see what you                  
  660. have produced. If all goes well, you'll have a single page with                 
  661. the following single sentence:                                                  
  662.                                                                                 
  663. Here is my first \TeX\ sentence.                                                
  664.                                                                                 
  665.   There will also be a page number at the bottom of the page. If                
  666. you've gotten this far, congratulations! Once you can produce one               
  667. \TeX{} document, it's just a matter of time before you can do                   
  668. more complicated ones. Now let's compare what we typed in with                  
  669. what we got out. The straightforward words were just typed in                   
  670. normally, and \TeX{} set them in ordinary type. But the word ``\TeX'',          
  671. which can't be typed in on a terminal because the letters                       
  672. aren't on the same line, is entered by using a word starting with               
  673. a backslash, and \TeX{} made the proper interpretation. Most                    
  674. symbols that are not ordinary letters, numbers, or punctuation                  
  675. are typeset by entering a word starting with a backslash. If we                 
  676. look a little closer, we'll note that the word ``first'' is also                
  677. changed.                                                                        
  678. \TeXref{4}                                                                      
  679. The first two letters have been joined together and there isn't                 
  680. a separate dot over the letter ``i''. This is standard                          
  681. typesetting practice: certain letter combinations are joined up                 
  682. to form what are called {\sl ligatures}. There is actually a good               
  683. \aesthetic{} reason for this. Compare the first two letters of                  
  684. ``first'' and ``{f}irst'' to see the difference. We note that                   
  685. {\tt \\bye} appears in the input file with no corresponding word                
  686. in the final copy.                                                              
  687. \toindex{bye}                                                                   
  688. This a typesetting instruction that tells \TeX{} that the input                 
  689. is finished. We'll learn about lots of different typesetting                    
  690. instructions as we go along.                                                    
  691.                                                                                 
  692. Let's look at the log file that was created when we ran \TeX                    
  693. \null. It may vary slightly at your site, but should look                       
  694. something like this:                                                            
  695.                                                                                 
  696. \noindent\vbox{                                                                 
  697. \beginuser                                                                      
  698.    1.                                                                           
  699.    2.  This is TeX, MVS Version 2.9 (no format preloaded)                       
  700.    3.   ** File  PLAIN.FMT <-- DD=FMTLIB MEM=PLAIN                              
  701.    4.                                                                           
  702.    5.   ** File  SRC.TEX <-- DD=SRC                                             
  703.    6.  (src.tex [1]                                                             
  704.    7.  Output written on DVI (1 page, 256 bytes).                               
  705.    8.  Transcript written on TEXLOG.                                            
  706. \enduser                                                                        
  707. }                                                                               
  708.                                                                                 
  709. This is the file that will contain any error messages. On line 6,               
  710. {\tt (src.tex\ } indicated that \TeX{} has started reading that                 
  711. file. The appearance of {\tt [1]} indicates that page 1 has been                
  712. processed. If there were errors on page 1, they would be listed                 
  713. at that point.                                                                  
  714.                                                                                 
  715. \vskip .5cm                                                                     
  716. \exercise Add a second sentence to your original \TeX{} file to get:            
  717. \beginuser                                                                      
  718. Here is my first \\TeX\\ sentence.                                              
  719. I was the one who typeset it!                                                   
  720. \\bye                                                                           
  721. \enduser                                                                        
  722.                                                                                 
  723. Use \TeX{} and look at your output. Is the second sentence on a                 
  724. new line?                                                                       
  725.                                                                                 
  726.                                                                                 
  727. \exercise Now add this line to the beginning of your file:                      
  728. \beginuser                                                                      
  729. \\nopagenumbers                                                                 
  730. \enduser                                                                        
  731. \noindent                                                                       
  732. Guess what will happen when you run the new file through                        
  733. \TeX\null.  Now try it and see what happens.                                    
  734. \toindex{nopagenumbers}                                                         
  735.                                                                                 
  736. \exercise Add three or four more sentences to your file.                        
  737. Use letters, numbers, periods, commas, question marks,                          
  738. and exclamation points, but don't use any other symbols.                        
  739.                                                                                 
  740.                                                                                 
  741. \exercise Leave a blank line and add some more sentences.                       
  742. You can now get new paragraphs.                                                 
  743.                                                                                 
  744. We have now seen a major principle concerning the preparation of                
  745. \TeX{} input files. The placement of the text on your computer                  
  746. terminal does not necessarily correspond to the placement of the                
  747. text on your output. You can not, for example, add space between                
  748. words in your output by adding spaces in your input file. Several               
  749. consecutive spaces and one space will produce exactly the same                  
  750. output. As would be expected, a word at the end of one line will                
  751. be separated from the first word of the following line. In fact,                
  752. sometimes when working on a file that will be heavily edited, it                
  753. is convenient to start each sentence on a separate line. Spaces                 
  754. at the beginning of a line, however, are always ignored.                        
  755.                                                                                 
  756. \exercise Add the following sentence as a new paragraph, and then               
  757. typeset it:                                                                     
  758. \beginuser                                                                      
  759. Congratulations! You received a grade of 100\% on your latest                   
  760. examination.                                                                    
  761. \enduser                                                                        
  762. \noindent                                                                       
  763. The {\tt\%} sign is used for comments in your input file.                       
  764. Everything on a line following this symbol is ignored. Notice                   
  765. that even the space that normally separates the last word on one                
  766. line from the first word on the next line is lost. Now put a                    
  767. backslash in front of the {\tt\%} sign to correct the                           
  768. sentence. \toindex{\$} \toindex{\%}                                             
  769.                                                                                 
  770. \exercise Add the following sentence as a new paragraph:                        
  771. \beginuser                                                                      
  772. You owe me \$10.00 and it's about time you sent it to me!                       
  773. \enduser                                                                        
  774. \noindent                                                                       
  775. This will produce an error in your log file (if your                            
  776. implementation of \TeX{} is interactive, that is, sends you                     
  777. messages and waits for answers, just hit the carriage return or                 
  778. enter key when you get the error message). You will get output,                 
  779. but not what you might expect. Look at the log file and see                     
  780. where the error messages are listed. Don't worry about the                      
  781. actual messages. We'll have a lot more to say about errors                      
  782. (including this one) later. Now fix the error by putting a                      
  783. backslash in front of the {\tt \$} sign, and typeset the result                 
  784. (there are a small number of characters like the per cent and                   
  785. dollar signs that \TeX{} uses for its own purposes. A table of                  
  786. these characters will be provided shortly).                                     
  787.                                                                                 
  788. \subsection{\TeX{} has everything under control}                                
  789.                                                                                 
  790. We have seen that the backslash has a special role. Any word                    
  791. starting with a backslash will be given a special interpretation                
  792. when \TeX{} reads it from your input file. Such a word is called                
  793. a {\sl control sequence}. There are, in fact, two types of                      
  794. control sequences: a {\sl control word\/} is a backslash followed               
  795. by letters only (for example, {\tt \\TeX}) and a {\sl control                   
  796. symbol\/} is a backslash followed by a single nonletter (for                    
  797. example, {\tt \\\$})\null. Since a space is a nonletter, a                      
  798. backslash followed by a space is a legitimate control symbol.                   
  799. \TeXref{7--8}                                                                   
  800. When we want to emphasize that a space is present, we will use a                
  801. special symbol {\tt\sp} to indicate the space, as in the control                
  802. symbol {\tt\\\sp}.  This convention is used in {\bf The \TeX                    
  803. book} as well as in this manual.                                                
  804.                                                                                 
  805. When \TeX{} is reading your input file and comes to a backslash                 
  806. followed by a letter, it knows that a control word is being                     
  807. read. So it continues reading the name of the control word until                
  808. a nonletter is read. So if your file contains                                   
  809.                                                                                 
  810. \displaytext{\tt I like \\TeX!}                                                 
  811.                                                                                 
  812. \noindent                                                                       
  813. the control word {\tt \\TeX} is terminated by the exclamation                   
  814. point. But this presents a problem if you want to have a space                  
  815. after a control word. If you have, for example, the sentence                    
  816.                                                                                 
  817. \displaytext{\tt I like \\TeX and use it all the time.}                         
  818.                                                                                 
  819. \noindent                                                                       
  820. in your input file, the control word {\tt\\TeX} is terminated by                
  821. the space (which is, of course, a nonletter). But then you won't                
  822. have a space between the words ``\TeX{}'' and ``and''; inserting                
  823. more spaces won't help, since \TeX{} doesn't distinguish between                
  824. one space and several consecutive spaces. But if you put the                    
  825. control symbol {\tt\\\sp} after a control word, you will both                   
  826. terminate the control word and insert a space. It's really easy                 
  827. to forget to put in something like {\tt\\\sp} after a control                   
  828. word. I promise you that you will do it at least once while                     
  829. you're learning to use \TeX\null.                                               
  830.                                                                                 
  831. \exercise Make an input file that will produce the following                    
  832. paragraph:                                                                      
  833.                                                                                 
  834. I like \TeX! Once you get the hang of it, \TeX{} is really easy                 
  835. to use. You just have to master the \TeX nical aspects.                         
  836.                                                                                 
  837. Most control words are named so as to give a hint of their uses.                
  838. You can use {\tt \\par} to make a new paragraph, for example,                   
  839. instead of putting in a blank line.                                             
  840. \toindex{par}                                                                   
  841.                                                                                 
  842. \subsection{What \TeX{} won't do}                                               
  843.                                                                                 
  844. \TeX{} is very good at setting type, but there are things that \TeX{}           
  845. can't do well.  One is making figures.  Space can be left                       
  846. to insert figures, but there are no graphic procedures built into               
  847. the language (at present).  Some implementations allow graphic                  
  848. instructions to be inserted using the {\tt \\special} control                   
  849. word but these are exceptional and definitely site dependent.                   
  850.                                                                                 
  851. \TeX{} sets type in horizontal lines.  Text that has a curve for                
  852. a baseline or whose type is perspective (gradually increasing or                
  853. decreasing) is not handled well by \TeX\null.                                   
  854.                                                                                 
  855. We have seen that there is an ``edit, \TeX{}, driver'' cycle that               
  856. is necessary for each different copy of output.  This is true                   
  857. even when the output device is a terminal.  In particular, it's                 
  858. not possible to type the input file and see the results on the                  
  859. screen immediately without going through the full cycle.  Some                  
  860. implementations have both text and graphics displays with                       
  861. reasonably quick turnaround (a few seconds for a single page); as               
  862. hardware becomes less expensive and processors become faster, we                
  863. may see improvement.                                                            
  864.                                                                                 
  865.                                                                                 
  866.                                                                                 
  867.                                                                                 
  868.                                                                                 
  869.                                                                                 
  870. \section{All characters great and small}                                        
  871.                                                                                 
  872. \subsection{Some characters are more special than others}                       
  873.                                                                                 
  874. We saw in the last section that most text is entered at the                     
  875. terminal as sentences of ordinary words just as when typing with                
  876. a typewriter. But we also saw that, in particular, the backslash                
  877. could be used for at least two different purposes. It can be                    
  878. used for symbols (or combinations of symbols) that don't appear                 
  879. on the keyboard such as typing {\tt \\TeX} to get \TeX\null. It                 
  880. can also be used to give \TeX{} special instructions such as                    
  881. typing {\tt \\bye} to indicate the end of the input file. In                    
  882. general, a word starting with a backslash will be interpreted by                
  883. \TeX{} as one requiring special attention. There are several                    
  884. hundred words that \TeX{} knows, and you can define more                        
  885. yourself, and so the backslash is very important. We'll spend a                 
  886. lot of time as we proceed learning some of these words;                         
  887. fortunately we'll only need to use a small number of them most of               
  888. the time.                                                                       
  889.                                                                                 
  890. There are ten characters which, like the backslash, are used                    
  891. by \TeX{} for special purposes, and we now want to give the                     
  892. complete list.                                                                  
  893. \TeXref{37--38}                                                                 
  894. What if we want to use a sentence with one of these special                     
  895. characters in it? With this in mind we'll ask the following                     
  896. questions:                                                                      
  897. \item{(1)} What are the different special characters?                           
  898. \item{(2)} How do we use a special character if we really want to               
  899. typeset it in our text?                                                         
  900.                                                                                 
  901. Here is a table of each special character, its purpose, and the                 
  902. method of typesetting the special character itself if you need                  
  903. it:                                                                             
  904.                                                                                 
  905.                                                                                 
  906. \maketable [Characters requiring special input]                                 
  907. \halign{                                                                        
  908.    \strut \hfil#\hfil & \quad # \hfil & \quad\tt # \hfil\cr                     
  909.    \bf Character & \bf Purpose & \bf Input for literal output \cr               
  910.    \noalign{\hrule} \noalign{\smallskip}                                        
  911.    $\backslash$   & Special symbols and instructions & \$\\backslash\$   \cr    
  912.    $\{$ & Open group                       & \$\\\lb\$         \cr              
  913.    $\}$ & Close group                      & \$\\\rb\$         \cr              
  914.    \%   & Comments                         & \\\%                   \cr         
  915.    \&   & Tabs and table alignments        & \\\&                   \cr         
  916.    \~{} & Unbreakable space                & \\\~{}\lb\rb \cr                   
  917.    \$   & Starting or ending math text     & \\\$                   \cr         
  918.    \~{} & Math superscripts                & \\\~{}\lb\rb \cr                   
  919.    \_{} & Math subscripts                  & \\\_{}\lb\rb \cr                   
  920.    \#   & Defining replacement symbols     & \\\#                   \cr         
  921.        }                                                                        
  922.                                                                                 
  923. \toindex{\lb}                                                                   
  924. \toindex{\rb}                                                                   
  925. \toindex{\%}                                                                    
  926. \toindex{\&}                                                                    
  927. \toindex{\~{}}                                                                  
  928. \toindex{\$}                                                                    
  929. \toindex{\~{}}                                                                  
  930. \toindex{\_{}}                                                                  
  931. \toindex{\#}                                                                    
  932.                                                                                 
  933. \subsection{Typesetting with an accent}                                         
  934.                                                                                 
  935. Now we're going to start using some of \TeX{}'s goodies! So far                 
  936. we've just been using \TeX{} to make our output look attractive,                
  937. but now we'll start to do things that are difficult or impossible               
  938. on the typewriter. In particular, we're going to look at accents                
  939. now. How do you produce accents when the symbol doesn't appear on               
  940. the keyboard? Just as with the symbol \TeX{}, it is necessary to                
  941. enter a word starting with a backslash. For the word ``premi\`ere'',            
  942. as a first example, you need to type in {\tt premi\\\`{}ere}                    
  943. (you may have to hunt around to find the ``back prime''                         
  944. or ``grave'' symbol {\tt \`{}} on your keyboard, but it's there                 
  945. somewhere\footnote{$~1$}{If you have a very old or obscure                      
  946. keyboard and the back prime is {\it really\/} not there, you can                
  947. use {\tt \\lq\lb\rb} instead.  Similarly {\tt \\rq\lb\rb} can be                
  948. used for the symbol {\tt \'{}}. You can think of the symbols as                 
  949. being abbreviations for ``left quote'' and ``right quote.'' In                  
  950. addition, {\tt \\lq\\lq\lb\rb} and {\tt \\rq\\rq\lb\rb} give the                
  951. usual quotation marks.}). In general, to put an accent on a                     
  952. letter, the appropriate control sequence precedes the letter.                   
  953.                                                                                 
  954. Here are some examples:                                                         
  955. $$\vbox{                                                                        
  956.                                                                                 
  957. \halign{                                                                        
  958. \strut \hfil\tt # & \quad # \hfil\cr                                            
  959. \bf \TeX{} input & \bf \TeX{} output \cr                                        
  960. \noalign{\hrule} \noalign{\smallskip}                                           
  961. \\\`{}a la mode          & \`a la mode \cr                                      
  962. r\\\'{}esum\\\'{}e          & r\'esum\'e  \cr                                   
  963. soup\\c{\sp}con   & soup\c con  \cr                                             
  964. No\\"el               & No\"el      \cr                                         
  965. na\\"\\i{\sp}ve    & na\"\i ve   \cr                                            
  966. }                                                                               
  967. }$$                                                                             
  968.                                                                                 
  969.                                                                                 
  970. We see several principles illustrated by these examples. Most                   
  971. accents are produced by using a control symbol with a similar                   
  972. shape. A few of them are produced by control words containing a                 
  973. single letter. Some care must be used in this case, for a space                 
  974. must be used to terminate to the control word. If you have {\tt                 
  975. soup\\ccon} in your file, for example, \TeX{} will look for the                 
  976. control word {\tt\\ccon}.                                                       
  977. \TeXref{52--53}                                                                 
  978.                                                                                 
  979. Notice that there is a control word {\tt\\i} also. This produces                
  980. the letter ``i'' without the dot over it; this allows an accent                 
  981. to be put over the lower part of the letter. There is an                        
  982. analogous control word {\tt\\j} which produces a dotless ``j''                  
  983. for accenting purposes.                                                         
  984.                                                                                 
  985. \maketable [Accents that may be immediately followed by a letter]               
  986. \halign{                                                                        
  987.    \strut \hfil # & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr            
  988.    \bf Name & \bf \TeX{} input & \bf \TeX{} output \cr                          
  989.    \noalign{\hrule} \noalign{\smallskip}                                        
  990.    grave           & \\\`{}o & \`o \cr                                          
  991.    acute           & \\\'{}o & \'o \cr                                          
  992.    circumflex      & \\\~{}o & \~o \cr                                          
  993.    umlaut/dieresis/tr\'emat & \\"{}o    & \"o \cr                               
  994.    tilde           & \\\~{}o & \~o \cr                                          
  995.    macron          & \\={}o    & \=o \cr                                        
  996.    dot             & \\\char'056{}o    & \.o \cr                                
  997.        }                                                                        
  998.                                                                                 
  999. \toindex{`}                                                                     
  1000. \toindex{'}                                                                     
  1001. \toindex{\~{}}                                                                  
  1002. \toindex{"}                                                                     
  1003. \toindex{i}                                                                     
  1004. \toindex{j}                                                                     
  1005. \toindex{=}                                                                     
  1006. \toindex{.}                                                                     
  1007.                                                                                 
  1008. \maketable [Accents requiring an intervening space]                             
  1009. \halign{                                                                        
  1010.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr      
  1011.    \bf Name & \bf \TeX{} input & \bf \TeX{} output \cr                          
  1012.    \noalign{\hrule} \noalign{\smallskip}                                        
  1013.    cedilla         & \\c o   & \c{o} \cr                                        
  1014.    underdot        & \\d o   & \d{o} \cr                                        
  1015.    underbar        & \\b o   & \b{o} \cr                                        
  1016.    h\'a\v{c}ek     & \\v o   & \v{o} \cr                                        
  1017.    breve           & \\u o   & \u{o} \cr                                        
  1018.    tie             & \\t \lb oo\rb  & \t{oo} \cr                                
  1019.    Hungarian umlaut& \\H o   & \H{o} \cr                                        
  1020.       }                                                                         
  1021.                                                                                 
  1022. \toindex{c}                                                                     
  1023. \toindex{d}                                                                     
  1024. \toindex{b}                                                                     
  1025. \toindex{v}                                                                     
  1026. \toindex{u}                                                                     
  1027. \toindex{t}                                                                     
  1028. \toindex{H}                                                                     
  1029.                                                                                 
  1030. \TeX{} also allows some letters from languages other than English to            
  1031. be typeset.                                                                     
  1032.                                                                                 
  1033. \maketable [A\kern-1pt vailable foreign language symbols]                       
  1034. \halign{                                                                        
  1035.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr      
  1036.    \bf Example& \bf \TeX{} input & \bf \TeX{} output \cr                        
  1037.    \noalign{\hrule} \noalign{\smallskip}                                        
  1038.    \AE gean, \ae sthetics     & \\AE, \\ae    & \AE, \ae \cr                    
  1039.    \OE uvres, hors d'\oe uvre & \\OE \\oe     & \OE, \oe \cr                    
  1040.    \AA ngstrom                & \\AA, \\aa    & \AA, \aa \cr                    
  1041.    \O re, K\o benhavn         & \\O, \\o      & \O, \o   \cr                    
  1042.    \L odz, \l\'odka           & \\L, \\l      & \L, \l   \cr                    
  1043.    Nu\ss                      & \\ss          & \ss      \cr                    
  1044.    !`Si!                      & {!}{\`{}}     & !`       \cr                    
  1045.    ?`Si?                      & {?}{\`{}}     & ?`       \cr                    
  1046.                              & \lb\\it\\\$\rb & {\it\$}  \cr                    
  1047.       }                                                                         
  1048.                                                                                 
  1049. \toindex{AE}                                                                    
  1050. \toindex{ae}                                                                    
  1051. \toindex{OE}                                                                    
  1052. \toindex{oe}                                                                    
  1053. \toindex{AA}                                                                    
  1054. \toindex{aa}                                                                    
  1055. \toindex{O}                                                                     
  1056. \toindex{o}                                                                     
  1057. \toindex{L}                                                                     
  1058. \toindex{l}                                                                     
  1059. \toindex{ss}                                                                    
  1060.                                                                                 
  1061. Typeset the sentence in each of the following exercises:                        
  1062.                                                                                 
  1063. \exercise Does \AE schylus understand \OE dipus?                                
  1064.                                                                                 
  1065. \exercise The smallest internal unit of \TeX{} is about 53.63\AA.               
  1066.                                                                                 
  1067. \exercise They took some honey and plenty of money wrapped up in a              
  1068. {\it \$}5 note.                                                                 
  1069.                                                                                 
  1070. \exercise \'El\`eves, refusez vos le\c cons! Jetez vos cha\~\i nes!             
  1071.                                                                                 
  1072. \exercise Za\v sto tako polako pijete \v caj?                                   
  1073.                                                                                 
  1074. \exercise Mein Tee ist hei\ss.                                                  
  1075.                                                                                 
  1076. \exercise Peut-\~etre qu'il pr\'ef\`ere le caf\'e glac\'e.                      
  1077.                                                                                 
  1078. \exercise ?`Por qu\'e no bebes vino blanco? !`Porque est\'a avinagrado!         
  1079.                                                                                 
  1080. \exercise M\'\i\'\j n idee\"en worden niet be\"\i nvloed.                       
  1081.                                                                                 
  1082. \exercise Can you take a ferry from \"Oland to \AA land?                        
  1083.                                                                                 
  1084. \exercise T\"urk\c ce konu\c san ye\u genler nasillar?                          
  1085.                                                                                 
  1086.                                                                                 
  1087. \def\bdots{$\textfont0=\tenbf \ldots$} %%% boldface version of \ldots           
  1088.                                                                                 
  1089. \subsection{Dots, dashes, quotes, \bdots}                                       
  1090.                                                                                 
  1091. Typing has always been a compromise: the small number of keys                   
  1092. (compared to the number of typeset symbols available) has forced                
  1093. some changes on the typist.  When preparing material using \TeX{},              
  1094. there is no need to be so restricted. In this section we'll look                
  1095. at some differences between typing and using \TeX\null.                         
  1096.                                                                                 
  1097. There are four types of dashes that are used.  The hyphen is used               
  1098. for combining words into one unit as with mother-in-law.                        
  1099. \TeXref{3--5}                                                                   
  1100. The en-dash is used to indicate a sequence of page numbers, years               
  1101. or such things. The em-dash is a grammatical symbol.  The minus                 
  1102. sign is used for negative numbers. Here they are with their uses:               
  1103.                                                                                 
  1104. \maketable [Different types of dashes]                                          
  1105. \halign{                                                                        
  1106.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil         
  1107.                         & \hfil # \hfil\cr                                      
  1108.    \bf Name& \bf \TeX{} input & \bf \TeX{} output & \bf Example\cr              
  1109.    \noalign{\hrule} \noalign{\smallskip}                                        
  1110.    hyphen     & -         & -   & The space is 3-dimensional. \cr               
  1111.    en-dash    & {-}{-}    & --  & Read pages 3--4. \cr                          
  1112.    em-dash    & {-}{-}{-} & --- & I saw them---there were 3 men alive. \cr      
  1113.    minus sign & \$-\$     & $-$ & The temperature dropped to $-$3 degrees. \cr  
  1114.       }                                                                         
  1115.                                                                                 
  1116. \exercise I entered the room and---horrors---I saw both my                      
  1117. father-in-law and my mother-in-law.                                             
  1118.                                                                                 
  1119. \exercise The winter of 1484--1485 was one of discontent.                       
  1120.                                                                                 
  1121.                                                                                 
  1122.                                                                                 
  1123. Another difference between typing and using \TeX{} is the use of                
  1124. quotation marks.  Opening and closing quotation marks are the                   
  1125. same on a typewriter.  They are produced in \TeX{} by using the                 
  1126. apostrophe or prime key {\tt \'{}} and backprime key {\tt \`{}}\null.           
  1127. An open quote is produced by {\tt {\`{}}{\`{}}} and the                         
  1128. close quote by {\tt {\'{}}{\'{}}}\null.\TeXref{3} Similarly the                 
  1129. opening single quote is produced by {\tt {\`{}}} and the closing                
  1130. single quote by {\tt {\'{}}}\null. Notice that there is no need                 
  1131. to use the usual typing quotation mark (it normally gives a close               
  1132. quote, but don't count on it).                                                  
  1133.                                                                                 
  1134. \exercise His ``thoughtfulness'' was impressive.                                
  1135.                                                                                 
  1136. \exercise Frank wondered, ``Is this a girl that can't say `No!'?''              
  1137.                                                                                 
  1138. Sometimes ellipses (three dots) are used to indicate a passage                  
  1139. of time or missing material.  Typing three periods will give                    
  1140. three dots very close together. The dots with proper spacing will               
  1141. be produced by having {\tt \\dots} in your input file.                          
  1142. \TeXref{173}                                                                    
  1143. \toindex{dots}                                                                  
  1144.                                                                                 
  1145. \exercise He thought, ``\dots and this goes on forever, perhaps to the          
  1146. last recorded syllable.''                                                       
  1147.                                                                                 
  1148. Another problem with dots is that the period after an                           
  1149. abbreviation normally has less space after it than does the                     
  1150. period at the end of a sentence. There are two ways to solve this               
  1151. problem: the dot can be followed by either {\tt\\\sp} or {\tt\~{}}              
  1152. to change the spacing.                                                          
  1153. \TeXref{91--92}                                                                 
  1154. The second alternative will give an unbreakable space; when such                
  1155. a space is between two words, these words must typeset on the                   
  1156. same line. The input {\tt Prof.\~{}Knuth} would cause those two                 
  1157. words to be typeset on one line.  This is desirable for names                   
  1158. like Vancouver, B.~C. and Mr.~Jones so that ``Mr.'' and ``Jones''               
  1159. do not end up on separate lines. Notice that no backslash is used               
  1160. with the unbreakable space.                                                     
  1161.                                                                                 
  1162. \exercise Have you seen Ms.~Jones?                                              
  1163.                                                                                 
  1164. \exercise Prof.~Smith and Dr.~Gold flew from                                    
  1165. \ifcanspell                                                                     
  1166. Halifax N.~S. to Montr\'eal, P.~Q. via Moncton, N.~B.                           
  1167. \else                                                                           
  1168. L.~A. to Washington, D.~C., via Fargo, N.~D.                                    
  1169. \fi                                                                             
  1170.                                                                                 
  1171.                                                                                 
  1172. \subsection{Different fonts}                                                    
  1173.                                                                                 
  1174. The most obvious difference between typewritten text and \TeX{}                 
  1175. output is undoubtedly the different fonts or types of symbols                   
  1176. used. When \TeX{} starts up it has sixteen fonts available.  Some               
  1177. of these are used for technical purposes, but even so there are                 
  1178. several different typefaces available as can be seen in the                     
  1179. following table. A complete list of the sixteen fonts is given in               
  1180. Appendix F of {\bf The \TeX{}book}.                                             
  1181. \TeXref{427--432}                                                               
  1182. Most of them are used automatically; a mathematical subscript,                  
  1183. for example, is put in smaller type by \TeX{} with no special                   
  1184. user intervention.                                                              
  1185.                                                                                 
  1186. To change from the usual (roman) typeface to italic, the control                
  1187. word {\tt \\it} is used.  To change back to the usual roman                     
  1188. typeface, use {\tt \\rm}. For example, you could have the                       
  1189. following sentence: {\tt I started with roman type, \\it switched               
  1190. to italic type, \\rm and returned to roman type}. This would give               
  1191. the following: I started with roman type, \it switched to italic                
  1192. type, \rm and returned to roman type.                                           
  1193.                                                                                 
  1194. Typefaces other than italic are also available. Those given below               
  1195. are the ones most commonly used.  They are available immediately                
  1196. when \TeX{} starts. A little later we'll see how to use other                   
  1197. typefaces that aren't available when \TeX{} starts.                             
  1198.                                                                                 
  1199. \maketable [Font Samples]                                                       
  1200. \halign{                                                                        
  1201.    \strut \hfil # \hfil & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr      
  1202.    \bf Font name & \bf \TeX{} switch sequence & \bf Sample of typeface \cr      
  1203.    \noalign{\hrule} \noalign{\smallskip}                                        
  1204.    Roman       & \\rm  & \rm This is roman type. \cr                            
  1205.    Boldface    & \\bf  & \bf This is boldface type. \cr                         
  1206.    Italic      & \\it  & \it This is italic type. \cr                           
  1207.    Slanted     & \\sl  & \sl This is slanted type. \cr                          
  1208.    Typewriter  & \\tt  & \tt This is typewriter type. \cr                       
  1209.    Math symbol${}~1$ & \\cal & $\cal SOME\hbox{\quad}SCRIPT                     
  1210.                                      \hbox{\quad}LETTERS$\rm. \cr               
  1211.       }                                                                         
  1212.                                                                                 
  1213. \footnote{}{\llap{$~1$} This example is cheating since you need                 
  1214. to know a little about mathematics input to use it, but I wanted                
  1215. to include it anyway.  You'll be able to use these letters after                
  1216. you study the use of mathematical symbols.}                                     
  1217. \nobreak                                                                        
  1218. \toindex{it}                                                                    
  1219. \toindex{rm}                                                                    
  1220. \toindex{bf}                                                                    
  1221. \toindex{sl}                                                                    
  1222. \toindex{tt}                                                                    
  1223.                                                                                 
  1224. The slanted and italic fonts seem quite similar at first.  It is                
  1225. easy to see the difference between the letter ``a'' in each                     
  1226. sample. When changing from a slanted or italic font to a roman                  
  1227. font, the last letter in the first font will lean towards the                   
  1228. first letter of the roman font; this looks cramped, and to                      
  1229. compensate there is a little extra space that can be added called               
  1230. the {\sl italic correction}. This is done using the control                     
  1231. symbol {\tt \\/}.                                                               
  1232. \toindex{/}                                                                     
  1233. In the following sentence, there is no italic correction after                  
  1234. the first sequence of italic letters but there is after the                     
  1235. second sequence; see the difference: {\it If} the italic                        
  1236. correction is not used the letters are too close together, but                  
  1237. {\it if\/} the correction is used, the spacing is better.  There                
  1238. is no need for the italic correction when the italic characters                 
  1239. are followed by a comma or a period.                                            
  1240.                                                                                 
  1241.                                                                                 
  1242. It is possible to use fonts other than those initially defined in               
  1243. \TeX{} when desired (assuming that they are available on                        
  1244. your computer system, of course).  Different sizes can be used                  
  1245. with the aid of the control word {\tt \\magstep}. To define your                
  1246. new font you will have to know its name on your computer system.                
  1247. For example, the roman typeface is called ``cmr10'' on most                     
  1248. systems.  If you use {\tt \\font\\bigrm = cmr10 scaled \\magstep                
  1249. 1}, you can then use {\tt\\bigrm} in exactly the same way as you                
  1250. use {\tt\\it} or {\tt\\rm}.                                                     
  1251. \TeXref{13--17}                                                                 
  1252. \toindex{magstep}                                                               
  1253. \toindex{font}                                                                  
  1254. \toindex{scaled}                                                                
  1255.                                                                                 
  1256. Switching via {\tt\\bigrm} will give roman type that is larger                  
  1257. than the usual by 20\%\null.  {\tt \\font\\bigbigrm = cmr10                     
  1258. scaled \\magstep 2} will define a font that is about 44\% larger                
  1259. than the usual roman typeface.  The sizes {\tt \\magstep~0} to                  
  1260. {\tt \\magstep~5} are available.  On most computers {\tt \\magstephalf}         
  1261. is also available; this represents an enlargement of                            
  1262. about 9.5\%\null. Here are some samples at various sizes:                       
  1263.                                                                                 
  1264. \maketable [Different Font Magnifications]                                      
  1265. \halign{                                                                        
  1266.    \strut \hfil\tt # \hfil & \quad # \hfil \cr                                  
  1267.    \bf Magnification & \bf Sample \cr                                           
  1268.    \noalign{\hrule} \noalign{\smallskip}                                        
  1269.    \\magstep0     & \rm  Sample text at magstep 0. \cr                          
  1270.    \\magstephalf  & \halfrm  Sample text at magstephalf. \cr                    
  1271.    \\magstep 1     & \brm  Sample text at magstep 1. \cr                        
  1272.    \\magstep 2     & \bbrm  Sample text at magstep 2. \cr                       
  1273.    \\magstep 3     & \bbbrm  Sample text at magstep 3. \cr                      
  1274.    \\magstep 4     & \bbbbrm  Sample text at magstep 4. \cr                     
  1275.    \\magstep 5     & \bbbbbrm  Sample text at magstep 5. \cr                    
  1276.       }                                                                         
  1277.                                                                                 
  1278. It's also possible to use completely new typefaces.  These                      
  1279. are dependent on system availability, of course.  Many systems                  
  1280. have a file called CMSS10 which is a font that contains sans                    
  1281. serif letters.  Using {\tt \\font\\sf = cmss10} will allow the                  
  1282. control word {\tt\\sf} to be used in the same manner as {\tt\\bf}.              
  1283. Having made this definition, the input                                          
  1284. \displaytext{\tt \\sf Here is a sample of our new Sans Serif font.}             
  1285. will produce                                                                    
  1286. \displaytext{\sf Here is a sample of our new Sans Serif font.}                  
  1287.                                                                                 
  1288. \exercise What problem might have arisen if we had used {\tt \\ss}              
  1289. instead of {\tt \\sf} to turn on the Sans Serif font? Hint: if                  
  1290. the answer doesn't occur to you at first, think about the German                
  1291. alphabet and it will finally come to you.                                       
  1292.                                                                                 
  1293. \exercise Typeset a paragraph of magnified sans serif text.                     
  1294.                                                                                 
  1295. The extra fonts available may vary from site to site.  The ones                 
  1296. in the following table are available at most places.                            
  1297.                                                                                 
  1298. \maketable [External Fonts Names]                                               
  1299. \halign{                                                                        
  1300. \strut \tt # \hfil & \quad \tt # \hfil & \quad \tt # \hfil                      
  1301.                    & \quad \tt # \hfil & \quad \tt # \hfil                      
  1302.                    & \quad \tt # \hfil  \cr                                     
  1303. \noalign{\hrule} \noalign{\smallskip}                                           
  1304. CMBSY10   &CMBXSL10  &CMBXTI10  &CMBX10    &CMBX12    &CMBX5      \cr           
  1305. CMBX6     &CMBX7     &CMBX8     &CMBX9     &CMB10     &CMCSC10    \cr           
  1306. CMDUNH10  &CMEX10    &CMFF10    &CMFIB8    &CMFI10    &CMITT10    \cr           
  1307. CMMIB10   &CMMI10    &CMMI12    &CMMI5     &CMMI6     &CMMI7      \cr           
  1308. CMMI8     &CMMI9     &CMR10     &CMR12     &CMR17     &CMR5       \cr           
  1309. CMR6      &CMR7      &CMR8      &CMR9      &CMSLTT10  &CMSL10     \cr           
  1310. CMSL12    &CMSL8     &CMSL9     &CMSSBX10  &CMSSDC10  &CMSSI10    \cr           
  1311. CMSSI12   &CMSSI17   &CMSSI8    &CMSSI9    &CMSSQI8   &CMSSQ8     \cr           
  1312. CMSS10    &CMSS12    &CMSS17    &CMSS8     &CMSS9     &CMSY10     \cr           
  1313. CMSY5     &CMSY6     &CMSY7     &CMSY8     &CMSY9     &CMTCSC10   \cr           
  1314. CMTEX10   &CMTEX8    &CMTEX9    &CMTI10    &CMTI12    &CMTI7      \cr           
  1315. CMTI8     &CMTI9     &CMTT10    &CMTT12    &CMTT8     &CMTT9      \cr           
  1316. CMU10     &CMVTT10                                                \cr           
  1317. }                                                                               
  1318.                                                                                 
  1319. Here's a little background about these names.  The first two                    
  1320. letters {\tt CM} stands for Computer Modern, the name given to                  
  1321. this font family by the designer. The number at the end is the                  
  1322. point size: 10 point type is the normal size, 7 point is the                    
  1323. normal size for subscripts, and 5 point is the normal size for                  
  1324. subscripts of subscripts, 12 point is 20\% larger than 10 point,                
  1325. etc. If the letters {\tt CM} are followed by {\tt B}, it is a                   
  1326. boldface type.  Similarly {\tt R} indicates roman, {\tt I} is for               
  1327. italics, {\tt CSC} is for small caps, {\tt SL} is for slanted,                  
  1328. {\tt SS} is for sans serif, and {\tt TT} is for typewriter type,                
  1329.                                                                                 
  1330. \exercise Find the fonts available on your system, and print out                
  1331. all the letters and numbers in several of them.                                 
  1332.                                                                                 
  1333. \exercise The font {\tt CMR12} is 20\% larger than {\tt CMR10}.                 
  1334. Also {\tt \\magstep~1} magnifies the type by 20\%.  Take some                   
  1335. text and print it using {\tt CMR12} then using {\tt CMR10} scaled               
  1336. by {\tt \\magstep~1}. The results are quite different!                          
  1337.                                                                                 
  1338.                                                                                 
  1339.                                                                                 
  1340.                                                                                 
  1341. \section{The shape of things to come}                                           
  1342.                                                                                 
  1343. In this section we want to see how to make text have different                  
  1344. shapes or sizes.  One may use \TeX{} with the default sizes, of                 
  1345. course, just as we have been doing so far.  We'll now become more               
  1346. creative with our output.  In discussing the size of various                    
  1347. parts of a page of text, there are several units of measure we                  
  1348. can use.                                                                        
  1349.                                                                                 
  1350. \subsection{Units, units, units}                                                
  1351.                                                                                 
  1352. \TeX{} can measure length using many types of units.  The most                  
  1353. common are the inch, the \centimeter, the point, the pica. The                  
  1354. abbreviations for these units are {\tt in}, {\tt cm}, {\tt pt},                 
  1355. and {\tt pc} respectively. The point is defined by the equation 1               
  1356. inch = 72.27 points, and the pica by 1 pica = 12 points. Thus a                 
  1357. point is rather small and is about the size of a decimal point.                 
  1358. Here is a sample to give an idea of the comparative sizes:                      
  1359. \def\pip{\vrule height 4 true pt }                                              
  1360. \TeXref{57}                                                                     
  1361.                                                                                 
  1362. $$ \hbox{1 inch: } \hbox to 1 true in{\pip\hrulefill\pip}$$                     
  1363. $$ \hbox{1 \centimeter: }\hbox to 1 true cm{\pip\hrulefill\pip}$$               
  1364. $$ \hbox{20 points: }\hbox to 20 true pt{\pip\hrulefill\pip}$$                  
  1365. $$ \hbox{1 pica: } \hbox to 1 true pc{\pip\hrulefill\pip}$$                     
  1366.                                                                                 
  1367. Thus points are used to make fine changes; a pica is about the                  
  1368. distance between the baselines of two consecutive lines of                      
  1369. (unmagnified) normal text.  \TeX{} is quite exact about                         
  1370. dimensions; internally its smallest unit is less than one                       
  1371. four-millionth of an inch.  Hence it is the resolution of the                   
  1372. output device that will determine the accuracy of the output.                   
  1373.                                                                                 
  1374. There are two other units that are sometimes useful that have                   
  1375. different sizes in different fonts. The {\tt ex} is about the                   
  1376. height of a small ``x'' and the {\tt em} is a little smaller than               
  1377. the width of a capital ``M''\null.                                              
  1378. \TeXref{60}                                                                     
  1379.                                                                                 
  1380. The shape of the output is generally determined by control                      
  1381. words. There are many such words; these allow very fine control                 
  1382. of the resulting text.  But most of the time only a small number                
  1383. of them are necessary.                                                          
  1384.                                                                                 
  1385. \subsection{Page shape}                                                         
  1386.                                                                                 
  1387. The text on a page consists of three basic parts.  There is the                 
  1388. headline above the main text; this often contains a chapter                     
  1389. title, section title, or a page number, and may differ on odd and               
  1390. even pages. Below this is the main text, which includes any                     
  1391. footnotes. And finally there is the footline that might contain a               
  1392. page number.                                                                    
  1393.                                                                                 
  1394. In the examples we have seen so far, the headline has been blank.               
  1395. The footline has contained either a \centred{} number or, if {\tt               
  1396. \\nopagenumbers} had been used, has also been blank.  We'll have                
  1397. more to say about headlines and footlines later in this section.                
  1398. For the moment let's concentrate on the main text.                              
  1399.                                                                                 
  1400. To finish one page and start a new one, {\tt \\vfill \\eject} can               
  1401. be used.  The control word {\tt \\eject} forces the completion of               
  1402. the current page, while {\tt \\vfill} causes any left over                      
  1403. vertical space to gathered at the bottom of the page (you might                 
  1404. try leaving out the {\tt \\vfill} as an experiment to see how the               
  1405. vertical \analog{} of justified horizontal lines of text works).                
  1406. \toindex{vfill}                                                                 
  1407. \toindex{eject}                                                                 
  1408.                                                                                 
  1409.                                                                                 
  1410. {\hsize=4in                                                                     
  1411. The current horizontal width of the text on the page is described               
  1412. by the control word {\tt \\hsize}.  It can be changed, say to 4                 
  1413. inches, by {\tt \\hsize = 4 in\ } at any desired time using                     
  1414. methods to be described in the next few sections. The value of                  
  1415. {\tt \\hsize} in effect when the paragraph is completed                         
  1416. determines the width of the paragraph. As can be seen in this                   
  1417. paragraph, the text width can be changed (in this case to 4                     
  1418. inches) for a single paragraph.  Because it represents the                      
  1419. current value of the horizontal width, expressions such as {\tt                 
  1420.  \\hsize = 0.75\\hsize} can make a new value that is relative                   
  1421. to the old one. \par}                                                           
  1422. \toindex{hsize}                                                                 
  1423.                                                                                 
  1424. The vertical \analog{} of {\tt \\hsize} is {\tt \\vsize}, which                 
  1425. is the current height of the main text.  It can be reset, just                  
  1426. like {\tt \\hsize}.  Thus, {\tt \\vsize = 8 in\ } can be used to                
  1427. change the vertical height of the main text. Note that {\tt \\vsize}            
  1428. is the size of the text exclusive of any headline or                            
  1429. footline material.                                                              
  1430. \toindex{vsize}                                                                 
  1431.                                                                                 
  1432. Text can also be shifted across the page.  The upper left corner                
  1433. of the text is one inch down and one inch in from the upper left                
  1434. corner of the page.  The control words {\tt \\hoffset} and {\tt \\voffset}      
  1435. are used to shift the text horizontally and                                     
  1436. vertically.  Thus {\tt \\hoffset = .75 in} and {\tt \\voffset =                 
  1437. -.5 in} would shift the text an additional .75 inches to the                    
  1438. right and .5 inches up. Most of the time you'll need to set {\tt                
  1439. \\hoffset}, {\tt \\voffset}, and {\tt \\vsize} at the beginning                 
  1440. of your document only.                                                          
  1441. \TeXref{251}                                                                    
  1442. \toindex{hoffset}                                                               
  1443. \toindex{voffset}                                                               
  1444.                                                                                 
  1445. \maketable [Control words for page sizes]                                       
  1446. \halign{                                                                        
  1447.    \strut \hfil # & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr            
  1448.    \bf Name & \bf \TeX{} Control Word & \bf \TeX{} default value (inches)\cr    
  1449.    \noalign{\hrule} \noalign{\smallskip}                                        
  1450.    horizontal width  & \\hsize   & 6.5 \cr                                      
  1451.    vertical width    & \\vsize   & 8.9 \cr                                      
  1452.    horizontal offset${}~1$  & \\hoffset & 0 \cr                                 
  1453.    vertical offset${}~1$   & \\voffset & 0 \cr                                  
  1454.       }                                                                         
  1455.                                                                                 
  1456. \footnote{}{\llap{$~1$}The text is initially 1 inch down and 1                  
  1457. inch in from upper left corner of the page.}                                    
  1458. \nobreak                                                                        
  1459.                                                                                 
  1460. \exercise Enter a paragraph of text that is a few lines long.                   
  1461. Take several copies of your paragraph and put {\tt \\hsize = 5                  
  1462. in\ } before one and {\tt \\hsize = 10 cm\ } in front of a second               
  1463. one.  Try a few other values for {\tt \\hsize}.                                 
  1464.                                                                                 
  1465. \exercise Put {\tt \\hoffset = .5 in\ } and {\tt \\voffset = 1                  
  1466. in\ } before the first paragraph of your previous exercise.                     
  1467.                                                                                 
  1468. \exercise Take your previous exercise and put {\tt \\vsize = 2                  
  1469. in\ } before the first paragraph.                                               
  1470.                                                                                 
  1471. In the previous section we saw that it is possible to use fonts                 
  1472. of larger size by using the {\tt \\magstep} control word.  It's                 
  1473. also possible to magnify the entire document at once. If {\tt                   
  1474. \\magnification = \\magstep 1} appears at the top of your document,             
  1475. then all of your output is magnified by 20\%\null.  The other                   
  1476. values of {\tt \\magstep} can be used, too. {\bf It should be                   
  1477. emphasized that {\tt \\magnification} can only be used before                   
  1478. even a single character is typeset.}  This magnification creates                
  1479. a problem in units; if the document is to be magnified by 20\%                  
  1480. and {\tt \\hsize = 5 in} appears in the \TeX{} input file, should               
  1481. the final output have an {\tt \\hsize} of 5 inches or should it                 
  1482. be magnified by 20\% to 6 inches? Unless told otherwise, all the                
  1483. dimensions will be magnified so that, in this case, {\tt \\hsize}               
  1484. would be 6 inches in the final output.  This means that all the                 
  1485. dimensions will increase uniformly when {\tt \\magnification} is                
  1486. used.  But for some special situations it might not be desirable                
  1487. for this to happen; for example, you might want to leave a space                
  1488. of exactly 3 inches to insert a figure.  In this case any unit                  
  1489. can be modified by {\tt true} so that {\tt \\hsize = 5 true in}                 
  1490. will always set the line width to 5 inches, regardless of                       
  1491. magnification. \TeXref{59--60} \toindex{magnification}                          
  1492.                                                                                 
  1493. \exercise Put {\tt \\magnification = \\magstep 1} as the first                  
  1494. line in one of your input files and see how the output changes.                 
  1495.                                                                                 
  1496. \subsection{Paragraph shape}                                                    
  1497.                                                                                 
  1498. When \TeX{} is reading the text to be typeset from your input                   
  1499. file, it reads in a paragraph at a time and then typesets it.                   
  1500. This means that there is a lot of control over paragraph shapes,                
  1501. but also that some care must be taken.  We've already seen that                 
  1502. {\tt \\hsize} can be used to control the width of a single                      
  1503. paragraph.  But suppose the following appeared as part of your                  
  1504. input file:                                                                     
  1505.                                                                                 
  1506. \beginuser                                                                      
  1507. \\hsize = 5 in                                                                  
  1508. Four score and seven years $\ldots$                                             
  1509. $\vdots$                                                                        
  1510. $\ldots$ from this earth.                                                       
  1511. \\hsize = 6.5 in                                                                
  1512.                                                                                 
  1513. \enduser                                                                        
  1514.                                                                                 
  1515. What is the width of the paragraph?  The {\tt \\hsize} was                      
  1516. changed at the start of the paragraph and again at the end.                     
  1517. Since the paragraph was not completed (by putting in a blank line               
  1518. or {\tt \\par}) until after the second change, the paragraph                    
  1519. would be typeset with a width of 6.5 inches. However, if a blank                
  1520. line were inserted before {\tt \\hsize = 6.5 in}, then the                      
  1521. paragraph would be typeset with a width of 5 inches.  So, in                    
  1522. general, when a paragraph is set, the values of the parameters                  
  1523. that are in effect when the paragraph is completed are the ones                 
  1524. that are used.                                                                  
  1525.                                                                                 
  1526. Here is a table with some paragraph parameters:                                 
  1527.                                                                                 
  1528. \maketable [Some paragraph shape parameters]                                    
  1529. \halign{                                                                        
  1530.    \strut \hfil # & \quad \hfil \tt # \hfil & \hfil \quad # \hfil\cr            
  1531.    \bf Function & \bf \TeX{} Control Word & \bf \TeX{} default\cr               
  1532.    \noalign{\hrule} \noalign{\smallskip}                                        
  1533.    width & \\hsize & 6.5 inches \cr                                             
  1534.    indentation on first line & \\parindent & 20 points\cr                       
  1535.    distance between lines   & \\baselineskip & 12 points\cr                     
  1536.    distance between paragraphs & \\parskip & 0 points \cr                       
  1537.       }                                                                         
  1538.                                                                                 
  1539. \toindex{parindent}                                                             
  1540. \toindex{parskip}                                                               
  1541. \toindex{baselineskip}                                                          
  1542.                                                                                 
  1543. The control word {\tt \\noindent} may be used at the beginning of               
  1544. a paragraph to avoid the automatic indentation on the first line.               
  1545. This control word will only affect the paragraph being set when                 
  1546. it is invoked (of course {\tt \\parindent = 0 pt} will cause no                 
  1547. indentation for all paragraphs).                                                
  1548. \toindex{noindent}                                                              
  1549.                                                                                 
  1550. {\narrower                                                                      
  1551. A more flexible way to control the width of a paragraph is to use               
  1552. {\tt \\rightskip} and {\tt \\leftskip}.  Setting {\tt \\leftskip                
  1553. = 20 pt} causes the left margin of the paragraph to be moved in                 
  1554. an extra twenty points. Negative values may be assigned to {\tt                 
  1555. \\leftskip} to move the left margin out. The control word {\tt                  
  1556. \\rightskip} does the same to the right side of the paragraph.                  
  1557. The single control word {\tt \\narrower} is the equivalent of                   
  1558. setting both {\tt \\leftskip} and {\tt \\rightskip} equal to {\tt               
  1559. \\parindent}.  This is quite useful for long quotations, and                    
  1560. this paragraph is an example of its use. As with {\tt \\hsize},                 
  1561. the value of {\tt \\leftskip} and {\tt \\rightskip} in effect                   
  1562. when the paragraph is completed is the one which will apply to                  
  1563. the whole paragraph.                                                            
  1564. \TeXref{100}                                                                    
  1565.                                                                                 
  1566. }                                                                               
  1567. \toindex{leftskip}                                                              
  1568. \toindex{rightskip}                                                             
  1569. \toindex{narrower}                                                              
  1570.                                                                                 
  1571. \exercise Make two paragraphs with the following specifications:                
  1572. the left margin of both paragraphs is indented by 1.5 inches,                   
  1573. the right margin of the first paragraph is indented by 0.75                     
  1574. inches, and the right margin of the second paragraph is indented                
  1575. by 1.75 inches.                                                                 
  1576.                                                                                 
  1577. \def\hangparagraph{ Lines can be made with different lengths                    
  1578. within one paragraph by using {\tt \\hangindent} and {\tt                       
  1579. \\hangafter}.  The amount of the indentation is determined by value             
  1580. of {\tt \\hangindent}. If {\tt \\hangindent} is positive, the                   
  1581. indentation is made from the left, and if it is negative it is                  
  1582. made from the right. The lines on which the indentation occurs is               
  1583. controlled by {\tt \\hangafter}.  If {\tt \\hangafter} is                       
  1584. positive then it determines the number of lines at full width                   
  1585. before the indentation starts.  Thus if {\tt \\hangindent = 1.75                
  1586. in} and {\tt \\hangafter = 6}, then the first six lines will be                 
  1587. at full width and the rest will be indented by 1.75 inches from                 
  1588. the left. On the other hand if {\tt \\hangindent = \hbox{-1.75}                 
  1589. in} and {\tt \\hangafter = -6}, then the first six lines will be                
  1590. indented by 1.75 inches from the right and the rest will be at                  
  1591. full width. \TeX{} resets to the default values {\tt \\hangindent               
  1592. = 0 pt} and {\tt \\hangafter = 1} after each paragraph. These                   
  1593. control words are useful for paragraphs with ``hanging indents''                
  1594. and for flowing a paragraph around space reserved for a figure.                 
  1595. \TeXref{355}                                                                    
  1596. The control word {\tt \\hang} at the beginning of the                           
  1597. paragraph will cause the first line to be of full width ({\tt                   
  1598. \\hangafter=1}) and the rest of the paragraph to be indented by                 
  1599. the current value of {\tt \\parindent}. But you do have to use                  
  1600. {\tt \\noindent} if you want the first line to extend all the way               
  1601. to the left margin.                                                             
  1602. \TeXref{102}                                                                    
  1603. \par}                                                                           
  1604.                                                                                 
  1605. \hangafter=6 \hangindent=1.75in                                                 
  1606. \hangparagraph                                                                  
  1607. \toindex{hangindent}                                                            
  1608. \toindex{hangafter}                                                             
  1609. \toindex{hang}                                                                  
  1610.                                                                                 
  1611. Here is the previous paragraph repeated with {\tt \\hangafter = -6}             
  1612. and {\tt \\hangindent = -1.75}.                                                 
  1613.                                                                                 
  1614. \hangafter=-6 \hangindent=-1.75in \hangparagraph                                
  1615.                                                                                 
  1616.                                                                                 
  1617. The control word {\tt \\parshape} can be used to make paragraphs with           
  1618. a greater variety of shapes.                                                    
  1619. \TeXref{101}                                                                    
  1620. \toindex{parshape}                                                              
  1621.                                                                                 
  1622. Another useful control word for setting paragraphs is {\tt \\item}.             
  1623. It can be used to make various types of itemized lists,                         
  1624. and is invoked using the pattern {\tt \\item\lb$\ldots$\rb}\null.               
  1625. This causes the next  paragraph to be formed with every line is                 
  1626. indented by {\tt \\parindent} and, in addition, the first line                  
  1627. labeled on the left by whatever is between the braces.  It is                   
  1628. usually used with {\tt \\parskip = 0 pt}, since that control word               
  1629. determines the vertical space between the different items. The control          
  1630. word {\tt \\itemitem} is the same as {\tt \\item} except that the               
  1631. indentation is twice as far, that is, twice the value of                        
  1632. {\tt \\parindent}.                                                              
  1633. \TeXref{102}                                                                    
  1634. Here is an example:                                                             
  1635. \toindex{item}                                                                  
  1636. \toindex{itemitem}                                                              
  1637.                                                                                 
  1638. \beginliteral                                                                   
  1639. \parskip = 0pt \parindent = 30 pt                                               
  1640. \noindent                                                                       
  1641. Answer all the following questions:                                             
  1642. \item{(1)} What is question 1?                                                  
  1643. \item{(2)} What is question 2?                                                  
  1644. \item{(3)} What is question 3?                                                  
  1645. \itemitem{(3a)} What is question 3a?                                            
  1646. \itemitem{(3b)} What is question 3b?                                            
  1647. @endliteral                                                                     
  1648.                                                                                 
  1649.                                                                                 
  1650. \noindent                                                                       
  1651. will produce                                                                    
  1652. \vskip\baselineskip                                                             
  1653.                                                                                 
  1654. {\parskip = 0pt \parindent = 30 pt                                              
  1655. \noindent                                                                       
  1656. Answer all the following questions:                                             
  1657. \item{(1)} What is question 1?                                                  
  1658. \item{(2)} What is question 2?                                                  
  1659. \item{(3)} What is question 3?                                                  
  1660. \itemitem{(3a)} What is question 3a?                                            
  1661. \itemitem{(3b)} What is question 3b?                                            
  1662.                                                                                 
  1663. }                                                                               
  1664.                                                                                 
  1665. \exercise Make a paragraph several lines long and use it with                   
  1666. the {\tt \\item} control word to see the ``hanging indent.'' Now                
  1667. take the same paragraph and use it with different values of {\tt                
  1668. \\parindent} and {\tt \\hsize}.                                                 
  1669.                                                                                 
  1670. Now let's see how to put space between paragraphs.  The control                 
  1671. word {\tt \\parskip} is used to determine how much space is                     
  1672. normally left between paragraphs. So if you put {\tt \\parskip =                
  1673. 12 pt} at the beginning of your \TeX{} source file, there will be               
  1674. 12 points between paragraphs unless other instructions are                      
  1675. given. The control word {\tt \\vskip} can be used to insert extra               
  1676. vertical space between paragraphs.  If {\tt \\vskip 1 in} or {\tt               
  1677. \\vskip 20 pt} appears between two paragraphs, then the extra                   
  1678. space is inserted.                                                              
  1679.                                                                                 
  1680. There are a couple of peculiarities of {\tt \\vskip} that seem                  
  1681. quite strange at first.  If you have {\tt \\vskip 3 in} and the                 
  1682. skip starts two inches from the bottom of the page, the rest of                 
  1683. the page is skipped, but the extra one inch is {\it not\/}                      
  1684. skipped at the top of the next page.  In other words, {\tt \\vskip}             
  1685. {\bf will not insert space across page boundaries}.  In                         
  1686. fact, {\tt \\vskip~1~in} will have no effect at all if it happens               
  1687. to appear at the top of a page! For many types of vertical                      
  1688. spacing this is quite appropriate.  The space before a section                  
  1689. heading, for example, should not continue across page boundaries.               
  1690.                                                                                 
  1691. A similar phenominon occurs at the beginning of your document.                  
  1692. If, for example, you want a title page with the title about half                
  1693. way down the page, you can not insert the space at the top of the               
  1694. page using {\tt \\vskip}.                                                       
  1695.                                                                                 
  1696. But what if you really want some blank space at the top of a                    
  1697. page? You could start the page with {\tt\\\sp} but this in effect               
  1698. typesets a one line paragraph containing a blank. So while                      
  1699. nothing is typeset, the extra space due to the values of {\tt                   
  1700. \\baselineskip} and {\tt \\parskip} will add extra space. An easier             
  1701. method is to use {\tt \\vglue} instead of {\tt \\vskip} to get                  
  1702. the desired result.  Thus {\tt \\vglue 1 in\ }will leave one inch               
  1703. of blank space at the top of the page.\TeXref{352}                              
  1704. \toindex{vglue}                                                                 
  1705.                                                                                 
  1706.                                                                                 
  1707. We can note in passing that there is another more general method                
  1708. to put material at the top of a page using the control words {\tt               
  1709. \\topinsert} and {\tt \\endinsert}. If {\tt \\topinsert $\ldots$                
  1710. \\endinsert} is used within a page, the material between                        
  1711. {\tt \\topinsert} and {\tt \\endinsert} will appear at the top                  
  1712. of the page, if possible. For example:                                          
  1713.                                                                                 
  1714. \beginuser                                                                      
  1715. \\topinsert                                                                     
  1716. \\vskip 1 in                                                                    
  1717. \\centerline\lb Figure 1\rb                                                     
  1718. \\endinsert                                                                     
  1719. \enduser                                                                        
  1720. \noindent                                                                       
  1721. is useful for inserting figures of a prescribed size.                           
  1722. \TeXref{115}                                                                    
  1723. \toindex{topinsert}                                                             
  1724. \toindex{endinsert}                                                             
  1725.                                                                                 
  1726. There are also some special control words for making small                      
  1727. vertical skips. They are {\tt \\smallskip}, {\tt \\medskip}, and                
  1728. {\tt \\bigskip}. Here is the size of each one:                                  
  1729.                                                                                 
  1730. \def\hrl{\hrule width .5 in}                                                    
  1731.                                                                                 
  1732. \centerline{{\tt \\smallskip}: \vbox{\hrl \smallskip \hrl} \quad                
  1733.             {\tt \\medskip}: \vbox{\hrl \medskip \hrl} \quad                    
  1734.             {\tt \\bigskip}: \vbox{\hrl \bigskip \hrl}                          
  1735.             }                                                                   
  1736. \toindex{smallskip}                                                             
  1737. \toindex{medskip}                                                               
  1738. \toindex{bigskip}                                                               
  1739.                                                                                 
  1740. \subsection{Line shape}                                                         
  1741.                                                                                 
  1742. For most material \TeX{} does a good job of breaking up a                       
  1743. paragraph into lines.  But sometimes it's necessary to add                      
  1744. further instructions. It's possible to force a new line by                      
  1745. inserting {\tt \\hfill \\break} in your input file. It's also                   
  1746. possible to  put some text on a line by itself using the control                
  1747. word {\tt \\line\lb $\ldots$\rb}; then the material between the                 
  1748. braces will be restricted to one line (although the result will                 
  1749. be spread out over the whole line and may be horrible). The                     
  1750. control words {\tt \\leftline\lb $\ldots$\rb}, {\tt \\rightline\lb              
  1751. $\ldots$\rb}, and {\tt \\centerline\lb $\ldots$\rb} will,                       
  1752. respectively, set the material between the braces on a single                   
  1753. line on the left margin, on the right margin, or \centred.  Thus                
  1754. \toindex{hfill}                                                                 
  1755. \toindex{break}                                                                 
  1756. \toindex{centerline}                                                            
  1757. \toindex{leftline}                                                              
  1758. \toindex{rightline}                                                             
  1759. \toindex{line}                                                                  
  1760.                                                                                 
  1761.                                                                                 
  1762. \beginliteral                                                                   
  1763. \leftline{I'm over on the left.}                                                
  1764. \centerline{I'm in the @centre.}                                                
  1765. \rightline{I'm on the right.}                                                   
  1766. \line{I just seem to be spread out all over the place.}                         
  1767. @endliteral                                                                     
  1768.                                                                                 
  1769. \noindent                                                                       
  1770. produces the four lines:                                                        
  1771. \vskip\baselineskip                                                             
  1772.                                                                                 
  1773.                                                                                 
  1774. {                                                                               
  1775. \hbadness = 10000                                                               
  1776. \leftline{I'm over on the left.}                                                
  1777. \centerline{I'm in the \center.}                                                
  1778. \rightline{I'm on the right.}                                                   
  1779. \line{I just seem to be spread out all over the place.}                         
  1780.                                                                                 
  1781. Other types of spacing can be obtained by using the control word {\tt           
  1782. \\hfil}.  This causes all the extra space in the line to be                     
  1783. accumulated at the position where {\tt \\hfil} appears.                         
  1784. Thus if we alter our last example to                                            
  1785. {\tt \\line\lb I just seem to be spread out \\hfil all over the place.\rb}      
  1786. we will get \hfil\break                                                         
  1787. \medskip                                                                        
  1788. \line{I just seem to be spread out \hfil all over the place.}                   
  1789. \medskip                                                                        
  1790. If we have more than one {\tt \\hfil}, they will divide any extra               
  1791. space among themselves equally.  Hence                                          
  1792. {\tt \\line\lb left text \\hfil \centre{} text\\hfil right text.\rb}            
  1793. will produce                                                                    
  1794. \medskip                                                                        
  1795. \line{left text \hfil \centre{} text \hfil right text.}                         
  1796. \toindex{hfil}                                                                  
  1797. }                                                                               
  1798.                                                                                 
  1799. \exercise Typeset the following line:                                           
  1800.                                                                                 
  1801. \line{left end \hfil left tackle \hfil left guard \hfil \centre{} \hfil         
  1802. right guard \hfil right tackle \hfil right end}                                 
  1803.                                                                                 
  1804. \exercise Typeset the following line with twice as much space between           
  1805. ``left'' and ``right-\centre{}'' as between ``right-\centre{}'' and             
  1806. ``right'':                                                                      
  1807.                                                                                 
  1808. \line{left \hfil \hfil right-\centre{} \hfil right}                             
  1809.                                                                                 
  1810. It's possible to move horizontally using {\tt \\hskip} in a                     
  1811. manner analogous with {\tt \\vskip}.                                            
  1812. \toindex{hskip}                                                                 
  1813.                                                                                 
  1814. \exercise What happens with the following input:\hfil\break                     
  1815. {\tt \\line\lb\\hskip 1 in ONE \\hfil TWO \\hfil THREE\rb}                      
  1816.                                                                                 
  1817. The right justification can be canceled by using the                            
  1818. control word {\tt \\raggedright}.                                               
  1819. \toindex{raggedright}                                                           
  1820.                                                                                 
  1821. \subsection{Footnotes}                                                          
  1822.                                                                                 
  1823. The general pattern to make footnotes using \TeX{} is                           
  1824. {\tt \\footnote\lb$\ldots$\rb\lb$\ldots$\rb}\null.                              
  1825.                                                                                 
  1826. The footnote mark goes in between the first set of braces.  Some                
  1827. available marks are {\tt \\dag (\dag)}, {\tt \\ddag (\ddag)}, {\tt \\S          
  1828. (\S)}, and {\tt \\P (\P)}\null.  The text of the footnote                       
  1829. goes between the second set of braces. The use of numbers as                    
  1830. marks is a little less straightforward. The footnote%                           
  1831. \footnote{${}~{21}$}{This is the footnote at the bottom of the page.}           
  1832. at the bottom of the page was produced by using {\tt \\footnote\lb\$\lb         
  1833. \rb\~{}\lb{21}\rb\$\rb\lb This is the footnote at the                           
  1834. bottom of the page.\rb}  after the word ``footnote'' in the                     
  1835. text. This construction is somewhat complicated; we'll see why                  
  1836. it's this way when we know a little more about typesetting                      
  1837. mathematics. But for the moment we can look at it as a way of                   
  1838. getting the job done. You may want to use {\tt \\rm} within the                 
  1839. footnote to ensure that the right font appears.                                 
  1840. \TeXref{117}                                                                    
  1841. \toindex{footnote}                                                              
  1842. \toindex{ddag}                                                                  
  1843. \toindex{S}                                                                     
  1844. \toindex{P}                                                                     
  1845.                                                                                 
  1846. \exercise Make up a page with a relatively long footnote spanning               
  1847. several lines.                                                                  
  1848.                                                                                 
  1849. \exercise Make up a page with two different footnotes on it.                    
  1850.                                                                                 
  1851. \subsection{Headlines and Footlines}                                            
  1852.                                                                                 
  1853. \headline={\hfil \tenrm Page \the\pageno} %example for this section             
  1854.                                                                                 
  1855. The lines for title and page numbers that go above and below the                
  1856. main text are produced by using {\tt \\headline=\lb$\dots$\rb}                  
  1857. and {\tt \\footline=\lb$\dots$\rb}\null.                                        
  1858. \TeXref{252--253}                                                               
  1859.                                                                                 
  1860. The principle is the same as using the control word {\tt \\line\lb              
  1861. $\dots$\rb} within the usual text on the page.  A helpful                       
  1862. control word is {\tt \\pageno} which represents the current page                
  1863. number. Thus {\tt \\headline=\lb\\hfil \\tenrm Page \\the\\pageno\rb}           
  1864. would cause the page number to appear in the upper                              
  1865. right corner preceded by the word ``Page'' (now look at the upper               
  1866. right corner of this page). It is safer to explicitly name the                  
  1867. font that you want to use (in this case {\tt \\tenrm} to use the                
  1868. 10 point roman font), since you are never guaranteed that a                     
  1869. particular font will be in use when the headline or footline is                 
  1870. set. The control word {\tt \\the} takes the internal value of the               
  1871. next word if it is an appropriate control word and prints it as                 
  1872. text. You can also use the control word {\tt \\folio} instead of                
  1873. {\tt \\the \\pageno}. The difference is that {\tt \\folio} will                 
  1874. give roman numerals when {\tt \\pageno} is negative.                            
  1875. \toindex{headline}                                                              
  1876. \toindex{footline}                                                              
  1877. \toindex{pageno}                                                                
  1878. \toindex{the}                                                                   
  1879. \toindex{folio}                                                                 
  1880.                                                                                 
  1881. You can also assign values to {\tt \\pageno} if you want your                   
  1882. document to use a different sequence of page numbers from the                   
  1883. usual.  Roman numerals can be produced by using negative numbers;               
  1884. {\tt \\pageno=-1} at the beginning of a document will cause page                
  1885. numbers to be in roman numerals.                                                
  1886. \TeXref{252}                                                                    
  1887.                                                                                 
  1888. Different headlines can be produced for even and odd pages in                   
  1889. the following manner:                                                           
  1890.                                                                                 
  1891. {\tt                                                                            
  1892. \\headline=\lb\\ifodd \\pageno \lb$\dots$\rb \\else \lb$\dots$\rb               
  1893. \\fi\rb}                                                                        
  1894.                                                                                 
  1895. \noindent                                                                       
  1896. where the material between the first set of braces is for the                   
  1897. right-hand pages and the material between the second set of                     
  1898. braces is for the left-hand pages.                                              
  1899.                                                                                 
  1900. \exercise Change the footline so that the page number is \centred{}             
  1901. with a en-dash on either side.                                                  
  1902.                                                                                 
  1903. \subsection{Overfull and underfull boxes}                                       
  1904.                                                                                 
  1905. One of the most frustrating experiences for the new \TeX{} user                 
  1906. is the occurrence of overfull and underfull boxes.  They are duly               
  1907. noted in the log file and are also written to the screen when \TeX{}            
  1908. is being run interactively.  Overfull boxes are also marked                     
  1909. on the output by a slug (a large filled-in black rectangle that                 
  1910. looks like this: \vrule width \overfullrule) in the right                       
  1911. margin. Various obscene terms are applied to this slug.  It                     
  1912. appears even though there is nothing wrong with the \TeX{} input.               
  1913. So why is the slug there and what can be done about it?                         
  1914.                                                                                 
  1915. A good way to visualize the way \TeX{} organizes a page is to                   
  1916. think of the printed material as being put into boxes. There are                
  1917. two types of boxes: {\sl hboxes\/} and {\sl vboxes}.  Most of the               
  1918. time these correspond to the organization of horizontal text                    
  1919. into lines and vertical paragraphs into pages.  In particular, it               
  1920. is the spacing of the words in a hbox corresponding to a line of                
  1921. text that causes the slug to appear.                                            
  1922.                                                                                 
  1923. Recall that \TeX{} reads in the complete paragraph before                       
  1924. deciding how to break it up into lines.  This is better than                    
  1925. working a line at a time, since a slight improvement in one line                
  1926. might cause catastrophic changes farther down in the paragraph.                 
  1927. When words are gathered together to form a line, space is added                 
  1928. between the words to justify the right margin. Very large spaces                
  1929. between words is obviously undesirable; the badness of the line                 
  1930. is a measure of how badly the words are spaced.  An underfull                   
  1931. hbox means that there is too much space between words.  More                    
  1932. specifically, the badness of any line is a number between 0                     
  1933. (perfect) and 10000 (horrible).  There is a parameter called {\tt               
  1934. \\hbadness} whose default value is 1000\null.  Any line whose                   
  1935. badness is greater than {\tt \\hbadness} is reported as an                      
  1936. underfull hbox.  If the value of {\tt \\hbadness} is increased,                 
  1937. then fewer underfull hboxes will be reported. In fact {\tt                      
  1938. \\hbadness = 10000} will suppress the reporting of underfull                    
  1939. hboxes altogether.                                                              
  1940. \toindex{hbaddness}                                                             
  1941.                                                                                 
  1942. %%%%%%%%%%%%%% restore original headline %%%%%%%%%%%%%%%%%%%%%%%%               
  1943. \headline={\iftitlepage \hfil \global\titlepagefalse                            
  1944.                                       \else \draftheadline \fi}                 
  1945.                                                                                 
  1946. In a similar way, sometimes \TeX{} allows a line to be slightly                 
  1947. longer than {\tt \\hsize} in order to achieve a more balanced                   
  1948. appearance. The control word {\tt \\tolerance} determines when                  
  1949. this happens.  If the badness of a line is greater than {\tt                    
  1950. \\tolerance}, \TeX{} will make the line longer by adding a new word             
  1951. at the end of the line, even though it might exceed the value of                
  1952. {\tt \\hsize}. A line which is only slightly longer is set                      
  1953. without being reported. The control word {\tt \\hfuzz} determines               
  1954. how much excess is allowed; the default is {\tt \\hfuzz                         
  1955. =~0.1~pt}.  A line that is more than slightly longer than {\tt \\hsize}         
  1956. is obviously a serious problem; \TeX{} puts a slug in                           
  1957. the margin to make its point forcefully. It's possible to avoid                 
  1958. overfull hboxes altogether by increasing the value of {\tt \\tolerance}.        
  1959. With {\tt \\tolerance = 10000} there will never be                              
  1960. overfull boxes or slugs. The default is {\tt \\tolerance = 200}\null.           
  1961. \TeXref{29}                                                                     
  1962. \toindex{hfuzz}                                                                 
  1963. \toindex{tolerance}                                                             
  1964.                                                                                 
  1965. The width of the slug is determined by the control word {\tt                    
  1966. \\overfullrule}.  Including {\tt \\overfullrule = 0 pt} in your                 
  1967. file will delete any further  printing of the slugs.  The                       
  1968. overfull boxes will still be there, of course, and they will                    
  1969. probably be harder to spot.                                                     
  1970. \toindex{overfullrule}                                                          
  1971.                                                                                 
  1972. So we see why overfull boxes and underfull boxes are reported; we               
  1973. can also change the reporting by changing the values of {\tt                    
  1974. \\badness}, {\tt \\hfuzz}, and {\tt \\tolerance}.  In addition, a               
  1975. small value of {\tt \\hsize} obviously makes it more difficult to               
  1976. set lines and causes more overfull and underfull hboxes to be                   
  1977. reported. These are warnings that you ignore at your own peril!                 
  1978.                                                                                 
  1979. Adding new possibilities of hyphenation will sometimes eliminate                
  1980. an overfull box. \TeX{} has automatic hyphenation and usually                   
  1981. finds good places to hyphenate a word; however, it's possible to                
  1982. add hyphenations to let lines break at new places.  For example,                
  1983. the automatic hyphenation will never put a hyphen in the word                   
  1984. ``database''.  If you type in {\tt data\\-base}, it will allow a                
  1985. hyphen to be inserted after the second letter ``a'' in the word.                
  1986. More generally, if you put {\tt \\hyphenation\lb data-base\rb} in               
  1987. the beginning of your input file, then all occurrences of the                   
  1988. word ``database'' will allow hyphenation after the letter ``a''.                
  1989. \TeXref{28}                                                                     
  1990. The log file will show the possible hyphenations on the line                    
  1991. containing the overfull or underfull box. Sometimes the best                    
  1992. solution to an overfull or underfull hbox is a little judicious                 
  1993. editing of the original document.                                               
  1994. \toindex{hyphenation}                                                           
  1995.                                                                                 
  1996. Our discussion has involved the setting of type into lines, that is,            
  1997. the horizontal page structure.  There are several vertical \analog{}s.          
  1998. Overfull and underfull hboxes indicate how well words are gathered              
  1999. into lines.  Similarly, overfull and underfull vboxes are reported              
  2000. when paragraphs are gathered to form pages.  A large table that                 
  2001. can't be broken in the middle, for example, can produce an underfull            
  2002. vbox that is reported in the log file when the page being typeset is            
  2003. completed.  The control word {\tt \\vbadness} works for the vertical            
  2004. placement of text in the same way as {\tt \\hbadness} works for                 
  2005. horizontal text.                                                                
  2006. \toindex{vbadness}                                                              
  2007.                                                                                 
  2008. \exercise Take a few paragraphs and print them using various (small)            
  2009. values of {\tt \\hsize} to see what kind of overfull boxes result.              
  2010. Repeat with various values of {\tt \\hbadness}, {\tt \\hfuzz}, and              
  2011. {\tt \\tolerance}.                                                              
  2012.                                                                                 
  2013.                                                                                 
  2014.                                                                                 
  2015.                                                                                 
  2016.                                                                                 
  2017.                                                                                 
  2018. \section{$\Bigl\{$Groups, $\bigl\{$Groups,                                      
  2019.         $\{$and More Groups$\}\bigr\}\Bigr\}$}                                  
  2020.                                                                                 
  2021. The concept of gathering text into groups allows \TeX{} input                   
  2022. files to be greatly simplified.  A new group is started by the                  
  2023. character {\tt\lb} and terminated by the character {\tt \rb}\null.              
  2024. Changes made within a group will lose their effect when the                     
  2025. group terminates.  So, for example if {\tt \lb \\bf three                       
  2026. boldface words\rb} appears in your text, the opening brace starts               
  2027. the group, the {\tt \\bf} control word changes to a boldface                    
  2028. font, and the closing brace finishes up the group.  Upon                        
  2029. completion of the group the font being used is the one in effect                
  2030. before the group started.  This is the (easier) way of having a                 
  2031. few words in a different font.  It's also possible to have groups               
  2032. nested within groups.                                                           
  2033.                                                                                 
  2034.                                                                                 
  2035. As another example, size changes can be made in the text that are               
  2036. only temporary.  For example                                                    
  2037. \beginuser                                                                      
  2038. \lb                                                                             
  2039. \\hsize = 4 in                                                                  
  2040. \\parindent = 0 pt                                                              
  2041. \\leftskip = 1 in                                                               
  2042. will produce a paragraph that is four                                           
  2043. $\vdots$                                                                        
  2044. (this is an easy mistake to make).                                              
  2045. \\par                                                                           
  2046. \rb                                                                             
  2047. \enduser                                                                        
  2048.                                                                                 
  2049. {\hsize = 4 in                                                                  
  2050. \parindent = 0 pt                                                               
  2051. \leftskip = 1 in                                                                
  2052. will produce a paragraph that is four inches wide with the text                 
  2053. offset into the paragraph by one inch regardless of the settings                
  2054. in effect before the start of the group.  This paragraph is set                 
  2055. with those values. After the end of the group, the old settings                 
  2056. are in effect again. Note that it is necessary to include                       
  2057. {\tt \\par} or to use a blank line before the closing brace to end              
  2058. the paragraph, since otherwise the group will end and \TeX{} will               
  2059. go back to the old parameters before the paragraph is actually                  
  2060. typeset (this is an easy mistake to make). \par}                                
  2061.                                                                                 
  2062. When a control word (like {\tt \\centerline}) acts on text                      
  2063. following it in braces, that text is implicitly in a group. Thus                
  2064. {\tt \\centerline\lb\\bf A bold title\rb} will produce a \centred{}             
  2065. boldface line, and the text following that line will be in                      
  2066. whatever font was in effect before the {\tt \\centerline} was                   
  2067. invoked.                                                                        
  2068.                                                                                 
  2069. The empty group {\tt\lb\rb} is useful.  One use allows accents to be            
  2070. typeset with no accompanying letter.  For example, {\tt \\\~{}\lb\rb}           
  2071. will print a tilde with no letter under it.  It can also be used to             
  2072. stop \TeX{} from eating up consecutive spaces. Hence {\tt I use                 
  2073. \\TeX\lb\rb{} all the time}  will leave a space after ``\TeX'' in the           
  2074. output. This is an alternative to using {\tt \\\sp} as we did in                
  2075. Section~1.                                                                      
  2076. \TeXref{19--21}                                                                 
  2077.                                                                                 
  2078. \exercise Change the dimensions of one paragraph on a page using the            
  2079. grouping idea.                                                                  
  2080.                                                                                 
  2081. \exercise Mathematicians sometime use the word ``i{f}f'' as an                  
  2082. abbreviation for ``if and only if''\null.  In this case it looks                
  2083. better if the first and second letter ``f'' are {\sl not\/}                     
  2084. joined as a ligature.  How do you do this (there are several                    
  2085. solutions)?                                                                     
  2086.                                                                                 
  2087. It's really easy to forget to match braces properly.  The effect                
  2088. can be dramatic; if you get output that suddenly changes to an                  
  2089. italic font for the rest of the document, a mismatched brace is                 
  2090. probably the cause.  If you have an extra {\tt \lb} \TeX{} will                 
  2091. give a message in the log file: {\tt (\\end occurred inside a                   
  2092. group at level 1)}. An extra {\tt\rb} will result in the message                
  2093. \hbox{\tt! Too many \rb's.}                                                     
  2094.                                                                                 
  2095. Here's a little hint to help you keep track of the braces in more               
  2096. complicated groups: put the opening brace on a line by itself and               
  2097. do the same for the closing brace.  If there are braces nested                  
  2098. within the original ones, put them on separate lines also, but                  
  2099. indent them a few spaces.  The text within the nested braces can                
  2100. also be indented since \TeX{} ignores all spaces at the beginning               
  2101. of a line. The matching braces will then stand out when you look                
  2102. at your \TeX{} source file.  In fact, if your editor is smart                   
  2103. enough, you can create the two lines with the braces first and                  
  2104. then insert the appropriate material within them with automatic                 
  2105. indenting.                                                                      
  2106.                                                                                 
  2107.                                                                                 
  2108.                                                                                 
  2109. \section{No math anxiety here!}                                                 
  2110.                                                                                 
  2111. \TeX{} is at its best when typesetting mathematics.  The                        
  2112. conventions for doing this are many and complex, and the ability                
  2113. of \TeX{} to take them into account makes the production of high                
  2114. quality, attractive mathematical output possible.  If you plan to               
  2115. produce papers with mathematical symbols in them, this section                  
  2116. will give you all the basics necessary for creating beautiful                   
  2117. output in almost all circumstances; \TeX{} may be used without                  
  2118. any mathematics, of course, and if this is your goal, then the                  
  2119. following two subsections are probably sufficient for your needs.               
  2120.                                                                                 
  2121. \subsection{Lots of new symbols}                                                
  2122.                                                                                 
  2123. Mathematical text is inserted into normal text in two possible                  
  2124. ways: it can be {\sl in-line\/}, that is, as part of the usual                  
  2125. lines of text.  It can also be {\sl displayed}, that is, \centred{}             
  2126. in a gap between the usual text.  The results in the spacing and                
  2127. placement of symbols can be quite different in each case.  The                  
  2128. in-line equation $\sum_{k=1}~{\infty} {1\over k~2} = {\pi~2\over6}$             
  2129. is easily seen to be different from the same equation when                      
  2130. displayed:                                                                      
  2131. $$\sum_{k=1}~{\infty} {1\over k~2} = {\pi~2\over6}.$$                           
  2132.                                                                                 
  2133. Since the spacing and the fonts used for mathematics are quite                  
  2134. different from those of ordinary text, \TeX{} needs to be told                  
  2135. when mathematics rather than normal text is being typeset.  This                
  2136. is done using the {\tt\$} symbol.  More specifically, mathematics               
  2137. is typeset in-line by surrounding the symbols to be entered by                  
  2138. single dollar signs: {\tt \$$\ldots$\$}, and is typeset displayed               
  2139. by surrounding the symbols to be entered by double dollar signs:                
  2140. {\tt \$\$$\ldots$\$\$}\null.  Hence {\tt \$x = y+1\$} will give                 
  2141. $x=y+1$ in-line while {\tt \$\$x = y+1.\$\$} will display                       
  2142. $$x=y+1.$$                                                                      
  2143.                                                                                 
  2144. The spacing for both in-line and displayed mathematics is                       
  2145. completely controlled by \TeX\null.  Adding spaces to your input                
  2146. has no effect at all.  What if you need a space or some text in                 
  2147. the middle of some mathematics?  You can insert text by inserting               
  2148. it into an hbox (don't worry about the definition of an hbox for                
  2149. now): {\tt \\hbox\lb$\ldots$\rb}\null.  This is particularly                    
  2150. useful for displayed mathematics.  Hence ``$x=y+1 \hbox{ whenever               
  2151. } y=x-1$'' can be typeset using {\tt \$x=y+1 \\hbox\lb\ whenever                
  2152. \rb y=x-1\$}. Note the spaces on either side of the word within                 
  2153. the braces. Usually it isn't necessary to insert spaces into                    
  2154. mathematical text, but here are the control sequences that do the               
  2155. job.                                                                            
  2156. \TeXref{167}                                                                    
  2157.                                                                                 
  2158. \maketable [Adding space to mathematical text]                                  
  2159. \halign{                                                                        
  2160. \strut \hfil # & \quad \hfil\tt# \hfil \quad                                    
  2161.    & \hbox to 2cm{\hrulefill\vrule height 8pt#\vrule height 8pt\hrulefill} \cr  
  2162.    Name & \rm Control Sequence & \hfil{}$\gets$Size$\to$\cr                     
  2163.    \noalign{\hrule} \noalign{\smallskip}                                        
  2164.    Double quad         & \\qquad &\qquad \cr                                    
  2165.    Quad                & \\quad  &\quad \cr                                     
  2166.    Space               & \\\sp   &\ \cr                                         
  2167.    Thick space         & \\;     &$\;$\cr                                       
  2168.    Medium space        & \\>     &$\>$\cr                                       
  2169.    Thin space          & \\,     &$\,$\cr                                       
  2170.    Negative thin space & \ \\!\    &$\!$\cr                                     
  2171.        }                                                                        
  2172.                                                                                 
  2173. \toindex{quad}                                                                  
  2174. \toindex{qquad}                                                                 
  2175. \toindex{\sp}                                                                   
  2176. \toindex{;}                                                                     
  2177. \toindex{>}                                                                     
  2178. \toindex{,}                                                                     
  2179. \toindex{!}                                                                     
  2180.                                                                                 
  2181. If you look closely at the negative thin space, you'll notice                   
  2182. that, unlike the other entries, the two arms overlap.  This is                  
  2183. because the negative space is one in the opposite direction, that               
  2184. is, while the other control sequences increase the amount of                    
  2185. space between two symbols being typeset, the negative thin space                
  2186. decreases the space between them, even if it causes them to                     
  2187. overlap.                                                                        
  2188.                                                                                 
  2189. \exercise Typeset the following: $C(n,r) = n!/(r!\,(n-r)!)$\null. Note the      
  2190. spacing in the denominator.                                                     
  2191.                                                                                 
  2192. You shouldn't have any blank lines between the dollar signs                     
  2193. delimiting the mathematical text. \TeX{} assumes that all the                   
  2194. mathematical text being typeset is in one paragraph, and a blank                
  2195. line starts a new paragraph; consequently, this will generate an                
  2196. error message. This turns out to be useful, for one of the                      
  2197. easiest errors to make is to forget to put in the trailing dollar               
  2198. sign(s) after the mathematical input (I promise that you'll do it               
  2199. at least once while learning \TeX{}); if \TeX{} allowed more than               
  2200. one paragraph to be between the dollars signs, then one omitted                 
  2201. trailing dollar sign might cause the rest of the document to be                 
  2202. typeset as mathematics.                                                         
  2203.                                                                                 
  2204. Most mathematical text is entered in exactly the same way for                   
  2205. in-line typesetting as for displayed typesetting (except for the                
  2206. surrounding dollar signs, of course). The exceptions, such as                   
  2207. aligning multiline displays and placing equation numbers at the                 
  2208. left or right margin will be discussed in the last part of this                 
  2209. section.                                                                        
  2210.                                                                                 
  2211. Many new symbols can appear when typesetting mathematics.  Most                 
  2212. of the ones that actually appear on the keyboard can be used                    
  2213. directly. The symbols {\tt + - / * = ' ! < > ( )} are all entered               
  2214. directly. Here they are as mathematics: $+ - / * =\> '\> ! <\>                  
  2215. >\> ( \> )$.                                                                    
  2216.                                                                                 
  2217. \exercise Typeset the equation $a+b=c-d=xy=w/z$ as in-line and                  
  2218. displayed mathematical text.                                                    
  2219.                                                                                 
  2220. \exercise Typeset the equation $(fg)' = f'g + fg'$ as in-line and               
  2221. displayed mathematical text.                                                    
  2222.                                                                                 
  2223. Many other symbols, as you would expect, are predefined control                 
  2224. words.  All Greek letters are available.  Here is a table of them:              
  2225. \TeXref{434}                                                                    
  2226.                                                                                 
  2227. \maketable [Greek letters]                                                      
  2228. \halign{                                                                        
  2229. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad   
  2230.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr      
  2231. \noalign{\hrule} \noalign{\smallskip}                                           
  2232. \alpha & \\alpha &\beta & \\beta &\gamma & \\gamma &\delta & \\delta \cr        
  2233. \epsilon & \\epsilon & \varepsilon & \\varepsilon & \zeta & \\zeta &            
  2234. \eta & \\eta \cr                                                                
  2235. \theta & \\theta & \vartheta & \\vartheta & \iota & \\iota & \kappa &           
  2236. \\kappa \cr                                                                     
  2237. \lambda & \\lambda & \mu & \\mu & \nu & \\nu & \xi & \\xi \cr                   
  2238. o & o & \pi & \\pi & \rho & \\rho & \varrho & \\varrho \cr                      
  2239. \sigma & \\sigma & \varsigma & \\varsigma & \tau & \\tau & \upsilon &           
  2240. \\upsilon \cr                                                                   
  2241. \phi & \\phi & \varphi & \\varphi & \chi & \\chi & \psi & \\psi \cr             
  2242. \omega & \\omega & \Gamma & \\Gamma & \Delta & \\Delta & \Theta &               
  2243. \\Theta \cr                                                                     
  2244. \Lambda & \\Lambda & \Xi & \\Xi & \Pi & \\Pi & \Sigma & \\Sigma \cr             
  2245. \Upsilon & \\Upsilon & \Phi & \\Phi & \Psi & \\Psi & \Omega & \\Omega \cr       
  2246.        }                                                                        
  2247.                                                                                 
  2248. \toindex{alpha}                                                                 
  2249. \toindex{beta}                                                                  
  2250. \toindex{gamma}                                                                 
  2251. \toindex{delta}                                                                 
  2252. \toindex{epsilon}                                                               
  2253. \toindex{varepsilon}                                                            
  2254. \toindex{zeta}                                                                  
  2255. \toindex{eta}                                                                   
  2256. \toindex{theta}                                                                 
  2257. \toindex{vartheta}                                                              
  2258. \toindex{iota}                                                                  
  2259. \toindex{kappa}                                                                 
  2260. \toindex{lambda}                                                                
  2261. \toindex{mu}                                                                    
  2262. \toindex{nu}                                                                    
  2263. \toindex{xi}                                                                    
  2264. \toindex{pi}                                                                    
  2265. \toindex{rho}                                                                   
  2266. \toindex{varrho}                                                                
  2267. \toindex{sigma}                                                                 
  2268. \toindex{varsigma}                                                              
  2269. \toindex{tau}                                                                   
  2270. \toindex{upsilon}                                                               
  2271. \toindex{phi}                                                                   
  2272. \toindex{varphi}                                                                
  2273. \toindex{chi}                                                                   
  2274. \toindex{psi}                                                                   
  2275. \toindex{omega}                                                                 
  2276. \toindex{Gamma}                                                                 
  2277. \toindex{Delta}                                                                 
  2278. \toindex{Theta}                                                                 
  2279. \toindex{Lambda}                                                                
  2280. \toindex{Xi}                                                                    
  2281. \toindex{Pi}                                                                    
  2282. \toindex{Sigma}                                                                 
  2283. \toindex{Upsilon}                                                               
  2284. \toindex{Phi}                                                                   
  2285. \toindex{Psi}                                                                   
  2286. \toindex{Omega}                                                                 
  2287.                                                                                 
  2288.                                                                                 
  2289. \exercise Typeset $\alpha\beta=\gamma+\delta$ as in-line and displayed          
  2290. mathematical text.                                                              
  2291.                                                                                 
  2292. \exercise Typeset $\Gamma(n) = (n-1)!$ as in-line and displayed                 
  2293. mathematical text.                                                              
  2294.                                                                                 
  2295. Sometimes accents are put above or below symbols.  The control                  
  2296. words used for accents in mathematics are different from those                  
  2297. used for normal text.   The normal text control words may not be                
  2298. used for mathematics and vice-versa.                                            
  2299. \TeXref{135--136}                                                               
  2300.                                                                                 
  2301. \maketable [Mathematical accents]                                               
  2302. \halign{                                                                        
  2303.    \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ &                        
  2304.       \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad  \cr          
  2305.    \noalign{\hrule} \noalign{\smallskip}                                        
  2306.    \hat o   & \\hat o   & \check o & \\check o  & \tilde o & \\tilde o \cr      
  2307.    \acute o & \\acute o & \grave o & \\grave o  & \dot o & \\dot o \cr          
  2308.    \ddot o  & \\ddot o  &\breve o  & \\breve o  & \bar o & \\bar o \cr          
  2309.    \vec o   & \\vec o   & \widehat {abc} & \\widehat \lb abc\rb                 
  2310.                     & \widetilde {abc} & \\widetilde \lb abc\rb\cr              
  2311.        }                                                                        
  2312.                                                                                 
  2313. \toindex{hat}                                                                   
  2314. \toindex{check}                                                                 
  2315. \toindex{tilde}                                                                 
  2316. \toindex{acute}                                                                 
  2317. \toindex{grave}                                                                 
  2318. \toindex{dot}                                                                   
  2319. \toindex{ddot}                                                                  
  2320. \toindex{breve}                                                                 
  2321. \toindex{bar}                                                                   
  2322. \toindex{vec}                                                                   
  2323. \toindex{widehat}                                                               
  2324. \toindex{widetilde}                                                             
  2325.                                                                                 
  2326.                                                                                 
  2327.                                                                                 
  2328. Binary operators combine two mathematical objects to get another                
  2329. object.  Ordinary addition and multiplication, for example,                     
  2330. combine two numbers to get another number, and so they are binary               
  2331. operators. When a binary operator such as $+$ or $\times$ is                    
  2332. typeset, a little extra space is put around it. Here is a list of               
  2333. some of the available binary operators:                                         
  2334. \TeXref{436}                                                                    
  2335.                                                                                 
  2336. \maketable [Binary operators]                                                   
  2337. \halign{                                                                        
  2338. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad   
  2339.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr      
  2340. \noalign{\hrule} \noalign{\smallskip}                                           
  2341. \cdot & \\cdot &\times & \\times &\ast & \\ast &\star & \\star \cr              
  2342. \circ & \\circ & \bullet & \\bullet & \div & \\div & \diamond & \\diamond \cr   
  2343. \cap & \\cap & \cup & \\cup & \vee & \\vee & \wedge & \\wedge \cr               
  2344. \oplus & \\oplus &\ominus & \\ominus & \otimes &\\otimes &\odot &\\odot \cr     
  2345.        }                                                                        
  2346.                                                                                 
  2347. \toindex{cdot}                                                                  
  2348. \toindex{times}                                                                 
  2349. \toindex{ast}                                                                   
  2350. \toindex{star}                                                                  
  2351. \toindex{circ}                                                                  
  2352. \toindex{bullet}                                                                
  2353. \toindex{div}                                                                   
  2354. \toindex{diamond}                                                               
  2355. \toindex{cap}                                                                   
  2356. \toindex{cup}                                                                   
  2357. \toindex{vee}                                                                   
  2358. \toindex{wedge}                                                                 
  2359. \toindex{oplus}                                                                 
  2360. \toindex{ominus}                                                                
  2361. \toindex{otimes}                                                                
  2362. \toindex{odot}                                                                  
  2363.                                                                                 
  2364. Ellipses are commonly used with binary operators.  The control                  
  2365. word {\tt \\cdots} will raise the dots so that they are level                   
  2366. with the binary operator. Thus {\tt \$a + \\cdots + z\$} will                   
  2367. produce $a + \cdots + z$.  The control word {\tt \\ldots} will                  
  2368. put the dots on the baseline, and so {\tt \$1\\ldots n\$}                       
  2369. produces $1\ldots n$.                                                           
  2370. \toindex{cdots}                                                                 
  2371. \toindex{ldots}                                                                 
  2372.                                                                                 
  2373. \exercise Typeset: $x\wedge (y\vee z) = (x\wedge y) \vee (x\wedge z)$.          
  2374.                                                                                 
  2375. \exercise Typeset: $2+4+6+\cdots +2n = n(n+1)$.                                 
  2376.                                                                                 
  2377. A relation indicates a property of two mathematical objects.  We                
  2378. already know how to show two objects equal, or how to show one                  
  2379. number less than or greater than another number (since these are                
  2380. symbols on most terminal keyboards).  To negate a relation, the                 
  2381. control word {\tt \\not} is put in front of the relation.  Here                 
  2382. are some relations:                                                             
  2383. \TeXref{436}                                                                    
  2384. \toindex{not}                                                                   
  2385.                                                                                 
  2386. \maketable [Relations ]                                                         
  2387. \halign{                                                                        
  2388. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad   
  2389.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr      
  2390. \noalign{\hrule} \noalign{\smallskip}                                           
  2391. \leq  & \\leq  &\not\leq & \\not \\leq                                          
  2392.        & \geq & \\geq & \not\geq & \\not \\geq \cr                              
  2393. \equiv & \\equiv & \not\equiv & \\not \\equiv                                   
  2394.        & \sim & \\sim & \not\sim & \\not \\sim \cr                              
  2395. \simeq & \\simeq & \not\simeq & \\not \\simeq                                   
  2396.        & \approx & \\approx & \not\approx & \\not \\approx \cr                  
  2397. \subset & \\subset & \subseteq & \\subseteq                                     
  2398.         & \supset & \\supset & \supseteq & \\supseteq \cr                       
  2399. \in & \\in & \ni & \\ni & \parallel & \\parallel & \perp & \\perp \cr           
  2400.        }                                                                        
  2401.                                                                                 
  2402. \toindex{leq}                                                                   
  2403. \toindex{geq}                                                                   
  2404. \toindex{equiv}                                                                 
  2405. \toindex{sim}                                                                   
  2406. \toindex{simeq}                                                                 
  2407. \toindex{approx}                                                                
  2408. \toindex{subset}                                                                
  2409. \toindex{subseteq}                                                              
  2410. \toindex{supset}                                                                
  2411. \toindex{supseteq}                                                              
  2412. \toindex{in}                                                                    
  2413. \toindex{ni}                                                                    
  2414. \toindex{parallel}                                                              
  2415. \toindex{perp}                                                                  
  2416.                                                                                 
  2417.                                                                                 
  2418. \exercise                                                                       
  2419. Typeset: $\vec x\cdot \vec y  = 0$ if and only if $\vec x \perp \vec y$.        
  2420.                                                                                 
  2421. \exercise                                                                       
  2422. Typeset: $\vec x\cdot \vec y \not= 0$ if and only if $\vec x \not\perp \vec y$. 
  2423.                                                                                 
  2424. Here are some other available mathematical symbols:\TeXref{435--438}            
  2425.                                                                                 
  2426. \maketable [Miscellaneous symbols ]                                             
  2427. \halign{                                                                        
  2428. \strut \hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \qquad   
  2429.       &\hfil$#$ & \quad \tt# \hfil \qquad &\hfil$#$ & \quad \tt# \hfil \cr      
  2430. \noalign{\hrule} \noalign{\smallskip}                                           
  2431. \aleph & \\aleph & \ell & \\ell & \Re & \\Re & \Im & \\Im \cr                   
  2432. \partial & \\partial & \infty & \\infty & \! & \\! & \angle & \\angle \cr       
  2433. \nabla & \\nabla & \backslash &\\backslash & \forall & \\forall                 
  2434.               & \exists & \\exists \cr                                          
  2435. \neg & \\neg & \flat & \\flat & \sharp & \\sharp & \natural & \\natural \cr     
  2436.           }                                                                     
  2437.                                                                                 
  2438. \toindex{aleph}                                                                 
  2439. \toindex{ell}                                                                   
  2440. \toindex{Re}                                                                    
  2441. \toindex{Im}                                                                    
  2442. \toindex{partial}                                                               
  2443. \toindex{infty}                                                                 
  2444. \toindex{!}                                                                     
  2445. \toindex{angle}                                                                 
  2446. \toindex{nabla}                                                                 
  2447. \toindex{backslash}                                                             
  2448. \toindex{forall}                                                                
  2449. \toindex{exists}                                                                
  2450. \toindex{neg}                                                                   
  2451. \toindex{flat}                                                                  
  2452. \toindex{sharp}                                                                 
  2453. \toindex{natural}                                                               
  2454.                                                                                 
  2455. \exercise Typeset: $(\forall x\in \Re)(\exists y\in\Re)$ $y>x$.                 
  2456.                                                                                 
  2457. \subsection{Fractions}                                                          
  2458.                                                                                 
  2459. There are two methods of typesetting a fraction: it can be                      
  2460. typeset either in the form $1/2$ or in the form ${1\over2}$\null.               
  2461. The first case is just entered with no special control sequences,               
  2462. that is, {\tt \$1/2\$}\null.  The second case uses the control                  
  2463. word {\tt \\over} and the following pattern: {\tt \lb                           
  2464. <numerator> \\over <denominator>\rb}\null. Hence {\tt \$\$\lb a+b               
  2465. \\over c+d\rb.\$\$} gives $${a+b\over c+d}.$$                                   
  2466. \TeXref{139--140}                                                               
  2467. \toindex{over}                                                                  
  2468.                                                                                 
  2469. \exercise Typeset the following: ${a+b\over c}\quad {a\over b+c}                
  2470. \quad {1\over a+b+c} \not= {1\over a}+{1\over b}+{1\over c}$.                   
  2471.                                                                                 
  2472. \exercise Typeset: What are the points where                                    
  2473. ${\partial \over \partial x} f(x,y) = {\partial \over \partial y}               
  2474. f(x,y) = 0$?                                                                    
  2475.                                                                                 
  2476. \subsection{Subscripts and superscripts}                                        
  2477.                                                                                 
  2478. Subscripts and superscripts are particularly easy to enter using                
  2479. \TeX\null. The characters {\tt \_{}} and {\tt \~{}} are used to                 
  2480. indicate that the next character is a subscript or a superscript.               
  2481. Thus {\tt \$x\~{}2\$} gives $x~2$ and {\tt \$x\_{}2\$} gives                    
  2482. $x_2$\null.  To get several characters as a subscript or                        
  2483. superscript, they are grouped together within braces. Hence we                  
  2484. can use {\tt \$x\~{}\lb 21\rb\$} to get $x~{21}$ and {\tt \$x\_{}\lb            
  2485. 21\rb\$} to get $x_{21}$\null. Notice that the                                  
  2486. superscripts and subscripts are automatically typeset in a                      
  2487. smaller type size. The situation is only slightly more                          
  2488. complicated for a second layer of subscripts or superscripts.                   
  2489. You can {\sl not\/} use {\tt \$x\_{}2\_{}3\$} since this could                  
  2490. have two possible interpretations, namely, {\tt \$x\_{}\lb 2\_{}3\rb\$}         
  2491. or {\tt \$\lb x\_{}2\rb\_{}3\$}; this gives two                                 
  2492. different results: $x_{2_3}$ and ${x_2}_3$, the first of which is               
  2493. the usual mathematical subscript notation.  Thus you must put in                
  2494. the complete braces to describe multiple layers of subscripts and               
  2495. superscripts.  They may be done to any level.                                   
  2496. \TeXref{128--130}                                                               
  2497.                                                                                 
  2498. To use both subscripts and superscripts on one symbol, you use                  
  2499. both the {\tt \_{}} and {\tt \~{}} in either order.  Thus either                
  2500. {\tt \$x\_{}2\~{}1\$} or {\tt\$x\~{}1\_{}2\$} will give $x_2~1$.                
  2501.                                                                                 
  2502. \exercise                                                                       
  2503. Typeset each of the following: $e~x \quad e~{-x} \quad                          
  2504. e~{i\pi}+1=0 \quad x_0 \quad x_0~2 \quad {x_0}~2 \quad 2~{x~x}$.                
  2505.                                                                                 
  2506. \exercise Typeset:                                                              
  2507. $\nabla~2 f(x,y) = {\partial~2 f \over\partial x~2}                             
  2508. + {\partial~2 f \over\partial y~2}$.                                            
  2509.                                                                                 
  2510. A similar method is used for summations and integrals.  The input               
  2511. of {\tt \$\\sum\_{}\lb k=1\rb\~{}n k\~{}2\$} will give $\sum_{k=1}~n            
  2512. k~2$, and {\tt \$\\int\_{}0\~{}x f(t) dt\$} will                                
  2513. give $\int_0~x f(t) dt$.                                                        
  2514. \TeXref{144--145}                                                               
  2515. \toindex{sum}                                                                   
  2516. \toindex{int}                                                                   
  2517.                                                                                 
  2518. Another use of this type of input is for expressions                            
  2519. involving limits.  You can use                                                  
  2520. {\tt \$\\lim\_\lb n\\to \\infty\rb (\lb n+1 \\over n\rb)\~{}n = e\$}            
  2521. to get $\lim_{n\to \infty} ({n+1\over n})~n = e$.                               
  2522. \toindex{lim}                                                                   
  2523.                                                                                 
  2524. \exercise Typeset the following expression: $\lim_{x\to 0}                      
  2525. (1+x)~{1\over x}=e$.                                                            
  2526.                                                                                 
  2527. \exercise Typeset: The cardinality of $(-\infty, \infty)$ is $\aleph_1$.        
  2528.                                                                                 
  2529. \exercise Typeset: $\lim_{x\to {0~+}} x~x = 1$.                                 
  2530.                                                                                 
  2531. Here's a hint to make integrals look a little nicer: look at the                
  2532. difference between $\int_0~x f(t) dt$ and $\int_0~x f(t)\, dt$\null.            
  2533. In the second case there is a little extra space after                          
  2534. $f(t)$, and it looks nicer; {\tt \\,} was used to add the                       
  2535. additional space.                                                               
  2536. \toindex{,}                                                                     
  2537.                                                                                 
  2538. \exercise Typeset the following integral: $\int_0~1 3x~2\,dx = 1$.              
  2539.                                                                                 
  2540. \subsection{Roots, square and otherwise}                                        
  2541.                                                                                 
  2542. To typeset a square root it is only necessary to use the construction           
  2543. {\tt \\sqrt\lb$\ldots$\rb}\null. Hence {\tt \$\\sqrt\lb x\~{}2+y\~{}2\rb\$}     
  2544. will give $\sqrt{x~2+y~2}$\null.  Notice that \TeX{} takes care of the          
  2545. placement of symbols and the height and length of the radical.                  
  2546. To make cube or other roots, the control words {\tt \\root} and {\tt            
  2547. \\of} are used.  You get $\root n \of {1+x~n}$ from the input                   
  2548. {\tt \$\\root n \\of \lb1+x\~{}n\rb\$}.                                         
  2549. \TeXref{130--131}                                                               
  2550. \toindex{root}                                                                  
  2551. \toindex{sqroot}                                                                
  2552.                                                                                 
  2553. A possible alternative is to use the control word {\tt \\surd}; the             
  2554. input {\tt \$\\surd 2\$} will produce $\surd 2$.                                
  2555. \toindex{surd}                                                                  
  2556.                                                                                 
  2557. \exercise Typeset the following: $\sqrt2 \quad \sqrt {x+y\over x-y}             
  2558. \quad \root 3 \of {10}$ \quad $e~{\sqrt x}$.                                    
  2559.                                                                                 
  2560. \exercise Typeset: $\!x\! = \sqrt{x\cdot x}$.                                   
  2561.                                                                                 
  2562. \exercise Typeset:                                                              
  2563. $\phi(t) = {1 \over \sqrt{2\pi}} \int_0~t e~{-x~2/2}\,dx$.                      
  2564.                                                                                 
  2565.                                                                                 
  2566. \subsection{Lines, above and below}                                             
  2567.                                                                                 
  2568. Use the constructions {\tt \\overline\lb$\ldots$\rb} and                        
  2569. {\tt \\underline\lb$\ldots$\rb} to put lines above or below mathematical        
  2570. expressions. Hence {\tt \$\\overline\lb x+y\rb=\\overline x + \\overline        
  2571. y\$} gives $\overline{x+y}=\overline x + \overline y$\null.                     
  2572. But notice that the lines over the letters are at                               
  2573. different heights, and so some care is necessary. The use of {\tt               
  2574. \\overline\lb\\strut x\rb} will raise the height of the line over               
  2575. $x$\null.                                                                       
  2576. \TeXref{130--131}                                                               
  2577. \toindex{overline}                                                              
  2578. \toindex{underline}                                                             
  2579.                                                                                 
  2580. To underline non-mathematical text, use {\tt \\underbar\lb$\dots$\rb}.          
  2581. \toindex{underbar}                                                              
  2582.                                                                                 
  2583. \exercise Typeset the following: $\underline x \quad \overline y                
  2584. \quad \underline{\overline{x+y}}$.                                              
  2585.                                                                                 
  2586.                                                                                 
  2587. \subsection{Delimiters large and small}                                         
  2588.                                                                                 
  2589. The most commonly used mathematical delimiters are brackets,                    
  2590. braces, and parentheses.  As we have seen, they may be produced                 
  2591. by using {\tt [ ] \\\lb\ \\\rb ( )} to get $[\>]\>\{\>\}\>(\>)\>$.              
  2592. Sometimes larger delimiters increase the clarity of                             
  2593. mathematical expressions, as in $$\bigl(a\times(b+c)\bigr) \bigl((a\times       
  2594. b)+c\bigr).$$ To make larger left delimiters the                                
  2595. control words {\tt \\bigl}, {\tt \\Bigl}, {\tt \\biggl}, and {\tt               
  2596. \\Biggl} are used in front of the delimiter; similarly, {\tt \\bigr},           
  2597. {\tt \\Bigr}, {\tt \\biggr}, and {\tt \\Biggr} are used                         
  2598. for the right delimiters. Hence {\tt \$\\Bigl[\$} and {\tt \$\\Bigr]\$}         
  2599. will produce $\Bigl[$ and $\Bigr]$.                                             
  2600. \TeXref{145--147}                                                               
  2601.                                                                                 
  2602. \toindex{bigl}                                                                  
  2603. \toindex{Bigl}                                                                  
  2604. \toindex{biggl}                                                                 
  2605. \toindex{Biggl}                                                                 
  2606. \toindex{bigr}                                                                  
  2607. \toindex{Bigr}                                                                  
  2608. \toindex{biggr}                                                                 
  2609. \toindex{Biggr}                                                                 
  2610.                                                                                 
  2611. Here is a table to compare the size of some of the delimiters.                  
  2612.                                                                                 
  2613. %% \everycr can add 4 points between lines in the following table %%            
  2614. \everycr={\noalign{\vskip 4 pt}}                                                
  2615. \maketable [Delimiters of various sizes]                                        
  2616. \halign{                                                                        
  2617. \strut \hfil$#$ & \quad \tt# \hfil \quad\qquad                                  
  2618.       &\hfil$#$ & \quad \tt# \hfil \quad\qquad                                  
  2619.       &\hfil$#$ & \quad \tt# \hfil \quad\qquad                                  
  2620.       &\hfil$#$ & \quad \tt# \hfil \cr                                          
  2621. \noalign{\hrule} \noalign{\smallskip}                                           
  2622. \{ & \\\lb & \} & \\\rb & ( & ( & ) & )\cr                                      
  2623. \bigl\{ & \\bigl\lb & \bigr\} & \\bigr\rb & \bigl( & \\bigl( & \bigr) &         
  2624. \\bigr)\cr                                                                      
  2625. \Bigl\{ & \\Bigl\lb & \Bigr\} & \\Bigr\rb & \Bigl( & \\Bigl( & \Bigr) &         
  2626. \\Bigr)\cr                                                                      
  2627. \biggl\{ & \\biggl\lb & \biggr\} & \\biggr\rb & \biggl(                         
  2628.          & \\biggl( & \biggr) & \\biggr) \cr                                    
  2629. \Biggl\{ & \\Biggl\lb & \Biggr\} & \\Biggr\rb & \Biggl(                         
  2630.          & \\Biggl( & \Biggr) & \\Biggr)\cr                                     
  2631.        }                                                                        
  2632.                                                                                 
  2633. \everycr={}                                                                     
  2634.                                                                                 
  2635. If you want, you can let \TeX{} choose the size of delimiter by                 
  2636. using the control words {\tt \\left} and {\tt \\right} before                   
  2637. your delimiters.                                                                
  2638. \TeXref{148}                                                                    
  2639. Thus {\tt \\left[$\ldots$\\right]}  will cause the material to be               
  2640. enclosed by brackets that are appropriately big.  {\bf Note                     
  2641. well:} each use of a {\tt \\left} delimiter must have a matching                
  2642. {\tt \\right} delimiter. Hence {\tt \$\$\\left!\lb a+b \\over                   
  2643. c+d\rb\\right|.\$\$} gives $$\left|{a+b \over c+d}\right|.$$                    
  2644.                                                                                 
  2645. \maketable [Mathematical delimiters]                                            
  2646. \halign{                                                                        
  2647. \strut \hfill$#$ & \quad \tt # \qquad\qquad &                                   
  2648.        \hfill$#$ & \quad \tt # \qquad\qquad &                                   
  2649.        \hfill$#$ & \quad \tt #  \cr                                             
  2650. \noalign{\hrule} \noalign{\smallskip}                                           
  2651. (       & (        & )          & )           & [        & [         \cr        
  2652. ]       & ]        &\{          & \\\lb       & \}       & \\\rb     \cr        
  2653. \lfloor & \\lfloor &\rfloor     &\\rfloor     & \lceil   & \\lceil   \cr        
  2654. \rceil  & \\rceil  &\langle     & \\langle    & \rangle  & \\rangle  \cr        
  2655. /       & /        & \backslash & \\backslash &!         & !         \cr        
  2656. \!      & \\!      &\uparrow    & \\uparrow   & \Uparrow & \\Uparrow \cr        
  2657. \downarrow & \\downarrow & \Downarrow & \\Downarrow                             
  2658.                         & \updownarrow & \\updownarrow \cr                      
  2659. \Updownarrow & \\Updownarrow \cr                                                
  2660.        }                                                                        
  2661.                                                                                 
  2662. \toindex{lfloor}                                                                
  2663. \toindex{rfloor}                                                                
  2664. \toindex{lceil}                                                                 
  2665. \toindex{rceil}                                                                 
  2666. \toindex{langle}                                                                
  2667. \toindex{rangle}                                                                
  2668. \toindex{!}                                                                     
  2669. \toindex{uparrow}                                                               
  2670. \toindex{Uparrow}                                                               
  2671. \toindex{downarrow}                                                             
  2672. \toindex{Downarrow}                                                             
  2673. \toindex{updownarrow}                                                           
  2674. \toindex{Updownarrow}                                                           
  2675.                                                                                 
  2676. \exercise Typeset $\bigl \lceil \lfloor x \rfloor \bigr \rceil                  
  2677.               \leq \bigl \lfloor \lceil x \rceil \bigr \rfloor$.                
  2678.                                                                                 
  2679. \subsection{Those special functions}                                            
  2680.                                                                                 
  2681. There are several types of functions that appear frequently in                  
  2682. mathematical text.  In an equation like ``$\sin~2x + \cos~2x =                  
  2683. 1$'' the trigonometric functions ``sin'' and ``cos'' are in roman               
  2684. rather than italic type. This is the usual mathematical                         
  2685. convention to indicate that it is a function being described and                
  2686. not the product of three variables.  The control words {\tt                     
  2687. \\sin} and {\tt \\cos} will use the right typeface automatically.               
  2688. Here is a table of these and some other special functions:                      
  2689. \TeXref{162}                                                                    
  2690.                                                                                 
  2691. \maketable [Special mathematical functions]                                     
  2692. \halign{                                                                        
  2693.    \strut \tt {\\}#\hfil && \quad \tt {\\}#\hfil \cr                            
  2694.    \noalign{\hrule} \noalign{\smallskip}                                        
  2695.    sin    & cos    & tan  & cot  & sec  & csc & arcsin & arccos \cr             
  2696.    arctan & sinh   & cosh & tanh & coth & lim & sup    & inf    \cr             
  2697.    limsup & liminf & log  & ln   & lg   & exp & det    & deg    \cr             
  2698.    dim    & hom    & ker  & max  & min  & arg & gcd    & Pr     \cr             
  2699.        }                                                                        
  2700.                                                                                 
  2701. \toindex{sin}                                                                   
  2702. \toindex{cos}                                                                   
  2703. \toindex{tan}                                                                   
  2704. \toindex{cot}                                                                   
  2705. \toindex{sec}                                                                   
  2706. \toindex{csc}                                                                   
  2707. \toindex{arcsin}                                                                
  2708. \toindex{arccos}                                                                
  2709. \toindex{arctan}                                                                
  2710. \toindex{sinh}                                                                  
  2711. \toindex{cosh}                                                                  
  2712. \toindex{tanh}                                                                  
  2713. \toindex{coth}                                                                  
  2714. \toindex{lim}                                                                   
  2715. \toindex{sup}                                                                   
  2716. \toindex{inf}                                                                   
  2717. \toindex{limsup}                                                                
  2718. \toindex{liminf}                                                                
  2719. \toindex{log}                                                                   
  2720. \toindex{ln}                                                                    
  2721. \toindex{lg}                                                                    
  2722. \toindex{exp}                                                                   
  2723. \toindex{det}                                                                   
  2724. \toindex{deg}                                                                   
  2725. \toindex{dim}                                                                   
  2726. \toindex{hom}                                                                   
  2727. \toindex{ker}                                                                   
  2728. \toindex{max}                                                                   
  2729. \toindex{min}                                                                   
  2730. \toindex{arg}                                                                   
  2731. \toindex{gcd}                                                                   
  2732. \toindex{Pr}                                                                    
  2733.                                                                                 
  2734. \exercise Typeset: $\sin(2\theta) = 2\sin\theta\cos\theta \quad                 
  2735. \cos(2\theta) = 2\cos~2\theta - 1  $.                                           
  2736.                                                                                 
  2737. \exercise Typeset: $$\int \csc~2x\, dx = -\cot x+ C                             
  2738. \qquad \lim_{\alpha\to 0} {\sin\alpha \over \alpha} = 1                         
  2739. \qquad \lim_{\alpha\to \infty} {\sin\alpha \over \alpha} = 0.$$                 
  2740.                                                                                 
  2741. \exercise Typeset: $$\tan(2\theta) = {2\tan\theta \over                         
  2742. 1-\tan~2\theta}.$$                                                              
  2743.                                                                                 
  2744.                                                                                 
  2745. \subsection{Hear ye, hear ye!}                                                  
  2746.                                                                                 
  2747. There is a particular macro that is used in almost every                        
  2748. mathematical paper, and is different enough to require a special                
  2749. explanation. This is the {\tt \\proclaim} macro.  It is used when               
  2750. stating theorems, corollaries, propositions, and the like.  The                 
  2751. paragraph following {\tt \\proclaim} is broken into two parts:                  
  2752. the first part goes up to and including the first period that is                
  2753. followed by a space, and the second part is the rest of the                     
  2754. paragraph.\TeXref{202--203}  The idea is that the first part                    
  2755. should be something like ``Theorem 1.'' or ``Corollary B.'' The                 
  2756. second part is the statement of the theorem or corollary.  Here                 
  2757. is an example:                                                                  
  2758. \toindex{proclaim}                                                              
  2759.                                                                                 
  2760. \beginliteral                                                                   
  2761. \proclaim Theorem 1 (H.~G.~Wells). In the country of the blind,                 
  2762. the one-eyed man is king.                                                       
  2763. @endliteral                                                                     
  2764.                                                                                 
  2765. \noindent gives                                                                 
  2766.                                                                                 
  2767. \proclaim Theorem 1 (H.~G.~Wells). In the country of the blind,                 
  2768. the one-eyed man is king.                                                       
  2769.                                                                                 
  2770. The statement of the theorem may contain mathematical expressions, of           
  2771. course.                                                                         
  2772.                                                                                 
  2773. \exercise Typeset:                                                              
  2774. \proclaim Theorem (Euclid). There exist an infinite number of                   
  2775. primes.                                                                         
  2776.                                                                                 
  2777. \exercise Typeset:                                                              
  2778. \proclaim Proposition 1.                                                        
  2779. $\root n \of {\prod_{i=1}~n X_i} \leq {1 \over n} \sum_{i=1}~n X_i$             
  2780. with equality if and only if $X_1=\cdots=X_n$.                                  
  2781.                                                                                 
  2782. \subsection{Matrices}                                                           
  2783.                                                                                 
  2784. Matrices are typeset using combinations of the alignment                        
  2785. character {\tt \&} and the control word {\tt \\cr} to indicate                  
  2786. the end of the line.  Start with {\tt \$\$\\pmatrix\lb$\dots$\rb\$\$}.          
  2787. Into the space between the braces go the rows of the matrix, each               
  2788. one ended by {\tt \\cr}.  The entries are separated by the                      
  2789. {\tt \&}\null.  For example the input                                           
  2790. \TeXref{176--178}                                                               
  2791.                                                                                 
  2792. \beginliteral                                                                   
  2793. $$\pmatrix{                                                                     
  2794. a & b & c & d \cr                                                               
  2795. b & a & c+d & c-d \cr                                                           
  2796. 0 & 0 & a+b & a-b \cr                                                           
  2797. 0 & 0 & ab  & cd \cr                                                            
  2798. }.$$                                                                            
  2799. @endliteral                                                                     
  2800.                                                                                 
  2801. \noindent                                                                       
  2802. gives as printed output                                                         
  2803. $$\pmatrix{                                                                     
  2804. a & b & c & d \cr                                                               
  2805. b & a & c+d & c-d \cr                                                           
  2806. 0 & 0 & a+b & a-b \cr                                                           
  2807. 0 & 0 & ab  & cd \cr                                                            
  2808. }.$$                                                                            
  2809. \toindex{pmatrix}                                                               
  2810.                                                                                 
  2811. The matrix entries in our examples have all been \centred{}                     
  2812. within their columns.  They can be made flush right or flush left               
  2813. by inserting {\tt \\hfill} before or after the entry. Notice the                
  2814. differences between the following example and the previous one.                 
  2815.                                                                                 
  2816. \beginliteral                                                                   
  2817. $$\pmatrix{                                                                     
  2818. a & b & c \hfill  & \hfill d  \cr                                               
  2819. b & a & c+d      & c-d      \cr                                                 
  2820. 0 & 0 & a+b      & a-b      \cr                                                 
  2821. 0 & 0 & ab \hfill & \hfill cd \cr                                               
  2822. }.$$                                                                            
  2823. @endliteral                                                                     
  2824.                                                                                 
  2825. \noindent                                                                       
  2826. gives as printed output                                                         
  2827.                                                                                 
  2828. $$\pmatrix{                                                                     
  2829. a & b & c \hfill & \hfill d   \cr                                               
  2830. b & a & c+d     & c-d       \cr                                                 
  2831. 0 & 0 & a+b     & a-b       \cr                                                 
  2832. 0 & 0 & ab \hfill & \hfill cd \cr                                               
  2833. }.$$                                                                            
  2834.                                                                                 
  2835.                                                                                 
  2836. \vbox{                                                                          
  2837. \exercise Typeset                                                               
  2838. $$ I_4 = \pmatrix{ 1 &0 &0 &0 \cr                                               
  2839.                    0 &1 &0 &0 \cr                                               
  2840.                    0 &0 &1 &0 \cr                                               
  2841.                    0 &0 &0 &1 \cr}$$                                            
  2842. }                                                                               
  2843.                                                                                 
  2844. It's possible to have matrices that use other delimiters. Using                 
  2845. {\tt \\matrix} instead of {\tt \\pmatrix} will leave off the                    
  2846. parentheses, so the delimiters must be explicitly included using                
  2847. {\tt \\left} and {\tt \\right}.  Here is how we can change the                  
  2848. matrix of our last example.                                                     
  2849. \toindex{matrix}                                                                
  2850. \toindex{left}                                                                  
  2851. \toindex{right}                                                                 
  2852.                                                                                 
  2853. \beginliteral                                                                   
  2854. $$ \left !                                                                      
  2855. \matrix{                                                                        
  2856. a & b & c & d \cr                                                               
  2857. b & a & c+d & c-d \cr                                                           
  2858. 0 & 0 & a+b & a-b \cr                                                           
  2859. 0 & 0 & ab  & cd \cr                                                            
  2860. }                                                                               
  2861. \right ! $$                                                                     
  2862. @endliteral                                                                     
  2863.                                                                                 
  2864. \noindent                                                                       
  2865. gives as printed output                                                         
  2866. $$ \left |                                                                      
  2867. \matrix{                                                                        
  2868. a & b & c & d \cr                                                               
  2869. b & a & c+d & c-d \cr                                                           
  2870. 0 & 0 & a+b & a-b \cr                                                           
  2871. 0 & 0 & ab  & cd \cr                                                            
  2872. }                                                                               
  2873. \right | $$                                                                     
  2874.                                                                                 
  2875. It's even possible to use {\tt \\left.} and {\tt \\right.} to                   
  2876. indicate that the opening or closing delimiter is deleted (note                 
  2877. the use of the period).                                                         
  2878.                                                                                 
  2879. \exercise Use a matrix construction to typeset                                  
  2880.                                                                                 
  2881. $$ !x! = \left\{ \matrix{ x & x \ge 0 \cr                                       
  2882.                          -x & x \le 0 \cr} \right.$$                            
  2883.                                                                                 
  2884. This exercise and more general constructions of this type                       
  2885. may also be typeset using the {\tt \\cases} macro.                              
  2886. \TeXref{175}                                                                    
  2887.                                                                                 
  2888. Sometimes ellipses are used within matrices.  The control words                 
  2889. {\tt \\cdots}, {\tt \\vdots}, and {\tt \\ddots} can be used to                  
  2890. insert horizontal, vertical, and diagonal dots.                                 
  2891.                                                                                 
  2892. Thus we can use                                                                 
  2893. \beginliteral                                                                   
  2894. $$ \left [                                                                      
  2895. \matrix{                                                                        
  2896. aa     & \cdots & az     \cr                                                    
  2897. \vdots & \ddots & \vdots \cr                                                    
  2898. za     & \cdots & zz     \cr                                                    
  2899. }                                                                               
  2900. \right ] $$                                                                     
  2901. @endliteral                                                                     
  2902.                                                                                 
  2903. \noindent                                                                       
  2904. gives as printed output                                                         
  2905. $$ \left [                                                                      
  2906. \matrix{                                                                        
  2907. aa     & \cdots & az     \cr                                                    
  2908. \vdots & \ddots & \vdots \cr                                                    
  2909. za     & \cdots & zz     \cr                                                    
  2910. }                                                                               
  2911. \right ] $$                                                                     
  2912.                                                                                 
  2913.                                                                                 
  2914. Matrices may also be typeset in-line, but they are pretty ugly                  
  2915. unless they have a small number of rows.                                        
  2916.                                                                                 
  2917.                                                                                 
  2918. \subsection{Displayed equations}                                                
  2919.                                                                                 
  2920. All of the mathematics covered so far has identical input whether               
  2921. it is to be typeset in-line or displayed.  At this point we'll                  
  2922. look at some situations that apply to displayed equations only.                 
  2923.                                                                                 
  2924. The first is that of aligning multiline displays.  This is done with            
  2925. the alignment character {\tt \&} and the control words {\tt \\cr} and           
  2926. {\tt \\eqalign}. Starting with {\tt \$\\eqalign\lb$\dots$\rb\$},                
  2927. the equations to be aligned are entered with each one terminated by             
  2928. {\tt \\cr}.  In each equation there should be one alignment symbol              
  2929. {\tt \&} to indicate where the alignment should take place.  This is            
  2930. usually done at the equal signs, although it is not necessary to do             
  2931. so.  For example                                                                
  2932. \TeXref{190--192}                                                               
  2933. \toindex{eqalign}                                                               
  2934.                                                                                 
  2935. \beginliteral                                                                   
  2936. $$\eqalign{                                                                     
  2937. a+b &= c+d \cr                                                                  
  2938. x &= w + y + z \cr                                                              
  2939. m + n + o + p &= q \cr                                                          
  2940. }$$                                                                             
  2941. @endliteral                                                                     
  2942.                                                                                 
  2943.                                                                                 
  2944. \noindent                                                                       
  2945. yields                                                                          
  2946. $$\eqalign{                                                                     
  2947. a+b &= c+d \cr                                                                  
  2948. x &= w + y + z \cr                                                              
  2949. m + n + o + p &= q \cr                                                          
  2950. }$$                                                                             
  2951.                                                                                 
  2952. Displayed equations can be numbered at either the right or left                 
  2953. margin.  When the control word {\tt \\eqno} appears in a displayed              
  2954. equation, everything after the control word is put at the right                 
  2955. margin.  Hence {\tt \$\$ x+y=z. \\eqno (1)\$\$} yields                          
  2956. $$ x+y=z. \eqno (1)$$                                                           
  2957. To number an equation at the left margin, use {\tt \\leqno}                     
  2958. in place of {\tt \\eqno}.                                                       
  2959. \toindex{eqno}                                                                  
  2960. \toindex{leqno}                                                                 
  2961.                                                                                 
  2962. It's possible to number aligned equations by using the control                  
  2963. word {\tt \\eqalignno}.  The alignment character {\tt \&} is                    
  2964. used to separate the equation from the equation number.                         
  2965. \beginliteral                                                                   
  2966. $$\eqalignno{                                                                   
  2967. a+b &= c+d & (1) \cr                                                            
  2968. x &= w + y + z \cr                                                              
  2969. m + n + o + p &= q & * \cr                                                      
  2970. }$$                                                                             
  2971. @endliteral                                                                     
  2972.                                                                                 
  2973. \noindent                                                                       
  2974. yields                                                                          
  2975. $$\eqalignno{                                                                   
  2976. a+b &= c+d & (1) \cr                                                            
  2977. x &= w + y + z \cr                                                              
  2978. m + n + o + p &= q & * \cr                                                      
  2979. }$$                                                                             
  2980.                                                                                 
  2981. Use {\tt \\leqalignno} to put the equation numbers on the left.                 
  2982. \TeXref{192--193}                                                               
  2983. \toindex{eqalignno}                                                             
  2984. \toindex{leqalignno}                                                            
  2985.                                                                                 
  2986. Finally, suppose some text needs to appear in the middle of a                   
  2987. displayed equation.  This can be done by putting it in an hbox.                 
  2988. We will describe hboxes in more detail in the next section.                     
  2989. For now we want to use them to temporarily resume using ordinary                
  2990. roman type and to also allow the insertion of space between                     
  2991. words (remember that all spaces are ignored when typesetting                    
  2992. mathematics). Hence                                                             
  2993. {\tt \$\$X=Y \\hbox\lb{} if and only if \rb x=y.\$\$} will give                 
  2994. $$X=Y \hbox{ if and only if } x=y.$$                                            
  2995. Note carefully the spaces in the hbox.                                          
  2996.                                                                                 
  2997. \exercise Do some of the challenge problems on pages 180--181 of The            
  2998. \TeX book.                                                                      
  2999.                                                                                 
  3000.                                                                                 
  3001.                                                                                 
  3002.                                                                                 
  3003. \section{All in a row}                                                          
  3004.                                                                                 
  3005. It's not uncommon to want to put a table in the middle of some                  
  3006. text. Fortunately \TeX{} makes it easy to do this.  In fact there               
  3007. are two separate methods of aligning text.  The first is by using               
  3008. the tabbing environment.  This is similar to setting the tab                    
  3009. stops on a typewriter. Each line is handled individually,                       
  3010. according to set tab columns, but with greater flexibility than                 
  3011. that provided by a typewriter. The second is the horizontal                     
  3012. alignment environment which typesets the whole table at once                    
  3013. using a prescribed pattern.                                                     
  3014.                                                                                 
  3015. \subsection{Picking up the tab}                                                 
  3016.                                                                                 
  3017. To align material using the tabbing environment, you must first                 
  3018. set the tab positions using the {\tt \\settabs} control word.                   
  3019. Having done this, a line to use these tabs starts with the                      
  3020. control symbol {\tt \\+ } and ends with {\tt \\cr } (remember                   
  3021. that the actual spacing on lines in the input file in                           
  3022. unimportant). \toindex{settabs}                                                 
  3023.                                                                                 
  3024. The easiest way to use the {\tt \\settabs} control word is to put               
  3025. the text into equal columns.                                                    
  3026. \TeXref{231}                                                                    
  3027. Using {\tt \\settabs 4 \\columns} will set the tabs that will                   
  3028. produce four equal columns.  The tabbing is then done by using                  
  3029. the alignment character {\tt \&} to move to the next tab stop.                  
  3030. So, for example, \toindex{columns}                                              
  3031.                                                                                 
  3032. \beginliteral                                                                   
  3033. \settabs 4 \columns                                                             
  3034. \+ British Columbia & Alberta & Saskatchewan & Manitoba \cr                     
  3035. \+ Ontario & Quebec & New Brunswick & Nova Scotia \cr                           
  3036. \+ & Prince Edward Island & Newfoundland \cr                                    
  3037. @endliteral                                                                     
  3038.                                                                                 
  3039.                                                                                 
  3040. \noindent                                                                       
  3041. will produce the table                                                          
  3042. \vskip\baselineskip                                                             
  3043.                                                                                 
  3044. \settabs 4 \columns                                                             
  3045. \+ British Columbia & Alberta & Saskatchewan & Manitoba \cr                     
  3046. \+ Ontario & Quebec & New Brunswick & Nova Scotia \cr                           
  3047. \+ & Prince Edward Island & Newfoundland \cr                                    
  3048.                                                                                 
  3049. Notice that it is possible to skip over some tab positions, and                 
  3050. it is not necessary to use all of the tabs in a given line. To                  
  3051. make the same table using five columns, it is only necessary to                 
  3052. use {\tt \\settabs 5 \\columns} to reset the tab stops; then the                
  3053. same three lines from the last example will produce:                            
  3054. \vskip\baselineskip                                                             
  3055.                                                                                 
  3056. \settabs 5 \columns                                                             
  3057. \+ British Columbia & Alberta & Saskatchewan & Manitoba \cr                     
  3058. \+ Ontario & Quebec & New Brunswick & Nova Scotia \cr                           
  3059. \+ & Prince Edward Island & Newfoundland \cr                                    
  3060.                                                                                 
  3061. In this example, the columns are smaller, of course.  In fact                   
  3062. there are two overlapping entries in the last row.  This is                     
  3063. because \TeX{} will tab to the next tab position even if (unlike                
  3064. a typewriter) it means going backward on the page.                              
  3065.                                                                                 
  3066. There is an interesting relationship between grouping and                       
  3067. tabbing. The {\tt \\settabs} values are only applicable to the                  
  3068. group in which it is defined, as would be expected.  Thus it is                 
  3069. possible to temporarily change the tab settings by grouping                     
  3070. within braces.  In addition, each table entry is in a group of                  
  3071. its own. Hence we may make a single entry boldface, for example,                
  3072. by using {\tt \\bf}  without braces. In addition, for any column                
  3073. but the last one it is possible to \centre{} the entry or to                    
  3074. align it either on the left or on the right, or to fill a column                
  3075. with a line or dots. Each entry has an implicit {\tt \\hfil} at                 
  3076. the end so that it will be at the left of the column by default.                
  3077. Adding {\tt \\hfil} at the beginning of the entry will then cause               
  3078. it to be \centred{}, just as with the {\tt \\line} control word.                
  3079. Adding {\tt \\hfill} to the beginning will cause the entries to                 
  3080. be pushed to the right ({\tt \\hfill} acts just like {\tt \\hfil}               
  3081. in that it absorbs excess space; when both {\tt \\hfil} and {\tt                
  3082. \\hfill} appear, the {\tt \\hfill} takes precedence).                           
  3083. \toindex{hfill}                                                                 
  3084.                                                                                 
  3085. \beginliteral                                                                   
  3086. \settabs 4 \columns                                                             
  3087. \+ \hfil British Columbia & \hfill Alberta \qquad & \bf Saskatchewan            
  3088. @hskip 2.5in                                  & Manitoba \cr                    
  3089. \+ \hfil Ontario & \hfill Quebec \qquad & \bf New Brunswick                     
  3090. @hskip 2.5in                                 & Nova Scotia \cr                  
  3091. \+ \hfil ---  & \hfill * \qquad & \bf Newfoundland                              
  3092. @hskip 2.5in          & Prince Edward Island \cr                                
  3093. \+ \dotfill && \hrulefill & \cr                                                 
  3094. @endliteral                                                                     
  3095.                                                                                 
  3096. \noindent                                                                       
  3097. will produce a table with the first column \centred{}, the second               
  3098. column flush left with a {\tt \\qquad} of padding, and the third                
  3099. column boldface. The control words {\tt \\dotfill} and {\tt \\hrulefill}        
  3100. give alternative column entries.                                                
  3101. \toindex{dotfill}                                                               
  3102. \toindex{hrulefill}                                                             
  3103. \vskip\baselineskip                                                             
  3104.                                                                                 
  3105. \settabs 4 \columns                                                             
  3106. \+ \hfil British Columbia & \hfill Alberta \qquad & \bf Saskatchewan            
  3107.                                         & Manitoba \cr                          
  3108. \+ \hfil Ontario & \hfill Quebec \qquad & \bf New Brunswick                     
  3109.                                         & Nova Scotia \cr                       
  3110. \+ \hfil ---  & \hfill * \qquad & \bf Newfoundland &                            
  3111.                       Prince Edward Island \cr                                  
  3112. \+ \dotfill && \hrulefill & \cr                                                 
  3113.                                                                                 
  3114. \exercise Take the table of Canadian provinces above and \centre{} each         
  3115. entry within its column.                                                        
  3116.                                                                                 
  3117. The tab positions can be set with much more flexibility than just               
  3118. in equal columns.  The general pattern is to use a sample line of               
  3119. the form {\tt \\settabs \\+ $\ldots$ \& $\ldots$ \& $\ldots$ \\cr}.             
  3120. The spacing between the alignment characters {\tt \&}                           
  3121. determines the position of the tabs.  For example, {\tt \\settabs               
  3122. \\+ \\hskip 1 in \& \\hskip 2 in \& \\hskip 1.5 in \& \\cr} would               
  3123. set the first tab one inch from the left margin, the next another               
  3124. two inches further in, and the third 1.5 inches more.  It's also                
  3125. possible to use text to determine the distance between tabs. So,                
  3126. for example, another possible sample line is                                    
  3127. {\tt \\settabs \\+ \\quad Province \\quad \& \\quad Population \\quad           
  3128. \& \\quad Area \\quad \& \\cr}.                                                 
  3129. The tab column would then be just wide enough to accept the headings            
  3130. with a quad of space on each side.  Here's a more complete example:             
  3131.                                                                                 
  3132. \beginuser \obeyspaces                                                          
  3133. \\settabs \\+ \\quad Year \\quad \& \\quad Price \\quad                         
  3134.                                             \& \\quad Dividend \& \\cr          
  3135. \\+ \\hfill Year \\quad \& \\quad Price  \\quad \& \\quad Dividend \\cr         
  3136. \\+ \\hfill 1971 \\quad \& \\quad 41--54 \\quad \& \\qquad \$2.60   \\cr        
  3137. \\+ \\hfill 2    \\quad \& \\quad 41--54 \\quad \& \\qquad \$2.70 \\cr          
  3138. \\+ \\hfill 3    \\quad \& \\quad 46--55 \\quad \& \\qquad \$2.87 \\cr          
  3139. \\+ \\hfill 4    \\quad \& \\quad 40--53 \\quad \& \\qquad \$3.24 \\cr          
  3140. \\+ \\hfill 5    \\quad \& \\quad 45--52 \\quad \& \\qquad \$3.40 \\cr          
  3141. \enduser                                                                        
  3142.                                                                                 
  3143. \noindent                                                                       
  3144. gives \TeXref{247}                                                              
  3145. \vskip\baselineskip                                                             
  3146.                                                                                 
  3147. \settabs \+ \quad Year \quad & \quad Price \quad & \quad                        
  3148. Dividend \quad & \cr                                                            
  3149. \+ \hfill Year \quad & \quad Price  \quad & \quad Dividend \cr                  
  3150. \+ \hfill 1971 \quad & \quad 41--54 \quad & \qquad \$2.60   \cr                 
  3151. \+ \hfill 2    \quad & \quad 41--54 \quad & \qquad \$2.70 \cr                   
  3152. \+ \hfill 3    \quad & \quad 46--55 \quad & \qquad \$2.87 \cr                   
  3153. \+ \hfill 4    \quad & \quad 40--53 \quad & \qquad \$3.24 \cr                   
  3154. \+ \hfill 5    \quad & \quad 45--52 \quad & \qquad \$3.40 \cr                   
  3155.                                                                                 
  3156. \exercise Take the table given above and move it closer to the                  
  3157. \centre{} of the page.                                                          
  3158.                                                                                 
  3159. \exercise One way to \centre{} a some text, possibly several                    
  3160. lines long, is to use: {\tt \$\$\\vbox\lb$\ldots$\rb\$\$}. Use                  
  3161. this to \centre{} the table given above.  Does the                              
  3162. {\tt \\settabs} line need to be included in the {\tt \\vbox}?                   
  3163.                                                                                 
  3164. \exercise Improve your last result by putting a line under the                  
  3165. column heads.  The control word {\tt \\hrule} will insert a                     
  3166. horizontal line if introduced between two rows of a table.  Now                 
  3167. repeat with the control word {\tt \\strut} after the {\tt \\+ }                 
  3168. of the line containing the column heads. (A {\tt \\strut}                       
  3169. effectively makes the spacing between lines a little greater. The               
  3170. size can be altered from the default.)\TeXref{82} Note the extra                
  3171. space that results.                                                             
  3172. \toindex{strut}                                                                 
  3173.                                                                                 
  3174. \exercise Make the following table with decimal alignment, that                 
  3175. is, with the decimal points above each other (think of the dollar               
  3176. figure as being right aligned and the cents figure as being left                
  3177. aligned against the decimal point):                                             
  3178. \medskip                                                                        
  3179. \settabs \+ \hskip 2 in & \hskip .75in & \hskip 1cm& \cr                        
  3180. \+ &Plums &\hfill\$1&.22 \cr                                                    
  3181. \+ &Coffee &\hfill1&.78 \cr                                                     
  3182. \+ &Granola &\hfill1&.98 \cr                                                    
  3183. \+ &Mushrooms & &.63 \cr                                                        
  3184. \+ &{Kiwi fruit} & &.39 \cr                                                     
  3185. \+ &{Orange juice} &\hfill1&.09 \cr                                             
  3186. \+ &Tuna &\hfill1&.29 \cr                                                       
  3187. \+ &Zucchini & &.64 \cr                                                         
  3188. \+ &Grapes &\hfill1&.69 \cr                                                     
  3189. \+ &{Smoked beef} & &.75 \cr                                                    
  3190. \+ &Broccoli &\hfill\underbar{\ \ 1}&\underbar{.09} \cr                         
  3191. \+ &Total &\hfill \$12&.55 \cr                                                  
  3192.                                                                                 
  3193.                                                                                 
  3194. \exercise Devise a method to make a rough table of contents by using            
  3195. {\tt settabs} and having entries looking something like:\hfil\break             
  3196. \leftline{\tt Getting Started \\dotfill \& \\hfill 1}                           
  3197. \leftline{\tt All Characters Great and Small \\dotfill \& \\hfill 9.}           
  3198.                                                                                 
  3199. \subsection{Horizontal alignment with more sophisticated patterns}              
  3200.                                                                                 
  3201. The {\tt \\settabs} environment is not difficult to use, and once               
  3202. the pattern is set, it can be used repeatedly in different                      
  3203. portions of the text that follows.  It does have some drawbacks,                
  3204. however. For one, the column size must be set before the entries                
  3205. are known. Also, even though in one case we wanted the third                    
  3206. column to be boldface, it had to be specified in each line.                     
  3207. These problems can be handled more easily by using the {\tt                     
  3208. \\halign} environment.                                                          
  3209. \TeXref{235--238}                                                               
  3210. \toindex{halign}                                                                
  3211.                                                                                 
  3212.                                                                                 
  3213. The general pattern in the {\tt \\halign} is as follows:                        
  3214. \beginuser                                                                      
  3215. \\halign\lb{} <template line> \\cr                                              
  3216. <first display line> \\cr                                                       
  3217. <second display line> \\cr                                                      
  3218. $\vdots$                                                                        
  3219. <last display line> \\cr                                                        
  3220. \rb                                                                             
  3221. \enduser                                                                        
  3222.                                                                                 
  3223. Both the template line and the display lines are divided into                   
  3224. sections by the alignment symbol {\tt \&}\null. In the template                 
  3225. line each section uses control words in the same manner as does                 
  3226. {\tt \\line\lb\rb}\null.  The control word {\tt \\hfil}, for                    
  3227. example, can be used to display flush left, flush right, or \centred.           
  3228. Fonts can be changed using {\tt \\bf}, {\tt \\it}, etc.                         
  3229. Text may also be entered in the template line.  In addition the                 
  3230. special symbol {\tt \#} must appear once in each section.  Each                 
  3231. display line is then set by substituting each section of the                    
  3232. display line into its corresponding section of the template line                
  3233. at the occurrence of the {\tt \#}\null.                                         
  3234.                                                                                 
  3235. Consider the following example:                                                 
  3236.                                                                                 
  3237. \beginuser                                                                      
  3238. \\halign\lb\\hskip 2 in \$\#\$ \& \\hfil \\quad \# \\hfil \& \\qquad \$\#\$     
  3239.        \hskip 3in \& \\hfil \\quad \# \\hfil \\cr                               
  3240. \\alpha   \& alpha   \& \\beta  \& beta  \\cr                                   
  3241. \\gamma   \& gamma   \& \\delta \& delta \\cr                                   
  3242. \\epsilon \& epsilon \& \\zeta  \& zeta  \\cr                                   
  3243. \rb                                                                             
  3244. \enduser                                                                        
  3245.                                                                                 
  3246. \noindent The template line indicates that the first section of                 
  3247. the typeset text will always be set two inches in from the left                 
  3248. and also be set as mathematics.  The second section will be \centred{}          
  3249. after adding a quad of space on the left.  The third                            
  3250. and fourth sections are handled similarly.  Here is the result:                 
  3251. \vskip\baselineskip                                                             
  3252.                                                                                 
  3253. \halign{\hskip 2in $#$ & \hfil\quad # \hfil & \qquad $#$                        
  3254.                        & \hfil\quad # \hfil\cr                                  
  3255. \alpha   & alpha   & \beta  & beta \cr                                          
  3256. \gamma   & gamma   & \delta & delta \cr                                         
  3257. \epsilon & epsilon & \zeta  & zeta \cr                                          
  3258. }                                                                               
  3259.                                                                                 
  3260. In this case the first display line is formed by substituting {\tt              
  3261. \\alpha} for the first {\tt \#} in the template line, {\tt alpha} for           
  3262. the second {\tt \#}, {\tt \\beta} for the third and {\tt beta} for              
  3263. the fourth.  The whole line is then saved for setting.  This                    
  3264. continues until all the lines are accumulated, and then they are set            
  3265. with each column being as wide as necessary to accept all of its                
  3266. entries (an implication of this accumulation process is that a table            
  3267. with too many entries could cause \TeX{} to run out of memory; it's             
  3268. better not to set tables that are more than a page or so long).                 
  3269.                                                                                 
  3270. Hence the template line establishes the pattern for the table entries           
  3271. and the display lines insert the individual entries.                            
  3272.                                                                                 
  3273. Sometimes horizontal and vertical lines are used to delimit                     
  3274. entries in a table.  To put in horizontal lines, we use {\tt \\hrule},          
  3275. just as we did in the {\tt \\settabs} environment.                              
  3276. However, we don't want the rule to be aligned according to the                  
  3277. template, so we use the control word {\tt \\noalign}.  Hence                    
  3278. horizontal lines are inserted by putting {\tt \\noalign\lb\\hrule\rb};          
  3279. vertical lines are inserted by putting {\tt \\vrule}                            
  3280. in either the template or the display line. But still all is not                
  3281. completely straightforward.  Suppose we take our last example and               
  3282. change the template to get vertical lines and also insert                       
  3283. horizontal lines.                                                               
  3284. \toindex{noalign}                                                               
  3285.                                                                                 
  3286. \beginuser                                                                      
  3287. \\halign\lb\\hskip 2in\\vrule\\quad \$\#\$\\quad \& \\vrule \\hfil\\quad %      
  3288. \# \\hfil                                                                       
  3289. \hskip 2.5 in \& \\quad \\vrule \\quad \$\#\$ \\quad \\vrule                    
  3290. \hskip 2.5 in \& \\hfil \\quad \# \\quad \\hfil \\vrule \\cr                    
  3291. \\noalign\lb\\hrule\rb                                                          
  3292. \\alpha   \& alpha   \& \\beta  \& beta \\cr                                    
  3293. \\noalign\lb\\hrule\rb                                                          
  3294. \\gamma   \& gamma   \& \\delta \& delta \\cr                                   
  3295. \\noalign\lb\\hrule\rb                                                          
  3296. \\epsilon \& epsilon \& \\zeta  \& zeta \\cr                                    
  3297. \\noalign\lb\\hrule\rb                                                          
  3298. \rb                                                                             
  3299. \enduser                                                                        
  3300.                                                                                 
  3301. \noindent                                                                       
  3302. doesn't give exactly what we want.                                              
  3303.                                                                                 
  3304. \vskip\baselineskip                                                             
  3305.                                                                                 
  3306. \halign{\hskip 2in\vrule\quad $#$\quad & \vrule \hfil\quad # \hfil              
  3307. & \quad \vrule \quad $#$ \quad \vrule & \hfil\quad # \quad \hfil                
  3308. \vrule \cr                                                                      
  3309. \noalign{\hrule}                                                                
  3310. \alpha   & alpha   & \beta  & beta \cr                                          
  3311. \noalign{\hrule}                                                                
  3312. \gamma   & gamma   & \delta & delta \cr                                         
  3313. \noalign{\hrule}                                                                
  3314. \epsilon & epsilon & \zeta  & zeta \cr                                          
  3315. \noalign{\hrule}                                                                
  3316. }                                                                               
  3317.                                                                                 
  3318. There are several deficiencies: the most obvious is the extended                
  3319. horizontal lines, but also the text looks somewhat squashed into                
  3320. the boxes.  As in the {\tt \\settabs} environment, lines can be                 
  3321. made taller by including the control word {\tt \\strut} in the                  
  3322. template.\TeXref{82} A further problem can occur when the page is               
  3323. set since \TeX{} may spread lines apart slightly to improve the                 
  3324. appearance of the page.  This would leave a gap between the                     
  3325. vertical lines, so we use the control word {\tt \\offinterlineskip}             
  3326. within the {\tt \\halign} to avoid this.                                        
  3327. Finally we can get rid of the lines sticking out on the left by                 
  3328. deleting the {\tt \\hskip 2 in} from the template line.  To move                
  3329. the table to the same position we use {\tt \\moveright}.  Hence                 
  3330. we can improve our result by using                                              
  3331. \toindex{offinterlineskip}                                                      
  3332. \toindex{moveright}                                                             
  3333.                                                                                 
  3334. \beginuser                                                                      
  3335. \\moveright 2 in                                                                
  3336. \\vbox\lb\\offinterlineskip                                                     
  3337. \\halign\lb\\strut\\vrule\\quad \$\#\$\\quad \& \\vrule \\hfil\\quad \# \\hfil  
  3338. \& \\quad \\vrule \\quad \$\#\$ \\quad \\vrule \& \\hfil\\quad %                
  3339. \# \\quad \\hfil \\vrule \\cr                                                   
  3340. \\noalign\lb\\hrule\rb                                                          
  3341. \\alpha   \& alpha   \& \\beta  \& beta \\cr                                    
  3342. \\noalign\lb\\hrule\rb                                                          
  3343. \\gamma   \& gamma   \& \\delta \& delta \\cr                                   
  3344. \\noalign\lb\\hrule\rb                                                          
  3345. \\epsilon \& epsilon \& \\zeta  \& zeta \\cr                                    
  3346. \\noalign\lb\\hrule\rb                                                          
  3347. \rb\rb                                                                          
  3348. \enduser                                                                        
  3349.                                                                                 
  3350. \noindent                                                                       
  3351. to get                                                                          
  3352. \vskip\baselineskip                                                             
  3353.                                                                                 
  3354. \moveright 2 in                                                                 
  3355. \vbox{\offinterlineskip                                                         
  3356. \halign{\strut\vrule\quad $#$\quad & \vrule \hfil\quad # \hfil                  
  3357. & \quad \vrule \quad $#$ \quad \vrule & \hfil\quad # \quad \hfil                
  3358. \vrule \cr                                                                      
  3359. \noalign{\hrule}                                                                
  3360. \alpha   & alpha   & \beta  & beta \cr                                          
  3361. \noalign{\hrule}                                                                
  3362. \gamma   & gamma   & \delta & delta \cr                                         
  3363. \noalign{\hrule}                                                                
  3364. \epsilon & epsilon & \zeta  & zeta \cr                                          
  3365. \noalign{\hrule}                                                                
  3366. }                                                                               
  3367. }                                                                               
  3368.                                                                                 
  3369. In general, if we want to construct a table with boxed entries                  
  3370. that is \centred{} on the page, we can do so by putting the {\tt                
  3371. \\vbox} within a {\tt \\centerline\lb\rb}\null. But here is a                   
  3372. trick that will produce a nicer result.  If the {\tt \\vbox} is                 
  3373. put in between double dollar signs, it will be typeset as                       
  3374. displayed mathematics.  Of course, there is no actual                           
  3375. mathematics being displayed, but \TeX{} will put in a little                    
  3376. extra space above and below the table as is appropriate for a                   
  3377. display.  Hence a \centred{} table with this nice spacing may be                
  3378. formed using the following four steps:                                          
  3379. (1) put a {\tt \\vbox} between double dollar signs,                             
  3380. (2) put an {\tt \\offinterlineskip} and an {\tt \\halign} within                
  3381. the {\tt \\vbox},                                                               
  3382. (3) in the {\tt \\halign} put a template line with a {\tt \\strut}              
  3383. in the beginning,  and a {\tt \\vrule} surrounding each entry,                  
  3384. (4) each row of the table should be preceded and followed by                    
  3385. {\tt \\noalign\lb\\hrule\rb}.                                                   
  3386.                                                                                 
  3387. Here is the pattern to be followed:                                             
  3388.                                                                                 
  3389. \beginuser                                                                      
  3390. \$\$\\vbox\lb                                                                   
  3391. \\offinterlineskip                                                              
  3392. \\halign\lb                                                                     
  3393. \\strut \\vrule \# \& \\vrule \# \& \dots \& \\vrule \# \\vrule \\cr            
  3394. \\noalign\lb\\hrule\rb                                                          
  3395. <first column entry> \& <second column entry> \& \dots %                        
  3396. \& <last column entry> \\cr                                                     
  3397. \\noalign\lb\\hrule\rb                                                          
  3398. \dots                                                                           
  3399. \\noalign\lb\\hrule\rb                                                          
  3400. <first column entry> \& <second column entry> \& \dots %                        
  3401. \& <last column entry> \\cr                                                     
  3402. \\noalign\lb\\hrule\rb                                                          
  3403. \rb                                                                             
  3404. \rb\$\$                                                                         
  3405. \enduser                                                                        
  3406.                                                                                 
  3407.                                                                                 
  3408.                                                                                 
  3409. \section{Rolling your own}                                                      
  3410.                                                                                 
  3411. In this section we'll create new control words.  The making of                  
  3412. these new definitions, also called macros, is one of the most                   
  3413. powerful techniques available in \TeX\null.  For the first                      
  3414. application of this facility, we'll see how a new definition can                
  3415. save a lot of typing by substituting short strings for long ones.               
  3416.                                                                                 
  3417. \subsection{The long and short of it}                                           
  3418.                                                                                 
  3419. The control word {\tt \\def} is used to define new control words.               
  3420. The simplest form for doing this is {\tt \\def\\newname\lb$\ldots$\rb}.         
  3421. Then whenever {\tt \\newname} appears in your                                   
  3422. input file, it will be replaced by whatever is between the braces               
  3423. in the definition.  Of course {\tt \\newname} must satisfy the                  
  3424. convention for naming control sequences, that is, it must be a                  
  3425. control word (all letters) or a control symbol (exactly one                     
  3426. nonletter). So, for example, suppose you write a document that                  
  3427. contains the phrase ``University of Manitoba'' many times.  Then                
  3428. {\tt \\def\\um\lb University of Manitoba\rb} defines a new                      
  3429. control sequence {\tt \\um} which can then be used at any time.                 
  3430. The sentence {\tt I take courses at the \\um.}\ then makes                      
  3431. sense. If the control word exists, your new definition will                     
  3432. replace it (this includes the control words defined by \TeX{}, so               
  3433. a little care must be taken in the choice of name). Any                         
  3434. definition is, however,  local to the group in which it is                      
  3435. defined.  For example, \toindex{def}                                            
  3436.                                                                                 
  3437. \beginuser                                                                      
  3438. \\def\\um\lb University of Manitoba\rb                                          
  3439. I took my first course at the \\um.                                             
  3440. \lb                                                                             
  3441. \\def\\um\lb Universit\\'e de Montr\\'eal\rb                                    
  3442. Then I took my next course at the \\um.                                         
  3443. \rb                                                                             
  3444. Finally I took my last course at the \\um.                                      
  3445. \enduser                                                                        
  3446.                                                                                 
  3447. \noindent gives \medskip                                                        
  3448.                                                                                 
  3449. \def\um{University of Manitoba}                                                 
  3450. I took my first course at the \um.                                              
  3451. {                                                                               
  3452. \def\um{Universit\'e de Montr\'eal}                                             
  3453. Then I took my next course at the \um.                                          
  3454. }                                                                               
  3455. Finally I took my last course at the \um.                                       
  3456.                                                                                 
  3457. Remember that all spaces after a control word are absorbed; this                
  3458. includes the ones you define.                                                   
  3459.                                                                                 
  3460. Once a new control sequence has been defined, it may be used in                 
  3461. new definitions. This is one way of making simple form letters.                 
  3462. First let's define a simple letter.                                             
  3463.                                                                                 
  3464. \beginuser                                                                      
  3465. \\def\\letter\lb                                                                
  3466. \\par \\noindent                                                                
  3467. Dear \\name,                                                                    
  3468.                                                                                 
  3469. This is a little note to let you know that your name is \\name.                 
  3470.                                                                                 
  3471. \\hskip 2 in Sincerely yours,                                                   
  3472. \\vskip 2\\baselineskip                                                         
  3473. \\hskip 2 in The NameNoter                                                      
  3474. \\smallskip \\hrule                                                             
  3475. \rb                                                                             
  3476. \enduser                                                                        
  3477.                                                                                 
  3478. \def\letter{                                                                    
  3479. \par \noindent                                                                  
  3480. Dear \name,                                                                     
  3481.                                                                                 
  3482. This is a little note to let you know that your name is \name.                  
  3483.                                                                                 
  3484. \hskip 2 in Sincerely yours,                                                    
  3485. \vskip 2\baselineskip                                                           
  3486. \hskip 2 in The NameNoter                                                       
  3487. \smallskip \hrule                                                               
  3488. }                                                                               
  3489.                                                                                 
  3490. Now this letter uses the control word {\tt \\name}, which is                    
  3491. undefined at this point.  When {\tt \\letter} is used, the                      
  3492. current value of {\tt \\name} will appear in the body of the                    
  3493. letter. Hence                                                                   
  3494.                                                                                 
  3495. \beginuser                                                                      
  3496. \\def\\name\lb Michael Bishop\rb                                                
  3497. \\letter                                                                        
  3498. \\def\\name\lb Michelle L\\'ev\\\~{}eque\rb                                     
  3499. \\letter                                                                        
  3500. \enduser                                                                        
  3501.                                                                                 
  3502. \noindent will produce two copies of the letter, each with the                  
  3503. correct name, followed by a horizontal rule:                                    
  3504.                                                                                 
  3505. \def\name{Michael Bishop}                                                       
  3506. \letter                                                                         
  3507. \def\name{Michelle L\'ev\~eque}                                                 
  3508. \letter                                                                         
  3509.                                                                                 
  3510. We could have put anything between the braces in                                
  3511. {\tt \\def\\name\lb$\ldots$\rb}; it could be several paragraphs                 
  3512. long and use other control sequences (although in this context it               
  3513. would be a little strange). Of course it is possible to use {\tt                
  3514. \\vfill \\eject} as part of the definition of {\tt \\letter} to                 
  3515. eject the page when the letter is completed.                                    
  3516.                                                                                 
  3517. \exercise Make a form letter that uses the control words {\tt \\name},          
  3518. {\tt \\address}, {\tt \\city}, {\tt \\\province}, and {\tt                      
  3519. \\\postcode}.                                                                   
  3520.                                                                                 
  3521. \exercise An unnumbered list of items is often made                             
  3522. using {\tt \\item\lb\$\\bullet\$\rb}.  Define a macro {\tt \\bitem}             
  3523. that does this, and use it for several paragraphs. Now change the               
  3524. all the bullets to a dash (note that a simple change in the macro               
  3525. propagates all the necessary changes in all of the other                        
  3526. paragraphs).                                                                    
  3527.                                                                                 
  3528. \exercise Suppose that you are going to have to format several                  
  3529. paragraphs in a paper using {\tt \\hangindent = 30 pt}, {\tt \\hangafter        
  3530. = 4}, and {\tt \\filbreak} (don't worry about what                              
  3531. these control sequences actually do; the only important thing                   
  3532. for now is that once they are set, they remain in effect for only               
  3533. one paragraph).  Define a single control sequence {\tt \\setpar}                
  3534. which can then be put in front of each paragraph that needs to be               
  3535. so formatted.                                                                   
  3536.                                                                                 
  3537.                                                                                 
  3538. \subsection{Filling in with parameters}                                         
  3539.                                                                                 
  3540. It's possible to use macros in much greater generality by                       
  3541. allowing parameters to be passed.  The idea is somewhat similar                 
  3542. to the template line in the {\tt \\halign} environment.  First,                 
  3543. let's look at the case where there is one parameter.  In this                   
  3544. case a control sequence is defined by {\tt \\def\\newword\#1\lb                 
  3545. $\ldots$\rb}\null.  The symbol {\tt \#1} may appear between the                 
  3546. braces (several times) in the definition of {\tt \\newword}.  The               
  3547. material between the braces acts like a template. When {\tt                     
  3548. \\newword\lb$\ldots$\rb} appears in the text, it will use the                   
  3549. definition of {\tt \\newword} with the material between the                     
  3550. braces inserted into the template at every occurrence of {\tt                   
  3551. \#1} in the original definition. {\bf The spacing in the original               
  3552. definition is crucial here; there must be no spaces before the                  
  3553. opening brace}.                                                                 
  3554.                                                                                 
  3555. As an example, we could use the form letter of the last section in              
  3556. the following way:                                                              
  3557.                                                                                 
  3558.                                                                                 
  3559. \beginuser                                                                      
  3560. \\def\\letter\#1\lb                                                             
  3561. \\par \\noindent                                                                
  3562. Dear \#1,                                                                       
  3563.                                                                                 
  3564. This is a little note to let you know that your name is \#1.                    
  3565.                                                                                 
  3566. \\hskip 2 in Sincerely yours,                                                   
  3567. \\vskip 2\\baselineskip                                                         
  3568. \\hskip 2 in The NameNoter                                                      
  3569. \\smallskip \\hrule                                                             
  3570. \rb                                                                             
  3571. \enduser                                                                        
  3572.                                                                                 
  3573. \def\letter#1{                                                                  
  3574. \par \noindent                                                                  
  3575. Dear #1,                                                                        
  3576.                                                                                 
  3577. This is a little note to let you know that your name is #1.                     
  3578.                                                                                 
  3579. \hskip 2 in Sincerely yours,                                                    
  3580. \vskip 2\baselineskip                                                           
  3581. \hskip 2 in The NameNoter                                                       
  3582. \smallskip \hrule                                                               
  3583. }                                                                               
  3584.                                                                                 
  3585. Now we can use                                                                  
  3586.                                                                                 
  3587. \beginuser                                                                      
  3588. \\letter\lb Michael Bishop\rb                                                   
  3589. \\letter\lb Michelle L\\'ev\\\~{}eque\rb                                        
  3590. \enduser                                                                        
  3591.                                                                                 
  3592. \noindent to get \medskip                                                       
  3593. \letter{Michael Bishop}                                                         
  3594. \letter{Michelle L\'ev\~eque}                                                   
  3595.                                                                                 
  3596. \def\displaytext#1{$$\vbox{\hsize=12cm #1}$$}                                   
  3597. \bigskip                                                                        
  3598. \displaytext{                                                                   
  3599. Now let's define                                                                
  3600. {\tt\\def\\displaytext\#1\lb \$\$\\vbox\lb\\hsize = 12 cm \#1\rb\$\$\rb}        
  3601. as a new macro to display text.                                                 
  3602. Then {\tt \\displaytext\lb$\ldots$\rb} will cause the material                  
  3603. between the braces to be put in a paragraph with width 12 \centimetre           
  3604. s and then \centred{} with some space added above and                           
  3605. below as is appropriate for a display.  This paragraph was set                  
  3606. using this {\tt \\displaytext} macro.                                           
  3607. }                                                                               
  3608.                                                                                 
  3609. The parameter of a macro can be no more than one paragraph long.                
  3610. If a new paragraph is encountered as part of a parameter, an                    
  3611. error will be generated.  This is a safety feature, for                         
  3612. otherwise the accidental omission of a closing brace would cause                
  3613. \TeX{} to eat up the rest of the file as the parameter.                         
  3614.                                                                                 
  3615. \exercise Define a macro {\tt \\yourgrade} so that {\tt                         
  3616. \\yourgrade\lb89\rb} will cause the following sentence to be                    
  3617. typeset: The grade you received is 89\%\null. It should be able                 
  3618. to work with any other percentage, of course.                                   
  3619.                                                                                 
  3620. It's not really any harder to use more that one parameter.  The form            
  3621. used to define a new control word with two parameters is                        
  3622. {\tt \\def\\newword\#1\#2\lb$\ldots$\rb}. The definition between the            
  3623. braces may have {\tt \#1} and {\tt \#2} occurring in it, perhaps                
  3624. several times.  When {\tt \\newword\lb$\ldots$\rb\lb$\ldots$\rb}                
  3625. appears in the text, the material between the first set of braces               
  3626. replaces {\tt \#1} in the definition and the material between the               
  3627. second set of braces replaces {\tt \#2} in the definition.  Here is             
  3628. an example followed by its result:                                              
  3629.                                                                                 
  3630. \beginuser                                                                      
  3631. \\def\\talks\#1\#2\lb \#1 talks to \#2.\rb                                      
  3632. \\talks\lb John\rb\lb Jane\rb                                                   
  3633. \\talks\lb Jane\rb\lb John\rb                                                   
  3634. \\talks\lb John\rb\lb me\rb                                                     
  3635. \\talks\lb She\rb\lb Jane\rb                                                    
  3636. \enduser                                                                        
  3637.                                                                                 
  3638. \def\talks#1#2{#1 talks to #2.}                                                 
  3639. \talks{John}{Jane}                                                              
  3640. \talks{Jane}{John}                                                              
  3641. \talks{John}{me}                                                                
  3642. \talks{She}{Jane}                                                               
  3643.                                                                                 
  3644. \exercise In a manner similar to the previous exercise, define a                
  3645. macro {\tt \\yourgrade} so that {\tt \\yourgrade\lb89\rb\lb85\rb}               
  3646. causes the following sentence to be typeset: You received a grade               
  3647. of 89\% on your first exam and a grade of 85\% on your second                   
  3648. exam.                                                                           
  3649.                                                                                 
  3650. \exercise Write a macro {\tt \\frac} so that {\tt \\frac\lb                     
  3651. a\rb\lb b\rb} will typeset the fraction ${a\over b}$.                           
  3652.                                                                                 
  3653. It's important not to put any spaces before the first brace in                  
  3654. the definition. If you do, \TeX{} will interpret the definition                 
  3655. differently from the way described here. For more than two                      
  3656. parameters, the method of definition is similar. To define a                    
  3657. control word with three parameters, start with                                  
  3658. {\tt \\def\\newword\#1\#2\#3\lb$\ldots$\rb}. Then {\tt \#1},                    
  3659. {\tt \#2} and {\tt \#3} may occur between the braces. When                      
  3660. {\tt \\newword\lb$\ldots$\rb\lb$\ldots$\rb\lb$\ldots$\rb}                       
  3661. appears in the text, the material between each set of braces                    
  3662. replaces its corresponding symbol in the definition of the                      
  3663. control word. The parameters may go up to {\tt \#9}.                            
  3664.                                                                                 
  3665. \subsection{By any other name}                                                  
  3666.                                                                                 
  3667. Sometimes it's convenient to be able to give a control word an                  
  3668. alternative name.  For example, if you prefer a different spelling,             
  3669. you might want to call the control word {\tt \\centerline} by the               
  3670. name of {\tt \\centreline}.  This can be done by using the {\tt                 
  3671. \\let} control word.  The use of {\tt \\let \\centreline =                      
  3672. \\centerline} now makes a new (as well as the old) control word                 
  3673. available.  This can also be used with mathematical names as with               
  3674. {\tt \\let \\tensor = \\otimes}.  It is then possible to use                    
  3675. \TeXref{206--207}                                                               
  3676.                                                                                 
  3677. \toindex{let}                                                                   
  3678. \toindex{centreline}                                                            
  3679. \toindex{tensor}                                                                
  3680.                                                                                 
  3681. \let\tensor=\otimes                                                             
  3682. \beginuser                                                                      
  3683. \$\$ (A \\tensor B) (C \\tensor D) = AC \\tensor BD. \$\$                       
  3684. \enduser                                                                        
  3685.                                                                                 
  3686. \noindent to get                                                                
  3687.                                                                                 
  3688. $$ (A \tensor B) (C \tensor D) = AC \tensor BD. $$                              
  3689.                                                                                 
  3690.                                                                                 
  3691.                                                                                 
  3692. \exercise Define control sequences {\tt \\ll}, {\tt \\cl}, and                  
  3693. {\tt \\rl} that are equivalent to {\tt \\leftline}, {\tt \\centerline},         
  3694. and {\tt \\rightline}.                                                          
  3695.                                                                                 
  3696. The {\tt \\let} control word allows users to name their own                     
  3697. control sequences.  This allows a personalized set of control                   
  3698. sequences that may be used in place of the ones provided by \TeX{}              
  3699. when desired.                                                                   
  3700.                                                                                 
  3701. \section{To err is human}                                                       
  3702.                                                                                 
  3703. In some ways \TeX{} is not completely divine. \TeX{} will respond               
  3704. to invalid input by giving an error message, both to the screen                 
  3705. if you are using it interactively and also to the log file.                     
  3706. Because \TeX{} is very complicated, the actual point where the                  
  3707. error is detected may be deep within the program, so a full                     
  3708. report of the error may be rather long and involved.    Not only                
  3709. that, \TeX{} will try to recover from errors, and reports what                  
  3710. was done in that process.  For this reason the reading of error                 
  3711. messages may be a little difficult for the uninitiated.  The key                
  3712. is to know what is important from your perspective and what can                 
  3713. be safely ignored. So let's look at some typical errors and the                 
  3714. messages that they generate.                                                    
  3715.                                                                                 
  3716. \subsection{The forgotten bye}                                                  
  3717.                                                                                 
  3718. The first mistake that we'll look at is one that everyone makes                 
  3719. at some time, namely, the omission of {\tt \\bye} at the end of                 
  3720. the file. If you're using \TeX{} interactively, an asterisk \hfil               
  3721. \break                                                                          
  3722. \leftline{\tt *}                                                                
  3723. will be printed on the screen and nothing will happen since,                    
  3724. having not been told to finish up,  \TeX{} is waiting for input                 
  3725. (from your keyboard).  Whatever you type in will be appended to                 
  3726. whatever has been input from your files.  The usual response is                 
  3727. to type {\tt \\bye<CR>}\footnote{${}~1$}{{\tt <CR>} is the key                  
  3728. used to end a line of input.  It might be called the carriage                   
  3729. return, enter, or simply the return key on your terminal.                       
  3730. Sometimes it is indicated by a large left arrow.} since that will               
  3731. finish things up.                                                               
  3732.                                                                                 
  3733. \subsection{The misspelled or unknown control sequence}                         
  3734.                                                                                 
  3735. Using a misspelled or other control sequence unknown to \TeX{} is               
  3736. a common error.  If \TeX{} is being run as a batch job, an error                
  3737. message is printed and the job goes on ignoring the control                     
  3738. sequence.  When using \TeX{} interactively, it is possible to                   
  3739. repair errors (of course this does not change the original input                
  3740. file, so that must be done when the \TeX{} job is completed).                   
  3741. Suppose we have a \TeX{} input file consisting of the following                 
  3742. two lines:                                                                      
  3743. \beginuser                                                                      
  3744. \\line\lb The left side \\hfli the right side\rb                                
  3745. \\bye                                                                           
  3746. \enduser                                                                        
  3747.                                                                                 
  3748. The control word should be {\tt \\hfil}, of course. Here is the                 
  3749. message that would be sent to your terminal:                                    
  3750.                                                                                 
  3751. \beginuser                                                                      
  3752. \obeyspaces                                                                     
  3753. ! Undefined  control sequence.                                                  
  3754. l.1 \\line\lb The left side \\hfli                                              
  3755. \                               the right side\rb                               
  3756. ?                                                                               
  3757. \enduser                                                                        
  3758.                                                                                 
  3759. The first line starts with {\tt !} and gives the error message.                 
  3760. Next comes the line number on which the error occurred and the                  
  3761. part of the line that was read successfully.  The next line gives               
  3762. the continuation of the line after the error. At this point the                 
  3763. question mark means that \TeX{} is waiting for a response.  There               
  3764. are several legal ones:                                                         
  3765. \nobreak                                                                        
  3766. \maketable [Responses to \TeX{} error messages]                                 
  3767. \halign{                                                                        
  3768. \strut \hfil # \hfil & \quad \hfil \tt # \hfil & # \hfil\cr                     
  3769.    \bf Desired response & \bf Input to \TeX{} & \bf \hfil Result\cr             
  3770.    \noalign{\hrule} \noalign{\smallskip}                                        
  3771.    Help   & h<CR>& Reason for stopping listed on terminal.\cr                   
  3772.    Insert & i<CR>& Next line inserted into \TeX{} input file.\cr                
  3773.    Exit   & x<CR>& Exit from \TeX\null. Completed pages to DVI file.\cr         
  3774.    Scroll & s<CR>& List message and continue after minor errors.\cr             
  3775.    Run    & r<CR>& List message and continue after any errors.\cr               
  3776.    Quiet  & q<CR>& All terminal listings suppressed.\cr                         
  3777.    Carry on &<CR> & \TeX{} continues as best it can.\cr                         
  3778.       }                                                                         
  3779.                                                                                 
  3780. In our last example a reasonable response might be to enter {\tt                
  3781. h<CR>} to get a help message, then {\tt i<CR>} to insert more                   
  3782. text, (at which point \TeX{} responds with {\tt insert> } and                   
  3783. finally {\tt \\hfil} as the correct control word.  Here is the                  
  3784. result:                                                                         
  3785.                                                                                 
  3786.                                                                                 
  3787. \beginuser                                                                      
  3788. ? h                                                                             
  3789. The control sequence at the end of the top line                                 
  3790. of your error message was never \\def'ed. If you have                           
  3791. misspelled it (e.g., `\\hobx'), type `I' and the correct                        
  3792. spelling (e.g., `I\\hbox'). Otherwise just continue,                            
  3793. and I'll forget about whatever was undefined.                                   
  3794.                                                                                 
  3795. ? i                                                                             
  3796. insert>\\hfil                                                                   
  3797. [1]                                                                             
  3798. \enduser                                                                        
  3799.                                                                                 
  3800. The final {\tt [1]} means that the first (and only) page has                    
  3801. been completed and sent to the DVI file.  The original input file               
  3802. still needs to be fixed, of course.                                             
  3803.                                                                                 
  3804. \subsection{The misnamed font}                                                  
  3805.                                                                                 
  3806. A misspelled font name is an error similar to the misspelled                    
  3807. control sequence.  The error message is different and a little                  
  3808. confusing at first. Suppose for example the following appears in                
  3809. your input file:                                                                
  3810.                                                                                 
  3811. \leftline{\tt \\font\\sf = cmss01}                                              
  3812.                                                                                 
  3813. It should be {\tt cmss10}, that is, the numbers have been                       
  3814. transposed.  Here are the error and help messages:                              
  3815.                                                                                 
  3816. \beginuser \obeyspaces                                                          
  3817. ! Font \\sf=cmss01 not loadable: Metric (TFM) file not found.                   
  3818. <to be read again>                                                              
  3819. \                   \\par                                                       
  3820. \\bye ->\\par                                                                   
  3821. \            \\vfill \\supereject \\end                                         
  3822. l.2 \\bye                                                                       
  3823.                                                                                 
  3824. ? h                                                                             
  3825. I wasn't able to read the size data for this font,                              
  3826. so I will ignore the font specification.                                        
  3827. [Wizards can fix TFM files using TFtoPL/PLtoTF.]                                
  3828. You might try inserting a different font spec;                                  
  3829. e.g., type `I\\font<same font id>=<substitute font name>'.                      
  3830. \enduser                                                                        
  3831.                                                                                 
  3832. The TFM (\TeX{} font metric) file is an auxiliary file that is                  
  3833. used by \TeX\null. So this strange message is just telling you                  
  3834. that the font you defined doesn't exist on your computer system.                
  3835.                                                                                 
  3836. \subsection{Mismatched mathematics}                                             
  3837.                                                                                 
  3838. Another common error is to use {\tt \$} or {\tt \$\$} to start a                
  3839. mathematical expression and then forget to use the second {\tt \$}              
  3840. or {\tt \$\$} when finished.  The text that follows is then                     
  3841. treated as mathematics, and to make matters worse, if more                      
  3842. mathematics is started by a new {\tt \$} or {\tt \$\$}, it will                 
  3843. then be treated as ordinary text.  Needless to say, error                       
  3844. messages galore may be generated. \TeX{} will attempt to correct                
  3845. the problem by inserting a new {\tt \$} or {\tt \$\$}; in any                   
  3846. case, the problem is corrected by the end of the paragraph since                
  3847. a new paragraph will automatically start as ordinary text.                      
  3848.                                                                                 
  3849. Consider the following correct input and its output:                            
  3850. \beginuser                                                                      
  3851. Since \$f(x) > 0\$, \$a<b\$,  and \$f(x)\$ is continuous, we know that          
  3852. \$\\int\_{}a\~{}b f(x)\\,dx >0\$.                                               
  3853. \enduser                                                                        
  3854.                                                                                 
  3855. Since $f(x) > 0$, $a<b$,  and $f(x)$ is continuous, we know that                
  3856. $\int_a~b f(x)\,dx >0$.                                                         
  3857.                                                                                 
  3858. If we now leave out the second dollar sign in {\tt \$f(x)\$} we                 
  3859. then get the following error and help messages:                                 
  3860.                                                                                 
  3861. \beginuser \obeyspaces                                                          
  3862. ! Missing \$ inserted.                                                          
  3863. <inserted text>                                                                 
  3864. \               \$                                                              
  3865. <to be read again>                                                              
  3866. \                  \\intop                                                      
  3867. \\int ->\\intop                                                                 
  3868. \             \\nolimits                                                        
  3869. l.2 \$\\int                                                                     
  3870. \          \_{}a\~{}b f(x)\\,dx >0\$.                                           
  3871. ? h                                                                             
  3872. I've inserted a begin-math/end-math symbol since I think                        
  3873. you left one out. Proceed, with fingers crossed.                                
  3874.                                                                                 
  3875. ?                                                                               
  3876. \enduser                                                                        
  3877.                                                                                 
  3878. The line starting with {\tt !} tells us what has been done. The                 
  3879. line starting with {\tt l.2} shows us where we were in the input                
  3880. file when the error occurred.  As in our other examples, the part               
  3881. of the line successfully read, that is, through {\tt \\int},                    
  3882. appears on one line, and the continuation appears on the next                   
  3883. line. The remaining material may seem somewhat obscure.  These                  
  3884. intermediate messages show what was happening further in the guts               
  3885. of the \TeX{} program when the error occurred.  The newer user                  
  3886. may ignore them.                                                                
  3887.                                                                                 
  3888. Here is what you get as output after \TeX{} tries to recover from               
  3889. the error.                                                                      
  3890.                                                                                 
  3891. Since $f(x) > 0$, $a<b$,  and $f(x) is continuous, we know that                 
  3892. \int_a~b f(x)\,dx >0$.                                                          
  3893.                                                                                 
  3894. There is a stretch of text that is italic with no spacing.  This                
  3895. is typical for normal text being processed as mathematics; if you               
  3896. see this in your output, you have almost certainly left out a                   
  3897. {\tt \$} or {\tt \$\$}.                                                         
  3898.                                                                                 
  3899. \subsection{Mismatched braces}                                                  
  3900.                                                                                 
  3901. It's easy to forget or mismatch the closing braces when making                  
  3902. groups.  The result may be a relatively benign error, or it may                 
  3903. be catastrophic. Suppose, for example, you have {\tt \lb\\bf A                  
  3904. bold title } in your text with the closing right brace omitted.                 
  3905. The result will be the same as if no opening brace were there;                  
  3906. that is, the rest of the paper will be boldface if no other font                
  3907. changes are made.  You will get the following message at the end                
  3908. of the file:                                                                    
  3909.                                                                                 
  3910. {\tt (\\end occurred inside a group at level 1)}                                
  3911.                                                                                 
  3912. If you had made the same mistake twice, then there would be two                 
  3913. more opening braces than closing braces, and you would get the                  
  3914. message:                                                                        
  3915.                                                                                 
  3916. {\tt (\\end occurred inside a group at level 2)}                                
  3917.                                                                                 
  3918. \TeX{} doesn't know that the closing brace is missing until it                  
  3919. reaches the end of the input file.  Hence the message doesn't                   
  3920. tell you where you went wrong.  If the location of the missing                  
  3921. brace isn't obvious, it's always possible to insert {\tt \\bye}                 
  3922. halfway through your document.  Running \TeX{} again will cause                 
  3923. only the first half to be processed, and if the error message                   
  3924. persists, you will know that the error is in the first half of                  
  3925. the document.  By moving the {\tt \\bye} to different places, the               
  3926. error can be localized.  Also, looking at the output often                      
  3927. reveals what has gone wrong.                                                    
  3928.                                                                                 
  3929. Missing opening braces are much easier to spot.  Here is a two                  
  3930. line input file and the resulting error and help messages:                      
  3931.                                                                                 
  3932. \beginuser                                                                      
  3933. \\bf Here is the start\rb, but there is the finish.                             
  3934. \\bye                                                                           
  3935. \enduser                                                                        
  3936.                                                                                 
  3937. \beginuser \obeyspaces                                                          
  3938. ! Too many \rb's.                                                               
  3939. l.1 \\bf Here is the start\rb                                                   
  3940. \                          , but there is the finish.                           
  3941.                                                                                 
  3942. ? h                                                                             
  3943. You've closed more groups than you opened.                                      
  3944. Such booboos are generally harmless, so keep going.                             
  3945. \enduser                                                                        
  3946.                                                                                 
  3947. It's quite possible, of course, that line that is supposed to                   
  3948. have the missing left brace will not be on the line where \TeX{}                
  3949. catches the error.                                                              
  3950.                                                                                 
  3951. A mismatched brace in the definition of a new control sequence                  
  3952. can cause a major error.  Since such a definition may include                   
  3953. several paragraphs, it may not be caught by the end of a                        
  3954. paragraph, but, rather will just keep piling more and more text                 
  3955. into the unfinished definition.  It's even possible for \TeX{} to               
  3956. run out of memory as it keeps eating up more text! This is called               
  3957. a ``runaway definition''.                                                       
  3958. \TeXref{206}                                                                    
  3959. Here is a two line input file with a runaway definition:                        
  3960.                                                                                 
  3961. \beginuser                                                                      
  3962. \\def\\newword\lb the def                                                       
  3963. \\newword                                                                       
  3964. \\bye                                                                           
  3965. \enduser                                                                        
  3966.                                                                                 
  3967. Here are the resulting error and help messages:                                 
  3968.                                                                                 
  3969. \beginuser \obeyspaces                                                          
  3970. Runaway definition?                                                             
  3971. ->the def                                                                       
  3972. ! Forbidden control sequence found while scanning definition of \\newword.      
  3973. <inserted text>                                                                 
  3974. \                \rb                                                            
  3975. <to be read again>                                                              
  3976. \                   \\bye                                                       
  3977. l.3 \\bye                                                                       
  3978.                                                                                 
  3979. ? h                                                                             
  3980. I suspect you have forgotten a `\rb', causing me                                
  3981. to read past where you wanted me to stop.                                       
  3982. I'll try to recover; but if the error is serious,                               
  3983. you'd better type `E' or `X' now and fix your file.                             
  3984.                                                                                 
  3985. ?                                                                               
  3986. No pages of output.                                                             
  3987. \enduser                                                                        
  3988.                                                                                 
  3989. This is obviously a serious error.  If it occurs at the beginning               
  3990. of a file (as in the previous example), there will be no output                 
  3991. at all!                                                                         
  3992.                                                                                 
  3993. If a closing brace is left out while using a macro with                         
  3994. parameters, the runaway definition will be terminated at the end                
  3995. of the paragraph. So if {\tt \\def\\newword\#1\lb$\ldots$\rb} has               
  3996. been defined and you use {\tt \\newword\lb$\dots$ } without the                 
  3997. closing brace, then at most one paragraph will be ruined.                       
  3998. \TeXref{205}                                                                    
  3999.                                                                                 
  4000. In short, when an error occurs, make a note of the line number to               
  4001. see how much of the input file has been read, and also the line                 
  4002. starting with an exclamation point to get a short description of                
  4003. the error. If the error is still not clear, ask \TeX{} for more                 
  4004. information by typing {\tt h<CR>}. For small errors, \TeX{} can                 
  4005. carry on quite a way if you just keep hitting the {\tt <CR>}.                   
  4006.                                                                                 
  4007.                                                                                 
  4008.                                                                                 
  4009.                                                                                 
  4010. \section{Digging a little deeper}                                               
  4011.                                                                                 
  4012. In this section we look at a few topics that allow \TeX{} to be                 
  4013. used with greater flexibility or efficiency.  As the documents                  
  4014. being produced get longer, different techniques can help make                   
  4015. their creation easier.                                                          
  4016.                                                                                 
  4017. \subsection{Big files, little files}                                            
  4018.                                                                                 
  4019. \TeX{} can read and write files as it runs.  This makes it                      
  4020. possible to use files that are smaller and more convenient to                   
  4021. handle by creating a master file that reads the smaller files in                
  4022. the proper order. This document, for example, consists of ten                   
  4023. sections plus an introduction.  In addition, there are macros                   
  4024. that are used for all sections. The macros can be put in a file                 
  4025. called, say, {\tt macros.tex}, the introduction can be put in {\tt              
  4026. intro.tex}, and each section put in its own file.  The control                  
  4027. word {\tt \\input} is then used to read in a file.  In general,                 
  4028. {\tt \\input filename} will cause the file called {\tt                          
  4029. filename.tex} to be read in and processed immediately, just as if               
  4030. the text of {\tt filename.tex} had been part of the file that                   
  4031. read it in.  This file may input other files. In fact it's often                
  4032. convenient to make a single file that reads in smaller pieces,                  
  4033. perhaps as follows:                                                             
  4034. \toindex{input}                                                                 
  4035.                                                                                 
  4036. \beginuser                                                                      
  4037. \\input macros                                                                  
  4038. \\input intro                                                                   
  4039. \\input sec1                                                                    
  4040. \\input sec2                                                                    
  4041. \\input sec3                                                                    
  4042. \\input sec4                                                                    
  4043. \\input sec5                                                                    
  4044. \\input sec6                                                                    
  4045. \\input sec7                                                                    
  4046. \\input sec8                                                                    
  4047. \\input sec9                                                                    
  4048. \\input sec10                                                                   
  4049. \enduser                                                                        
  4050.                                                                                 
  4051. While the text is still being heavily edited, it's possible to                  
  4052. process only some of the files by putting a {\tt \%} at the                     
  4053. beginning of each line that contains a file to be skipped (this                 
  4054. is sometimes called ``commenting out'' the unwanted files).                     
  4055.                                                                                 
  4056. The {\tt \\input} control word also allows the use of                           
  4057. predesigned macros.  The macros for a memorandum, for example,                  
  4058. might be put in a file called {\tt memo.tex}.  These macros might               
  4059. set up the right {\tt \\hsize}, {\tt \\vsize} and other                         
  4060. parameters, and might stamp the time and date.  Once this has                   
  4061. been set up, all memoranda may be started with {\tt \\input memo}               
  4062. to make them come out with a common format.                                     
  4063.                                                                                 
  4064. \exercise Make a \TeX{} input file that reads in a second file.                 
  4065. Try reading in the second file twice using the {\tt \\input}                    
  4066. control word twice.                                                             
  4067.                                                                                 
  4068. \subsection{Larger macro packages}                                              
  4069.                                                                                 
  4070. Designing macros that can be used with many types of documents                  
  4071. is obviously useful.  Most universities, for example, have                      
  4072. specific and often complicated format requirements for theses.  A               
  4073. collection of macros, that is, a macro package that meets all                   
  4074. these specifications could be somewhat time consuming to design                 
  4075. and could be quite long.  It is possible to use the {\tt \\input}               
  4076. command to use such a macro package, just as it is possible to                  
  4077. use it with your own macros.  But \TeX{} has a better facility                  
  4078. for larger packages.                                                            
  4079.                                                                                 
  4080. A macro package can be put in a special form that can be quickly                
  4081. read by \TeX\null.  These are called {\sl format files}, and                    
  4082. their exact form is of technical interest only.  The important                  
  4083. thing is that they allow \TeX{} to be run with many new control                 
  4084. sequences predefined. Certain commands called {\sl primitives\/}                
  4085. are part of the definition of \TeX\null.                                        
  4086.                                                                                 
  4087. What we have described in this manual is sometimes called {\sl                  
  4088. plain \TeX\/}, and consists of the \TeX{} primitives plus a set                 
  4089. of macros in a format file (that is usually included in \TeX{}                  
  4090. automatically) called {\tt plain.fmt}. For the curious, any                     
  4091. control word can be viewed using {\tt \\show}.  The command {\tt                
  4092. \\show\\centerline} will display                                                
  4093. \beginliteral                                                                   
  4094. > \centerline=macro:                                                            
  4095. #1->\line {\hss #1\hss }.                                                       
  4096. @endliteral                                                                     
  4097. \noindent                                                                       
  4098. on the screen and in the log file. You can use {\tt \\show} with                
  4099. your own macros, too.  If you end up using several macro                        
  4100. packages, you can use the {\tt \\show} command to see if a                      
  4101. particular macro is defined.                                                    
  4102.                                                                                 
  4103. Many computer \centre{}s have the \LaTeX{} macro package.  This                 
  4104. package allows the user to create an index, a table of contents,                
  4105. and a bibliography automatically.  It also has the ability to                   
  4106. insert some elementary graphic figures such as circles, ovals,                  
  4107. lines, and arrows. \LaTeX{} also uses style files to set up                     
  4108. specific page parameters. Many different style files are                        
  4109. available; some journals will accept papers on a magnetic medium                
  4110. for direct processing if they are prepared using \LaTeX{} and a                 
  4111. designated style file. It is not difficult to shift from \TeX{}                 
  4112. to \LaTeX\null. A user's guide by the author of the macro                       
  4113. package, Leslie Lamport, is available:                                          
  4114. {\bf \LaTeX{}: A document preparation system}%                                  
  4115. \footnote{${}~1$}{Addison-Wesley Reading, Massachusetts, 1986,                  
  4116. ISBN 0-201-15790-X.}.                                                           
  4117.                                                                                 
  4118. The American Mathematical Society uses the \AMSTeX{} macro                      
  4119. package for its journals.  It is readily available from that                    
  4120. Society, and papers may be submitted to their journals on a                     
  4121. magnetic medium using \AMSTeX\null.  A manual by Michael                        
  4122. Spivak, {\bf The Joy of \TeX{}}, is available from the American                 
  4123. Mathematical Society.                                                           
  4124.                                                                                 
  4125. Other macro packages exist, and undoubtedly more will be                        
  4126. developed. They are usually of modest cost and can be very                      
  4127. effective in some circumstances.  The \TeX{} Users Group                        
  4128. announces the existence of new macro packages in its                            
  4129. publications.                                                                   
  4130.                                                                                 
  4131. \subsection{Horizontal and vertical lines}                                      
  4132.                                                                                 
  4133. Making horizontal and vertical lines is easy using \TeX\null.                   
  4134. When typing in text, {\tt \\hrule } will cause the current                      
  4135. paragraph to end, will draw a horizontal line whose width is the                
  4136. current hsize, and then will continue on with a new paragraph.                  
  4137. It's possible to specify the width of the hrule as, for example,                
  4138. with {\tt \\hrule width 5 cm}; also you can use {\tt \\vskip} or                
  4139. {\tt \\bigskip} to put some space above or below the hrule.  Here               
  4140. is an example:                                                                  
  4141.                                                                                 
  4142. \beginuser                                                                      
  4143. \\parindent = 0 pt \\parskip = 12 pt                                            
  4144. Here is the text before the hrule.                                              
  4145. \\bigskip                                                                       
  4146. \\hrule width 3 in                                                              
  4147. And here is some text after the hrule.                                          
  4148. \enduser                                                                        
  4149.                                                                                 
  4150. \noindent that produces                                                         
  4151.                                                                                 
  4152. {                                                                               
  4153. \parindent = 0 pt                                                               
  4154. Here is the text before the hrule.                                              
  4155. \bigskip                                                                        
  4156. \hrule width 3 in                                                               
  4157. And here is some text after the hrule.                                          
  4158. }                                                                               
  4159.                                                                                 
  4160. In fact this hrule not only has width of three inches, but also                 
  4161. by default has a height (the amount by which the hrule extends                  
  4162. above the baseline on which the type is being set) of 0.4 points                
  4163. and a depth (the amount by which the hrule extends below the                    
  4164. baseline on which the type is being set) of 0 points.  Each of                  
  4165. these parameters can be individually set.  Thus if we change the                
  4166. last example to say                                                             
  4167.                                                                                 
  4168. {\tt \\hrule width 3 in height 2 pt depth 3 pt } we get                         
  4169.                                                                                 
  4170. {                                                                               
  4171. \parindent = 0 pt                                                               
  4172. Here is the text before the hrule.                                              
  4173. \bigskip                                                                        
  4174. \hrule width 3 in height 2 pt depth 3 pt                                        
  4175. And here is some text after the hrule.                                          
  4176. }                                                                               
  4177.                                                                                 
  4178. The three parameters {\tt width}, {\tt height}, and {\tt depth} may             
  4179. be given in any order.                                                          
  4180. \toindex{hrule}                                                                 
  4181. \TeXref{221--222}                                                               
  4182.                                                                                 
  4183. A vrule may be defined analogously to an hrule by specifying the                
  4184. {\tt width}, {\tt height}, and {\tt depth} if desired.                          
  4185. \TeXref{221--222}                                                               
  4186. But, unlike the hrule, the vrule will not automatically start a                 
  4187. new paragraph when it appears.  By default the vrule will be 0.4                
  4188. points wide, and will be as high as the line on which it is being               
  4189. set. Hence                                                                      
  4190.                                                                                 
  4191. \toindex{vrule}                                                                 
  4192.                                                                                 
  4193. \beginuser                                                                      
  4194. Here is some text before the vrule                                              
  4195. \\vrule\\                                                                       
  4196. and this follows the vrule.                                                     
  4197. \enduser                                                                        
  4198.                                                                                 
  4199. \noindent will give                                                             
  4200.                                                                                 
  4201. Here is some text before the vrule                                              
  4202. \vrule\                                                                         
  4203. and this follows the vrule.                                                     
  4204.                                                                                 
  4205. \exercise Make three horizontal lines that are 15 points apart,                 
  4206. 3 inches in length, and one inch in from the left margin.                       
  4207.                                                                                 
  4208. Although we usually think of hrules and vrules as horizontal and                
  4209. vertical lines, they need not necessarily be used that way.  For                
  4210. example:                                                                        
  4211.                                                                                 
  4212. \beginuser                                                                      
  4213. \\noindent                                                                      
  4214. Name: \\vrule height 0 pt depth 0.4 pt width 3 in                               
  4215. \enduser                                                                        
  4216.                                                                                 
  4217. \noindent will give                                                             
  4218.                                                                                 
  4219. \noindent                                                                       
  4220. Name: \vrule height 0 pt depth 0.4 pt width 3 in                                
  4221.                                                                                 
  4222. \exercise Make the following grid (each box is 1 \centimetre{} square):         
  4223. \medskip                                                                        
  4224. \settabs \+ \hskip 1cm&\hskip 1 cm&\hskip 1 cm& \cr                             
  4225. \moveright 2 in                                                                 
  4226. \vbox{                                                                          
  4227. \hrule width 3 cm                                                               
  4228. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm                
  4229.   & \vrule height 1 cm \cr                                                      
  4230. \hrule width 3 cm                                                               
  4231. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm                
  4232.   & \vrule height 1 cm \cr                                                      
  4233. \hrule width 3 cm                                                               
  4234. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm                
  4235.   & \vrule height 1 cm \cr                                                      
  4236. \hrule width 3 cm                                                               
  4237. }                                                                               
  4238.                                                                                 
  4239.                                                                                 
  4240. \subsection{Boxes within boxes}                                                 
  4241.                                                                                 
  4242. We have already seen (in our discussion of line shapes) that                    
  4243. vboxes and hboxes are objects that may be overfull or underfull.                
  4244. In this section we will look at these boxes in a bit more detail.               
  4245. They may be stacked or lined up to allow a variety of positions                 
  4246. for text on the page.                                                           
  4247.                                                                                 
  4248. An hbox is formed by using {\tt \\hbox\lb $\ldots$\rb}\null.                    
  4249. Once the material between the braces has been put into an hbox,                 
  4250. it is set and can not be further split (this means that material                
  4251. that must go on one line can be put into an hbox, and it will                   
  4252. then remain as one unit).  It's possible to specify the size of                 
  4253. an hbox.\TeXref{64--66} Thus {\tt \\hbox to 5 cm\lb contents of                 
  4254. the box\rb } will produce an hbox exactly five \centimetre{}s                   
  4255. wide containing the typeset text ``contents of the box''.                       
  4256. It's easy to get an underfull or overfull box in this way. An                   
  4257. underfull box can be avoided by using {\tt \\hfil} to absorb the                
  4258. extra space. When no dimension is given, an hbox is formed that                 
  4259. is just wide enough to hold the enclosed text.                                  
  4260. \toindex{hbox}                                                                  
  4261.                                                                                 
  4262. Similarly, vboxes are formed using {\tt \\vbox\lb $\ldots$\rb}.                 
  4263. What makes these boxes interesting is that when a vbox contains                 
  4264. hboxes, these hboxes are stacked one above the other and set as a               
  4265. unit. Similarly, an hbox can contain vboxes, which will be set in               
  4266. a row. Suppose we take three hboxes and put them in a vbox:                     
  4267. \toindex{vbox}                                                                  
  4268.                                                                                 
  4269. \beginuser \obeyspaces                                                          
  4270. \\vbox\lb                                                                       
  4271. \      \\hbox\lb{}Contents of box 1\rb                                          
  4272. \      \\hbox\lb{}Contents of box 2\rb                                          
  4273. \      \\hbox\lb{}Contents of box 3\rb                                          
  4274. \      \rb                                                                      
  4275. \enduser                                                                        
  4276.                                                                                 
  4277. \noindent gives                                                                 
  4278. \vskip \baselineskip                                                            
  4279. \vbox{                                                                          
  4280.       \hbox{Contents of box 1}                                                  
  4281.       \hbox{Contents of box 2}                                                  
  4282.       \hbox{Contents of box 3}                                                  
  4283.       }                                                                         
  4284.                                                                                 
  4285. Now suppose we take another vbox:                                               
  4286.                                                                                 
  4287. \beginuser \obeyspaces                                                          
  4288. \\vbox\lb                                                                       
  4289. \      \\hbox\lb{}Contents of box 4\rb                                          
  4290. \      \\hbox\lb{}Contents of box 5\rb                                          
  4291. \      \rb                                                                      
  4292. \enduser                                                                        
  4293.                                                                                 
  4294. These two vboxes can be put into an hbox; this will cause them to               
  4295. be placed side by side. In other words                                          
  4296.                                                                                 
  4297. \beginuser \obeyspaces                                                          
  4298. \\hbox\lb                                                                       
  4299. \     \\vbox\lb                                                                 
  4300. \           \\hbox\lb{}Contents of box 1\rb                                     
  4301. \           \\hbox\lb{}Contents of box 2\rb                                     
  4302. \           \\hbox\lb{}Contents of box 3\rb                                     
  4303. \           \rb                                                                 
  4304. \     \\vbox\lb                                                                 
  4305. \           \\hbox\lb{}Contents of box 4\rb                                     
  4306. \           \\hbox\lb{}Contents of box 5\rb                                     
  4307. \           \rb                                                                 
  4308. \     \rb                                                                       
  4309. \enduser                                                                        
  4310.                                                                                 
  4311. \noindent gives                                                                 
  4312. \vskip \baselineskip                                                            
  4313. \hbox{                                                                          
  4314.      \vbox{                                                                     
  4315.            \hbox{Contents of box 1}                                             
  4316.            \hbox{Contents of box 2}                                             
  4317.            \hbox{Contents of box 3}                                             
  4318.            }                                                                    
  4319.      \vbox{                                                                     
  4320.            \hbox{Contents of box 4}                                             
  4321.            \hbox{Contents of box 5}                                             
  4322.           }                                                                     
  4323.      }                                                                          
  4324.                                                                                 
  4325.                                                                                 
  4326. Notice that the two vboxes are aligned so that the bottoms are                  
  4327. level; also there is a little space between the vboxes.                         
  4328. Actually, the reason the space appears is rather subtle.                        
  4329. Unless a line ends in a control word, there is always a space                   
  4330. between the last entry in one line and the first one in the next                
  4331. line. For this reason the space comes from the end of the line                  
  4332. containing the closing brace of the first vbox.  This space can                 
  4333. be avoided by ``commenting out'' the end of the line, that is, by               
  4334. putting a {\tt \%} immediately after the closing brace of the                   
  4335. first vbox. If you try to put some vboxes together and accidently               
  4336. get extra space by forgetting to comment out the end of the line,               
  4337. you're in good company.  Some very able and experienced \TeX{}                  
  4338. users have done the same thing!                                                 
  4339.                                                                                 
  4340. Extra space, say one \centimetre,  can be added by putting an                   
  4341. {\tt \\hskip 1 cm } between the vboxes.  They can be aligned so                 
  4342. that the tops are level by using {\tt \\vtop } instead of                       
  4343. {\tt \\vbox}.  Making these two changes results in:                             
  4344.                                                                                 
  4345. \toindex{vtop}                                                                  
  4346. \vskip \baselineskip                                                            
  4347. \hbox{                                                                          
  4348.      \vtop{                                                                     
  4349.            \hbox{Contents of box 1}                                             
  4350.            \hbox{Contents of box 2}                                             
  4351.            \hbox{Contents of box 3}                                             
  4352.            }                                                                    
  4353.      \hskip 1 cm                                                                
  4354.      \vtop{                                                                     
  4355.            \hbox{Contents of box 4}                                             
  4356.            \hbox{Contents of box 5}                                             
  4357.           }                                                                     
  4358.      }                                                                          
  4359.                                                                                 
  4360.                                                                                 
  4361. We can combine vboxes, hboxes, vrules, and hrules to get boxed                  
  4362. text.  How might we construct such a box? One way is to take the                
  4363. material to be boxed and put it in an hbox preceded and followed                
  4364. by a vrule.  Then put this in a vbox with hrules above and below                
  4365. it. This gives us:                                                              
  4366.                                                                                 
  4367. \beginuser \obeyspaces                                                          
  4368. \\vbox\lb                                                                       
  4369. \      \\hrule                                                                  
  4370. \      \\hbox\lb\\vrule{} The text to be boxed \\vrule\rb                       
  4371. \      \\hrule                                                                  
  4372. \     \rb                                                                       
  4373. \enduser                                                                        
  4374.                                                                                 
  4375. \noindent which results in                                                      
  4376. \vskip \baselineskip                                                            
  4377. \vbox{                                                                          
  4378.       \hrule                                                                    
  4379.       \hbox{\vrule{} The text to be boxed \vrule}                               
  4380.       \hrule                                                                    
  4381.      }                                                                          
  4382.                                                                                 
  4383. This produces boxed material, but there is no margin around it                  
  4384. and so it looks very cramped (of course \TeX{} is just giving us                
  4385. what we asked for).  We can improve the spacing by putting a {\tt               
  4386. \\strut} at the beginning of the hbox to make it a little taller                
  4387. and deeper.  This gives us:                                                     
  4388. \vskip \baselineskip                                                            
  4389. \vbox{                                                                          
  4390.       \hrule                                                                    
  4391.       \hbox{\strut \vrule{} The text to be boxed \vrule}                        
  4392.       \hrule                                                                    
  4393.      }                                                                          
  4394.                                                                                 
  4395. \def\boxtext#1{%                                                                
  4396. \vbox{%                                                                         
  4397.       \hrule                                                                    
  4398.       \hbox{\strut \vrule{} #1 \vrule}%                                         
  4399.       \hrule                                                                    
  4400.      }%                                                                         
  4401. }                                                                               
  4402.                                                                                 
  4403. \exercise Use the method of boxing material to put text \centred{}              
  4404. in a box which extends from the left to the right margin.                       
  4405.                                                                                 
  4406. \exercise Make the following magic square:                                      
  4407. \vskip\baselineskip                                                             
  4408.                                                                                 
  4409. \moveright 2 in \vbox{\offinterlineskip                                         
  4410. \hbox{\boxtext 6\boxtext 1\boxtext 8}                                           
  4411. \hbox{\boxtext 7\boxtext 5\boxtext 3}                                           
  4412. \hbox{\boxtext 2\boxtext 9\boxtext 4}                                           
  4413. }                                                                               
  4414.                                                                                 
  4415. \def\boxtext#1 {%                                                               
  4416. \vbox{%                                                                         
  4417.       \hrule                                                                    
  4418.       \hbox{\strut \vrule #1\vrule}%                                            
  4419.       \hrule                                                                    
  4420.      }                                                                          
  4421. }                                                                               
  4422.                                                                                 
  4423. \exercise Write a macro { \tt \\boxtext\#1\lb$\ldots$\rb } which                
  4424. will take the text between the braces and put a box around it.  Test            
  4425. your macro by making up a sentence with every other word boxed.                 
  4426. I'm \boxtext not quite \boxtext sure why \boxtext someone                       
  4427. would \boxtext do this \boxtext since the \boxtext result is \boxtext           
  4428. pretty strange. Note how the baseline and the bottom of                         
  4429. the surrounding boxes align.                                                    
  4430.                                                                                 
  4431. \def\boxtext#1 {%                                                               
  4432. \lower 3.5pt \hbox{%                                                            
  4433.     \vbox{%                                                                     
  4434.          \hrule                                                                 
  4435.          \hbox{\strut \vrule #1\vrule}%                                         
  4436.          \hrule                                                                 
  4437.         }                                                                       
  4438.     }                                                                           
  4439. }                                                                               
  4440.                                                                                 
  4441. It's easy to move boxes up, down, left, or right on the page. A                 
  4442. {\tt \\vbox} can be moved to the right one inch by using {\tt                   
  4443. \\moveright 1 in \\vbox\lb\dots\rb}.  To move it to the left,                   
  4444. use {\tt \\moveleft}.  Similarly, an {\tt hbox} can be moved up                 
  4445. or down using {\tt \\raise} or {\tt \\lower}.                                   
  4446. \toindex{moveright}                                                             
  4447. \toindex{moveleft}                                                              
  4448. \toindex{raise}                                                                 
  4449. \toindex{lower}                                                                 
  4450.                                                                                 
  4451. \exercise Rewrite the {\tt \\boxtext} macro from the previous                   
  4452. exercise so that all of the text is aligned (by default the                     
  4453. depth of a strut is 3.5 points).  This would give a sentence like               
  4454. the following: I'm \boxtext not quite \boxtext sure why \boxtext                
  4455. someone would \boxtext do this \boxtext since the \boxtext result               
  4456. is \boxtext pretty strange.                                                     
  4457.                                                                                 
  4458. It's possible to fill a box with either an hrule or with dots.                  
  4459. The idea is to use {\tt \\hrulefill } or {\tt \\dotfill } in the                
  4460. hbox.                                                                           
  4461.                                                                                 
  4462. \beginuser                                                                      
  4463. \\hbox to 5 in\lb Getting Started\\hrulefill 1\rb                               
  4464. \\hbox to 5 in\lb All Characters Great and Small\\hrulefill 9\rb                
  4465. \\hbox to 5 in\lb The Shape of Things to come\\hrulefill 17\rb                  
  4466. \\hbox to 5 in\lb No Math Anxiety Here!\\hrulefill 30\rb                        
  4467. \enduser                                                                        
  4468.                                                                                 
  4469. \noindent gives                                                                 
  4470. \vskip \baselineskip                                                            
  4471.                                                                                 
  4472. \hbox to 5 in{Getting Started\hrulefill 1}                                      
  4473. \hbox to 5 in{All Characters Great and Small\hrulefill 9}                       
  4474. \hbox to 5 in{The Shape of Things to come\hrulefill 17}                         
  4475. \hbox to 5 in{No Math Anxiety Here!\hrulefill 30}                               
  4476.                                                                                 
  4477. If {\tt \\hrulefill} is replaced by {\tt \\dotfill} we get                      
  4478. \vskip \baselineskip                                                            
  4479.                                                                                 
  4480. \hbox to 5 in{Getting Started\dotfill 1}                                        
  4481. \hbox to 5 in{All Characters Great and Small\dotfill 9}                         
  4482. \hbox to 5 in{The Shape of Things to come\dotfill 17}                           
  4483. \hbox to 5 in{No Math Anxiety Here!\dotfill 30}                                 
  4484.                                                                                 
  4485. \exercise Make a boxed headline appear at the top of the page                   
  4486. that is like the one used in this manual.                                       
  4487.                                                                                 
  4488.                                                                                 
  4489.                                                                                 
  4490. \section{Control word list}                                                     
  4491.                                                                                 
  4492. Here is a list of the control words given in this manual.                       
  4493. If you want more detail about these words than is given here,                   
  4494. check the index of {\bf The \TeX book}.                                         
  4495.                                                                                 
  4496. \vskip 2\baselineskip                                                           
  4497. \centerline{Control symbols}                                                    
  4498. \vskip\baselineskip                                                             
  4499.                                                                                 
  4500. \settabs \+ \hskip 1.5 in & \hskip 1.65in & \hskip 1.3in & \cr                  
  4501. {\tt                                                                            
  4502. \+  \\\sp{} 5 & \\!\ 33  & \\" 11 & \\' 11    \cr                               
  4503. \+  \\, 33    & \\.\ 11  & \\/ 15 & \\; 33    \cr                               
  4504. \+  \\= 11    & \\> 33   & \\\# 10&  \\\$ 7  \cr                                
  4505. \+  \\\% 7    & \\\& 10   & \\\char '173{} 10  & \\\char '175{} 10 \cr          
  4506. \+  \\\underbar{ } 10 & \\` 11 & \\{\accent "7E } 10 & \\{\accent "7E } 10 \cr  
  4507. \+  \\{\accent 94 } 10 & \\! 39 \cr                                             
  4508. }                                                                               
  4509.                                                                                 
  4510. \vskip 2\baselineskip                                                           
  4511. \centerline{Control words}                                                      
  4512. \vskip\baselineskip                                                             
  4513.                                                                                 
  4514. {\tt                                                                            
  4515. \+ \\AA 12 & \\aa 12 & \\acute 35 & \\AE 12 \cr                                 
  4516. \+ \\ae 12 & \\aleph 36 & \\alpha 34 & \\angle 36 \cr                           
  4517. \+ \\approx 36 & \\arccos 40 & \\arcsin 40 & \\arctan 40 \cr                    
  4518. \+ \\arg 40 & \\ast 35 & \\b 11 & \\backslash 36 \cr                            
  4519. \+ \\bar 35 & \\baselineskip 21 & \\beta 34 & \\bf 15 \cr                       
  4520. \+ \\biggl 39 & \\Biggl 39 & \\biggr 39 & \\Biggr 39 \cr                        
  4521. \+ \\bigl 39 & \\Bigl 39 & \\bigr 39 & \\Bigr 39 \cr                            
  4522. \+ \\bigskip 25 & \\break 25 & \\breve 35 & \\bullet 35 \cr                     
  4523. \+ \\bye 5 & \\c 11 & \\cap 35 & \\cdot 35 \cr                                  
  4524. \+ \\centerline 25 & \\centreline 59 & \\check 35 & \\chi 34 \cr                
  4525. \+ \\circ 35 & \\columns 47 & \\cos 40 & \\cosh 40 \cr                          
  4526. \+ \\cot 40 & \\coth 40 & \\csc 40& \\cup 35 \cr                                
  4527. \+ \\d 11 & \\ddag 26 & \\ddot 35 & \\def 54 \cr                                
  4528. \+ \\deg 40 & \\delta 34 & \\Delta 34 & \\det 40 \cr                            
  4529. \+ \\diamond 35 & \\dim 40 & \\div 35 & \\dot 35 \cr                            
  4530. \+ \\dotfill 48 & \\dots 14 & \\downarrow 40 & \\Downarrow 40 \cr               
  4531. \+ \\eject 19 & \\ell 36 & \\endinsert 25 & \\epsilon 34 \cr                    
  4532. \+ \\eqalign 44 & \\eqalignno 45 & \\eqno 45 & \\equiv 36 \cr                   
  4533. \+ \\eta 34 & \\exists 36 & \\exp 40 & \\flat 36 \cr                            
  4534. \+ \\folio 27 & \\font 15 & \\footline 27 & \\footnote 26 \cr                   
  4535. \+ \\forall 36 & \\gamma 34 & \\Gamma 34 & \\gcd 40 \cr                         
  4536. \+ \\geq 36 & \\grave 35 & \\H 11 & \\halign 50 \cr                             
  4537. \+ \\hang 22 & \\hangafter 22 & \\hangindent 22 & \\hat 35 \cr                  
  4538. \+ \\hbaddness 28 & \\hbox 70 & \\headline 27 & \\hfil 26 \cr                   
  4539. \+ \\hfill 25 & \\hfuzz 28 & \\hoffset 19 & \\hom 40 \cr                        
  4540. \+ \\hrule 69 & \\hrulefill 48 & \\hsize 19 & \\hskip 26 \cr                    
  4541. \+ \\hyphenation 28 & \\i 11 & \\Im 36 & \\in 36 \cr                            
  4542. \+ \\inf 40 & \\infty 36 & \\input 66 & \\int 37 \cr                            
  4543. \+ \\iota 34 & \\it 16 & \\item 23 & \\itemitem 23 \cr                          
  4544. \+ \\j 11 & \\kappa 34 & \\ker 40 & \\L 12 \cr                                  
  4545. \+ \\l 12 &  \\lambda 34 & \\Lambda 34 & \\langle 40 \cr                        
  4546. \+ \\lceil 40 &  \\left 43 & \\leftline 25 & \\leftskip 22 \cr                  
  4547. \+ \\leq 36 &  \\leqalignno 45 & \\leqno 45 & \\let 59 \cr                      
  4548. \+ \\lfloor 40 &  \\lg 40 & \\lim 37 & \\liminf 40 \cr                          
  4549. \+ \\limsup 40 &  \\line 25 & \\ln 40 & \\log 40 \cr                            
  4550. \+ \\lower 73 &  \\magnification 20 & \\magstep 15 & \\matrix 43 \cr            
  4551. \+ \\max 40 &  \\medskip 25 & \\min 40 & \\moveleft 73 \cr                      
  4552. \+ \\moveright 73 &  \\mu 34 & \\nabla 36 & \\narrower 22 \cr                   
  4553. \+ \\natural 36 &  \\neg 36 & \\ni 36 & \\noalign 51 \cr                        
  4554. \+ \\noindent 21 &  \\nopagenumbers 6 & \\not 35 & \\nu 34 \cr                  
  4555. \+ \\O 12 &  \\o 12 & \\odot 35 & \\OE 12 \cr                                   
  4556. \+ \\oe 12 &  \\offinterlineskip 52 & \\omega 34 & \\Omega 34 \cr               
  4557. \+ \\ominus 35 &  \\oplus 35 & \\otimes 35 & \\over 36 \cr                      
  4558. \+ \\overfullrule 28 &  \\overline 38 & \\P 26 & \\pageno 27 \cr                
  4559. \+ \\par 8 &  \\parallel 36 & \\parindent 21 & \\parshape 23 \cr                
  4560. \+ \\parskip 21 &  \\partial 36 & \\perp 36 & \\phi 34 \cr                      
  4561. \+ \\Phi 34 &  \\pi 34 & \\Pi 34 & \\pmatrix 42 \cr                             
  4562. \+ \\Pr 40 &  \\proclaim 41 & \\psi 34 & \\Psi 34 \cr                           
  4563. \+ \\qquad 33 &  \\quad 33 & \\raggedright 26 & \\raise 73 \cr                  
  4564. \+ \\rangle 40 &  \\rceil 40 & \\Re 36 & \\rfloor 40 \cr                        
  4565. \+ \\rho 34 &  \\right 43 & \\rightline 26 & \\rightskip 22 \cr                 
  4566. \+ \\rm 15 &  \\root 38 & \\S 26 & \\scaled 15 \cr                              
  4567. \+ \\sec 40 &  \\settabs 47 & \\sharp 36 & \\sigma 34 \cr                       
  4568. \+ \\Sigma 34 &  \\sim 36 & \\simeq 36 & \\sin 40 \cr                           
  4569. \+ \\sinh 40 &  \\sl 15 & \\smallskip 25 & \\sqroot 38 \cr                      
  4570. \+ \\ss 12 &  \\star 35 & \\strut 49 & \\subset 36 \cr                          
  4571. \+ \\subseteq 36 &  \\sum 37 & \\sup 40 & \\supset 36 \cr                       
  4572. \+ \\supseteq 36 &  \\surd 37 & \\t 11 & \\tan 40 \cr                           
  4573. \+ \\tanh 40 &  \\tau 35 & \\tensor 59 & \\TeX{} 5 \cr                          
  4574. \+ \\tensor 59 &  \\the 27 & \\theta 34 & \\Theta 34 \cr                        
  4575. \+ \\tilde 35 &  \\times 35 & \\tolerance 28  & \\topinsert 25 \cr              
  4576. \+ \\tt 15 &  \\u 11 & \\underbar 39 & \\underline 38 \cr                       
  4577. \+ \\uparrow 40 &  \\Uparrow 40 & \\updownarrow 40 & \\Updownarrow 40 \cr       
  4578. \+ \\upsilon 34 &  \\Upsilon 34 & \\v 11 & \\varepsilon 34 \cr                  
  4579. \+ \\varphi 34 &  \\varrho 34 & \\varsigma 34 & \\vartheta 34 \cr               
  4580. \+ \\vbadness 29 &  \\vbox 70 & \\vec 35 & \\vee 35 \cr                         
  4581. \+ \\vfill 19 &  \\vglue 24 & \\voffset 19 & \\vrule 69 \cr                     
  4582. \+ \\vsize 19 & \\vtop 71 &  \\wedge 35 & \\widehat 35 \cr                      
  4583. \+ \\widetilde 35 & \\xi 34 &  \\Xi 34 & \\zeta 34 \cr                          
  4584. }                                                                               
  4585.                                                                                 
  4586. \ifwritinganswers                                                               
  4587.    \let\next=\relax                                                             
  4588. \else                                                                           
  4589.    \let\next=\endinput                                                          
  4590.    \vfill                                                                       
  4591.    \datestamp                                                                   
  4592. \fi                                                                             
  4593.                                                                                 
  4594. \next                                                                           
  4595.                                                                                 
  4596. \def\beginliteral{                                                              
  4597. \vskip\baselineskip                                                             
  4598. \begingroup                                                                     
  4599. \obeylines                                                                      
  4600. \tt                                                                             
  4601. \catcode`\@=0\catcode`\~=12                                                     
  4602. \catcode`\$=12\catcode`\&=12\catcode`\~=12\catcode`\#=12                        
  4603. \catcode`\_=12\catcode`\=12                                                     
  4604. \def\par{\leavevmode\endgraf}                                                   
  4605. \catcode`\{=12\catcode`\}=12\catcode`\%=12                                      
  4606. \catcode`\\=12}                                                                 
  4607. \def\endliteral{\nobreak \vskip 6pt \endgroup}                                  
  4608.                                                                                 
  4609.                                                                                 
  4610. \section{I get by with a little help}                                           
  4611. Many of the exercises can be answered in several ways. If you                   
  4612. like your way better than the way given below, by all means use                 
  4613. it!                                                                             
  4614. \vskip 2\baselineskip                                                           
  4615.                                                                                 
  4616. \parskip=0pt \parindent=0pt                                                     
  4617. \raggedright                                                                    
  4618. \hbadness=10000                                                                 
  4619.                                                                                 
  4620. \hrule                                                                          
  4621. \beginliteral                                                                   
  4622. I like \TeX!                                                                    
  4623. Once you get the hang of it, \TeX\  is really easy to use.                      
  4624. You just have to master the \TeX nical aspects.                                 
  4625. @endliteral                                                                     
  4626. I like \TeX! Once you get the hang of it, \TeX\  is really easy                 
  4627. to use. You just have to master the \TeX nical aspects.                         
  4628. \vskip \baselineskip \hrule                                                     
  4629.                                                                                 
  4630.                                                                                 
  4631. \goodbreak \vskip 2pt \hrule                                                    
  4632. \beginliteral                                                                   
  4633. Does \AE schylus understand \OE dipus?                                          
  4634. @endliteral                                                                     
  4635. Does \AE schylus understand \OE dipus?                                          
  4636. \vskip \baselineskip \hrule                                                     
  4637.                                                                                 
  4638. \goodbreak \vskip 2pt \hrule                                                    
  4639. \beginliteral                                                                   
  4640. The smallest internal unit of \TeX\  is about 53.63\AA.                         
  4641. @endliteral                                                                     
  4642. The smallest internal unit of \TeX\  is about 53.63\AA.                         
  4643. \vskip \baselineskip \hrule                                                     
  4644.                                                                                 
  4645.                                                                                 
  4646. \goodbreak \vskip 2pt \hrule                                                    
  4647. \beginliteral                                                                   
  4648.  They took some honey and plenty of money wrapped up in a {\it \$}5 note.       
  4649. @endliteral                                                                     
  4650.  They took some honey and plenty of money wrapped up in a {\it \$}5 note.       
  4651. \vskip \baselineskip \hrule                                                     
  4652.                                                                                 
  4653.                                                                                 
  4654. \goodbreak \vskip 2pt \hrule                                                    
  4655. \beginliteral                                                                   
  4656.  \'El\`eves, refusez vos le\c cons! Jetez vos cha\~\i nes!                      
  4657. @endliteral                                                                     
  4658.  \'El\`eves, refusez vos le\c cons! Jetez vos cha\~\i nes!                      
  4659. \vskip \baselineskip \hrule                                                     
  4660.                                                                                 
  4661.                                                                                 
  4662. \goodbreak \vskip 2pt \hrule                                                    
  4663. \beginliteral                                                                   
  4664.  Za\v sto tako polako pijete \v caj?                                            
  4665. @endliteral                                                                     
  4666.  Za\v sto tako polako pijete \v caj?                                            
  4667. \vskip \baselineskip \hrule                                                     
  4668.                                                                                 
  4669.                                                                                 
  4670. \goodbreak \vskip 2pt \hrule                                                    
  4671. \beginliteral                                                                   
  4672.  Mein Tee ist hei\ss.                                                           
  4673. @endliteral                                                                     
  4674.  Mein Tee ist hei\ss.                                                           
  4675. \vskip \baselineskip \hrule                                                     
  4676.                                                                                 
  4677.                                                                                 
  4678. \goodbreak \vskip 2pt \hrule                                                    
  4679. \beginliteral                                                                   
  4680.  Peut-\~etre qu'il pr\'ef\`ere le caf\'e glac\'e.                               
  4681. @endliteral                                                                     
  4682.  Peut-\~etre qu'il pr\'ef\`ere le caf\'e glac\'e.                               
  4683. \vskip \baselineskip \hrule                                                     
  4684.                                                                                 
  4685. \goodbreak \vskip 2pt \hrule                                                    
  4686. \vskip\baselineskip                                                             
  4687. \begingroup                                                                     
  4688. \obeylines                                                                      
  4689. \tt                                                                             
  4690. \catcode`\@=0                                                                   
  4691. %%%%%\def\par{\leavevmode\endgraf}                                              
  4692. \catcode`\\=12                                                                  
  4693. {?}`Por qu\'e no bebes vino blanco? {!}`Porque est\'a avinagrado!               
  4694. @endliteral                                                                     
  4695. ?`Por qu\'e no bebes vino blanco? !`Porque est\'a avinagrado!                   
  4696. \vskip \baselineskip \hrule                                                     
  4697.                                                                                 
  4698. \goodbreak \vskip 2pt \hrule                                                    
  4699. \beginliteral                                                                   
  4700.  M\'\i\'\j n idee\"en worden niet be\"\i nvloed.                                
  4701. @endliteral                                                                     
  4702.  M\'\i\'\j n idee\"en worden niet be\"\i nvloed.                                
  4703. \vskip \baselineskip \hrule                                                     
  4704.                                                                                 
  4705.                                                                                 
  4706. \goodbreak \vskip 2pt \hrule                                                    
  4707. \beginliteral                                                                   
  4708.  Can you take a ferry from \"Oland to \AA land?                                 
  4709. @endliteral                                                                     
  4710.  Can you take a ferry from \"Oland to \AA land?                                 
  4711. \vskip \baselineskip \hrule                                                     
  4712.                                                                                 
  4713.                                                                                 
  4714. \goodbreak \vskip 2pt \hrule                                                    
  4715. \beginliteral                                                                   
  4716.  T\"urk\c ce konu\c san ye\u genler nasillar?                                   
  4717. @endliteral                                                                     
  4718.  T\"urk\c ce konu\c san ye\u genler nasillar?                                   
  4719. \vskip \baselineskip \hrule                                                     
  4720.                                                                                 
  4721.                                                                                 
  4722.                                                                                 
  4723.                                                                                 
  4724. \goodbreak \vskip 2pt \hrule                                                    
  4725. \beginliteral                                                                   
  4726.  I entered the room and---horrors---I saw both my father-in-law and my          
  4727. mother-in-law.                                                                  
  4728. @endliteral                                                                     
  4729.  I entered the room and---horrors---I saw both my father-in-law and my          
  4730. mother-in-law.                                                                  
  4731. \vskip \baselineskip \hrule                                                     
  4732.                                                                                 
  4733.                                                                                 
  4734. \goodbreak \vskip 2pt \hrule                                                    
  4735. \beginliteral                                                                   
  4736. The winter of 1484--1485 was one of discontent.                                 
  4737. @endliteral                                                                     
  4738. The winter of 1484--1485 was one of discontent.                                 
  4739. \vskip \baselineskip \hrule                                                     
  4740.                                                                                 
  4741.                                                                                 
  4742. \goodbreak \vskip 2pt \hrule                                                    
  4743. \beginliteral                                                                   
  4744. His ``thoughtfulness'' was impressive.                                          
  4745. @endliteral                                                                     
  4746. His ``thoughtfulness'' was impressive.                                          
  4747. \vskip \baselineskip \hrule                                                     
  4748.                                                                                 
  4749.                                                                                 
  4750. \goodbreak \vskip 2pt \hrule                                                    
  4751. \beginliteral                                                                   
  4752.  Frank wondered, ``Is this a girl that can't say `No!'?''                       
  4753. @endliteral                                                                     
  4754.  Frank wondered, ``Is this a girl that can't say `No!'?''                       
  4755. \vskip \baselineskip \hrule                                                     
  4756.                                                                                 
  4757.                                                                                 
  4758. \goodbreak \vskip 2pt \hrule                                                    
  4759. \beginliteral                                                                   
  4760.  He thought, ``\dots and this goes on forever, perhaps to the last recorded     
  4761. syllable.''                                                                     
  4762. @endliteral                                                                     
  4763.  He thought, ``\dots and this goes on forever, perhaps to the last recorded     
  4764. syllable.''                                                                     
  4765. \vskip \baselineskip \hrule                                                     
  4766.                                                                                 
  4767.                                                                                 
  4768. \goodbreak \vskip 2pt \hrule                                                    
  4769. \beginliteral                                                                   
  4770.  Have you seen Ms.~Jones?                                                       
  4771. @endliteral                                                                     
  4772.  Have you seen Ms.~Jones?                                                       
  4773. \vskip \baselineskip \hrule                                                     
  4774.                                                                                 
  4775.                                                                                 
  4776. \goodbreak \vskip 2pt \hrule                                                    
  4777. \beginliteral                                                                   
  4778. Prof.~Smith and Dr.~Gold flew from                                              
  4779. Halifax N.~S. to Montr\'eal, P.~Q. via Moncton, N.~B.                           
  4780. @endliteral                                                                     
  4781. Prof.~Smith and Dr.~Gold flew from                                              
  4782. Halifax N.~S. to Montr\'eal, P.~Q. via Moncton, N.~B.                           
  4783. \vskip \baselineskip \hrule                                                     
  4784.                                                                                 
  4785.                                                                                 
  4786. \goodbreak \vskip 2pt \hrule                                                    
  4787. \beginliteral                                                                   
  4788. \line{left end \hfil left tackle \hfil left guard \hfil \centre{} \hfil         
  4789. right guard \hfil right tackle \hfil right end}                                 
  4790. @endliteral                                                                     
  4791. \line{left end \hfil left tackle \hfil left guard \hfil \centre{} \hfil         
  4792. right guard \hfil right tackle \hfil right end}                                 
  4793. \vskip \baselineskip \hrule                                                     
  4794.                                                                                 
  4795.                                                                                 
  4796. \goodbreak \vskip 2pt \hrule                                                    
  4797. \beginliteral                                                                   
  4798. \line{left \hfil \hfil right-\centre{} \hfil right}                             
  4799. @endliteral                                                                     
  4800. \line{left \hfil \hfil right-\centre{} \hfil right}                             
  4801. \vskip \baselineskip \hrule                                                     
  4802.                                                                                 
  4803.                                                                                 
  4804. \goodbreak \vskip 2pt \hrule                                                    
  4805. \beginliteral                                                                   
  4806. \line{\hskip 1 in ONE \hfil TWO \hfil THREE}                                    
  4807. @endliteral                                                                     
  4808. \line{\hskip 1 in ONE \hfil TWO \hfil THREE}                                    
  4809. \vskip \baselineskip \hrule                                                     
  4810.                                                                                 
  4811.                                                                                 
  4812. \goodbreak \vskip 2pt \hrule                                                    
  4813. \beginliteral                                                                   
  4814. i{f}f if{}f if{f}                                                               
  4815. @endliteral                                                                     
  4816. i{f}f if{}f if{f}                                                               
  4817. \vskip \baselineskip \hrule                                                     
  4818.                                                                                 
  4819.                                                                                 
  4820. \goodbreak \vskip 2pt \hrule                                                    
  4821. \beginliteral                                                                   
  4822. $C(n,r) = n!/(r!\,(n-r)!)$                                                      
  4823. @endliteral                                                                     
  4824. $C(n,r) = n!/(r!\,(n-r)!)$                                                      
  4825. \vskip \baselineskip \hrule                                                     
  4826.                                                                                 
  4827.                                                                                 
  4828. \goodbreak \vskip 2pt \hrule                                                    
  4829. \beginliteral                                                                   
  4830. $a+b=c-d=xy=w/z$                                                                
  4831. $$a+b=c-d=xy=w/z$$                                                              
  4832. @endliteral                                                                     
  4833. $a+b=c-d=xy=w/z$                                                                
  4834. $$a+b=c-d=xy=w/z$$                                                              
  4835. \vskip \baselineskip \hrule                                                     
  4836.                                                                                 
  4837.                                                                                 
  4838. \goodbreak \vskip 2pt \hrule                                                    
  4839. \beginliteral                                                                   
  4840. $(fg)' = f'g + fg'$                                                             
  4841. $$(fg)' = f'g + fg'$$                                                           
  4842. @endliteral                                                                     
  4843. $(fg)' = f'g + fg'$                                                             
  4844. $$(fg)' = f'g + fg'$$                                                           
  4845. \vskip \baselineskip \hrule                                                     
  4846.                                                                                 
  4847.                                                                                 
  4848. \goodbreak \vskip 2pt \hrule                                                    
  4849. \beginliteral                                                                   
  4850. $\alpha\beta=\gamma+\delta$                                                     
  4851. $$\alpha\beta=\gamma+\delta$$                                                   
  4852. @endliteral                                                                     
  4853. $\alpha\beta=\gamma+\delta$                                                     
  4854. $$\alpha\beta=\gamma+\delta$$                                                   
  4855. \vskip \baselineskip \hrule                                                     
  4856.                                                                                 
  4857.                                                                                 
  4858. \goodbreak \vskip 2pt \hrule                                                    
  4859. \beginliteral                                                                   
  4860. $\Gamma(n) = (n-1)!$                                                            
  4861. $$\Gamma(n) = (n-1)!$$                                                          
  4862. @endliteral                                                                     
  4863. $\Gamma(n) = (n-1)!$                                                            
  4864. $$\Gamma(n) = (n-1)!$$                                                          
  4865. \vskip \baselineskip \hrule                                                     
  4866.                                                                                 
  4867. \goodbreak \vskip 2pt \hrule                                                    
  4868. \beginliteral                                                                   
  4869. $x\wedge (y\vee z) = (x\wedge y) \vee (x\wedge z)$                              
  4870. @endliteral                                                                     
  4871. $x\wedge (y\vee z) = (x\wedge y) \vee (x\wedge z)$                              
  4872. \vskip \baselineskip \hrule                                                     
  4873.                                                                                 
  4874. \goodbreak \vskip 2pt \hrule                                                    
  4875. \beginliteral                                                                   
  4876. $2+4+6+\cdots +2n = n(n+1)$                                                     
  4877. @endliteral                                                                     
  4878. $2+4+6+\cdots +2n = n(n+1)$                                                     
  4879. \vskip \baselineskip \hrule                                                     
  4880.                                                                                 
  4881.                                                                                 
  4882. \goodbreak \vskip 2pt \hrule                                                    
  4883. \beginliteral                                                                   
  4884. $\vec x\cdot \vec y  = 0$ if and only if $\vec x \perp \vec y$.                 
  4885. @endliteral                                                                     
  4886. $\vec x\cdot \vec y  = 0$ if and only if $\vec x \perp \vec y$.                 
  4887. \vskip \baselineskip \hrule                                                     
  4888.                                                                                 
  4889.                                                                                 
  4890. \goodbreak \vskip 2pt \hrule                                                    
  4891. \beginliteral                                                                   
  4892. $\vec x\cdot \vec y \not= 0$ if and only if $\vec x \not\perp \vec y$.          
  4893. @endliteral                                                                     
  4894. $\vec x\cdot \vec y \not= 0$ if and only if $\vec x \not\perp \vec y$.          
  4895. \vskip \baselineskip \hrule                                                     
  4896.                                                                                 
  4897.                                                                                 
  4898. \goodbreak \vskip 2pt \hrule                                                    
  4899. \beginliteral                                                                   
  4900. $(\forall x\in \Re)(\exists y\in\Re)$ $y>x$.                                    
  4901. @endliteral                                                                     
  4902. $(\forall x\in \Re)(\exists y\in\Re)$ $y>x$.                                    
  4903. \vskip \baselineskip \hrule                                                     
  4904.                                                                                 
  4905.                                                                                 
  4906. \goodbreak \vskip 2pt \hrule                                                    
  4907. \beginliteral                                                                   
  4908. ${a+b\over c}\quad {a\over b+c}\quad {1\over a+b+c} \not= {1\over a}+           
  4909. {1\over b}+{1\over c}$.                                                         
  4910. @endliteral                                                                     
  4911. ${a+b\over c}\quad {a\over b+c}\quad {1\over a+b+c} \not= {1\over a}+           
  4912. {1\over b}+{1\over c}$.                                                         
  4913. \vskip \baselineskip \hrule                                                     
  4914.                                                                                 
  4915.                                                                                 
  4916. \goodbreak \vskip 2pt \hrule                                                    
  4917. \beginliteral                                                                   
  4918. What are the points where ${\partial \over \partial x} f(x,y) = {\partial \over 
  4919. \partial y} f(x,y) = 0$?                                                        
  4920. @endliteral                                                                     
  4921. What are the points where ${\partial \over \partial x} f(x,y) = {\partial \over 
  4922. \partial y} f(x,y) = 0$?                                                        
  4923. \vskip \baselineskip \hrule                                                     
  4924.                                                                                 
  4925.                                                                                 
  4926. \goodbreak \vskip 2pt \hrule                                                    
  4927. \beginliteral                                                                   
  4928. $e~x \quad e~{-x} \quad e~{i\pi}+1=0 \quad x_0 \quad x_0~2                      
  4929. \quad {x_0}~2 \quad 2~{x~x}$.                                                   
  4930. @endliteral                                                                     
  4931. $e~x \quad e~{-x} \quad e~{i\pi}+1=0 \quad x_0 \quad x_0~2                      
  4932. \quad {x_0}~2 \quad 2~{x~x}$.                                                   
  4933. \vskip \baselineskip \hrule                                                     
  4934.                                                                                 
  4935.                                                                                 
  4936. \goodbreak \vskip 2pt \hrule                                                    
  4937. \beginliteral                                                                   
  4938. $\nabla~2 f(x,y) = {\partial~2 f \over\partial x~2}+ {\partial~2 f \over        
  4939. \partial y~2}$.                                                                 
  4940. @endliteral                                                                     
  4941. $\nabla~2 f(x,y) = {\partial~2 f \over\partial x~2}+ {\partial~2 f \over        
  4942. \partial y~2}$.                                                                 
  4943. \vskip \baselineskip \hrule                                                     
  4944.                                                                                 
  4945.                                                                                 
  4946. \goodbreak \vskip 2pt \hrule                                                    
  4947. \beginliteral                                                                   
  4948. $\lim_{x\to 0} (1+x)~{1\over x}=e$.                                             
  4949. @endliteral                                                                     
  4950. $\lim_{x\to 0} (1+x)~{1\over x}=e$.                                             
  4951. \vskip \baselineskip \hrule                                                     
  4952.                                                                                 
  4953.                                                                                 
  4954. \goodbreak \vskip 2pt \hrule                                                    
  4955. \beginliteral                                                                   
  4956. The cardinality of $(-\infty, \infty)$ is $\aleph_1$.                           
  4957. @endliteral                                                                     
  4958. The cardinality of $(-\infty, \infty)$ is $\aleph_1$.                           
  4959. \vskip \baselineskip \hrule                                                     
  4960.                                                                                 
  4961.                                                                                 
  4962. \goodbreak \vskip 2pt \hrule                                                    
  4963. \beginliteral                                                                   
  4964. $\lim_{x\to {0~+}} x~x = 1$.                                                    
  4965. @endliteral                                                                     
  4966. $\lim_{x\to {0~+}} x~x = 1$.                                                    
  4967. \vskip \baselineskip \hrule                                                     
  4968.                                                                                 
  4969.                                                                                 
  4970. \goodbreak \vskip 2pt \hrule                                                    
  4971. \beginliteral                                                                   
  4972. $\int_0~1 3x~2\,dx = 1$.                                                        
  4973. @endliteral                                                                     
  4974. $\int_0~1 3x~2\,dx = 1$.                                                        
  4975. \vskip \baselineskip \hrule                                                     
  4976.                                                                                 
  4977.                                                                                 
  4978. \goodbreak \vskip 2pt \hrule                                                    
  4979. \beginliteral                                                                   
  4980. $\sqrt2 \quad \sqrt {x+y\over x-y} \quad \root 3 \of {10}$ \quad $e~{\sqrt x}$. 
  4981. @endliteral                                                                     
  4982. $\sqrt2 \quad \sqrt {x+y\over x-y} \quad \root 3 \of {10}$ \quad $e~{\sqrt x}$. 
  4983. \vskip \baselineskip \hrule                                                     
  4984.                                                                                 
  4985.                                                                                 
  4986. \goodbreak \vskip 2pt \hrule                                                    
  4987. \beginliteral                                                                   
  4988. $\!x\! = \sqrt{x\cdot x}$.                                                      
  4989. @endliteral                                                                     
  4990. $\!x\! = \sqrt{x\cdot x}$.                                                      
  4991. \vskip \baselineskip \hrule                                                     
  4992.                                                                                 
  4993.                                                                                 
  4994. \goodbreak \vskip 2pt \hrule                                                    
  4995. \beginliteral                                                                   
  4996. $\phi(t) = {1 \over \sqrt{2\pi}} \int_0~t e~{-x~2/2}\,dx$.                      
  4997. @endliteral                                                                     
  4998. $\phi(t) = {1 \over \sqrt{2\pi}} \int_0~t e~{-x~2/2}\,dx$.                      
  4999. \vskip \baselineskip \hrule                                                     
  5000.                                                                                 
  5001.                                                                                 
  5002. \goodbreak \vskip 2pt \hrule                                                    
  5003. \beginliteral                                                                   
  5004. $\underline x \quad \overline y \quad \underline{\overline{x+y}}$.              
  5005. @endliteral                                                                     
  5006. $\underline x \quad \overline y \quad \underline{\overline{x+y}}$.              
  5007. \vskip \baselineskip \hrule                                                     
  5008.                                                                                 
  5009.                                                                                 
  5010. \goodbreak \vskip 2pt \hrule                                                    
  5011. \beginliteral                                                                   
  5012. $\bigl \lceil \lfloor x \rfloor \bigr \rceil \leq \bigl \lfloor \lceil x \rceil 
  5013. \bigr \rfloor$.                                                                 
  5014. @endliteral                                                                     
  5015. $\bigl \lceil \lfloor x \rfloor \bigr \rceil \leq \bigl \lfloor \lceil x \rceil 
  5016. \bigr \rfloor$.                                                                 
  5017. \vskip \baselineskip \hrule                                                     
  5018.                                                                                 
  5019.                                                                                 
  5020. \goodbreak \vskip 2pt \hrule                                                    
  5021. \beginliteral                                                                   
  5022. $\sin(2\theta) = 2\sin\theta\cos\theta                                          
  5023. \quad \cos(2\theta) = 2\cos~2\theta - 1  $.                                     
  5024. @endliteral                                                                     
  5025. $\sin(2\theta) = 2\sin\theta\cos\theta                                          
  5026. \quad \cos(2\theta) = 2\cos~2\theta - 1  $.                                     
  5027. \vskip \baselineskip \hrule                                                     
  5028.                                                                                 
  5029.                                                                                 
  5030. \goodbreak \vskip 2pt \hrule                                                    
  5031. \beginliteral                                                                   
  5032. $$\int \csc~2x\, dx = -\cot x+ C                                                
  5033. \qquad \lim_{\alpha\to 0} {\sin\alpha \over \alpha} = 1                         
  5034. \qquad \lim_{\alpha\to \infty} {\sin\alpha \over \alpha} = 0.$$                 
  5035. @endliteral                                                                     
  5036. $$\int \csc~2x\, dx = -\cot x+ C                                                
  5037. \qquad \lim_{\alpha\to 0} {\sin\alpha \over \alpha} = 1                         
  5038. \qquad \lim_{\alpha\to \infty} {\sin\alpha \over \alpha} = 0.$$                 
  5039. \vskip \baselineskip \hrule                                                     
  5040.                                                                                 
  5041.                                                                                 
  5042. \goodbreak \vskip 2pt \hrule                                                    
  5043. \beginliteral                                                                   
  5044. $$\tan(2\theta) = {2\tan\theta \over 1-\tan~2\theta}.$$                         
  5045. @endliteral                                                                     
  5046. $$\tan(2\theta) = {2\tan\theta \over 1-\tan~2\theta}.$$                         
  5047. \vskip \baselineskip \hrule                                                     
  5048.                                                                                 
  5049.                                                                                 
  5050. \goodbreak \vskip 2pt \hrule                                                    
  5051. \beginliteral                                                                   
  5052. \proclaim Theorem (Euclid). There exist an infinite number of primes.           
  5053. @endliteral                                                                     
  5054. \proclaim Theorem (Euclid). There exist an infinite number of primes.           
  5055.                                                                                 
  5056. \vskip \baselineskip \hrule                                                     
  5057.                                                                                 
  5058.                                                                                 
  5059. \goodbreak \vskip 2pt \hrule                                                    
  5060. \beginliteral                                                                   
  5061. \proclaim Proposition 1.                                                        
  5062. $\root n \of {\prod_{i=1}~n X_i} \leq                                           
  5063. {1 \over n} \sum_{i=1}~n X_i$ with equality if and only if $X_1=\cdots=X_n$.    
  5064. @endliteral                                                                     
  5065. \proclaim Proposition 1.                                                        
  5066. $\root n \of {\prod_{i=1}~n X_i} \leq                                           
  5067. {1 \over n} \sum_{i=1}~n X_i$ with equality if and only if $X_1=\cdots=X_n$.    
  5068.                                                                                 
  5069. \vskip \baselineskip \hrule                                                     
  5070.                                                                                 
  5071.                                                                                 
  5072.                                                                                 
  5073. \goodbreak \vskip 2pt \hrule                                                    
  5074. \beginliteral                                                                   
  5075. $$ I_4 = \pmatrix{                                                              
  5076. 1 &0 &0 &0 \cr                                                                  
  5077. 0 &1 &0 &0 \cr                                                                  
  5078. 0 &0 &1 &0 \cr                                                                  
  5079. 0 &0 &0 &1 \cr}$$                                                               
  5080. @endliteral                                                                     
  5081. $$ I_4 = \pmatrix{                                                              
  5082. 1 &0 &0 &0 \cr                                                                  
  5083. 0 &1 &0 &0 \cr                                                                  
  5084. 0 &0 &1 &0 \cr                                                                  
  5085. 0 &0 &0 &1 \cr}$$                                                               
  5086. \vskip \baselineskip \hrule                                                     
  5087.                                                                                 
  5088.                                                                                 
  5089. \goodbreak \vskip 2pt \hrule                                                    
  5090. \beginliteral                                                                   
  5091. $$ !x! = \left\{ \matrix{                                                       
  5092. x & x \ge 0 \cr                                                                 
  5093. -x & x \le 0 \cr} \right.$$                                                     
  5094. @endliteral                                                                     
  5095. $$ !x! = \left\{ \matrix{                                                       
  5096. x & x \ge 0 \cr                                                                 
  5097. -x & x \le 0 \cr} \right.$$                                                     
  5098. \vskip \baselineskip \hrule                                                     
  5099.                                                                                 
  5100. \goodbreak \vskip 2pt \hrule                                                    
  5101. \beginliteral                                                                   
  5102. \settabs \+ \hskip 2 in & \hskip .75in & \hskip 1cm& \cr                        
  5103. \+ &Plums &\hfill\$1&.22 \cr                                                    
  5104. \+ &Coffee &\hfill1&.78 \cr                                                     
  5105. \+ &Granola &\hfill1&.98 \cr                                                    
  5106. \+ &Mushrooms & &.63 \cr                                                        
  5107. \+ &{Kiwi fruit} & &.39 \cr                                                     
  5108. \+ &{Orange juice} &\hfill1&.09 \cr                                             
  5109. \+ &Tuna &\hfill1&.29 \cr                                                       
  5110. \+ &Zucchini & &.64 \cr                                                         
  5111. \+ &Grapes &\hfill1&.69 \cr                                                     
  5112. \+ &{Smoked beef} & &.75 \cr                                                    
  5113. \+ &Broccoli &\hfill\underbar{\ \ 1}&\underbar{.09} \cr                         
  5114. \+ &Total &\hfill \$12&.55 \cr                                                  
  5115. @endliteral                                                                     
  5116. \settabs \+ \hskip 2 in & \hskip .75in & \hskip 1cm& \cr                        
  5117. \+ &Plums &\hfill\$1&.22 \cr                                                    
  5118. \+ &Coffee &\hfill1&.78 \cr                                                     
  5119. \+ &Granola &\hfill1&.98 \cr                                                    
  5120. \+ &Mushrooms & &.63 \cr                                                        
  5121. \+ &{Kiwi fruit} & &.39 \cr                                                     
  5122. \+ &{Orange juice} &\hfill1&.09 \cr                                             
  5123. \+ &Tuna &\hfill1&.29 \cr                                                       
  5124. \+ &Zucchini & &.64 \cr                                                         
  5125. \+ &Grapes &\hfill1&.69 \cr                                                     
  5126. \+ &{Smoked beef} & &.75 \cr                                                    
  5127. \+ &Broccoli &\hfill\underbar{\ \ 1}&\underbar{.09} \cr                         
  5128. \+ &Total &\hfill \$12&.55 \cr                                                  
  5129. \vskip \baselineskip \hrule                                                     
  5130.                                                                                 
  5131.                                                                                 
  5132. \goodbreak \vskip 2pt \hrule                                                    
  5133. \beginliteral                                                                   
  5134. \leftline{Getting Started \dotfill 1}                                           
  5135. \leftline{All Characters Great and Small \dotfill 9}                            
  5136. @endliteral                                                                     
  5137. \leftline{Getting Started \dotfill 1}                                           
  5138. \leftline{All Characters Great and Small \dotfill 9}                            
  5139. \vskip \baselineskip \hrule                                                     
  5140.                                                                                 
  5141. \goodbreak \vskip 2pt \hrule                                                    
  5142. \beginliteral                                                                   
  5143. \settabs \+ \hskip 1cm&\hskip 1 cm&\hskip 1 cm& \cr                             
  5144. \moveright 2 in                                                                 
  5145. \vbox{                                                                          
  5146. \hrule width 3 cm                                                               
  5147. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm                
  5148.   & \vrule height 1 cm \cr                                                      
  5149. \hrule width 3 cm                                                               
  5150. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm                
  5151.   & \vrule height 1 cm \cr                                                      
  5152. \hrule width 3 cm                                                               
  5153. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm                
  5154.   & \vrule height 1 cm \cr                                                      
  5155. \hrule width 3 cm                                                               
  5156. }                                                                               
  5157. @endliteral                                                                     
  5158. \settabs \+ \hskip 1cm&\hskip 1 cm&\hskip 1 cm& \cr                             
  5159. \moveright 2 in                                                                 
  5160. \vbox{                                                                          
  5161. \hrule width 3 cm                                                               
  5162. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm                
  5163.   & \vrule height 1 cm \cr                                                      
  5164. \hrule width 3 cm                                                               
  5165. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm                
  5166.   & \vrule height 1 cm \cr                                                      
  5167. \hrule width 3 cm                                                               
  5168. \+  \vrule height 1 cm & \vrule height 1 cm & \vrule height 1 cm                
  5169.   & \vrule height 1 cm \cr                                                      
  5170. \hrule width 3 cm                                                               
  5171. }                                                                               
  5172. \vskip \baselineskip \hrule                                                     
  5173.                                                                                 
  5174.                                                                                 
  5175. \goodbreak \vskip 2pt \hrule                                                    
  5176. \beginliteral                                                                   
  5177. \def\boxtext#1{%                                                                
  5178. \vbox{%                                                                         
  5179.       \hrule                                                                    
  5180.       \hbox{\strut \vrule{} #1 \vrule}%                                         
  5181.       \hrule                                                                    
  5182.      }%                                                                         
  5183. }                                                                               
  5184. \moveright 2 in \vbox{\offinterlineskip                                         
  5185. \hbox{\boxtext 6\boxtext 1\boxtext 8}                                           
  5186. \hbox{\boxtext 7\boxtext 5\boxtext 3}                                           
  5187. \hbox{\boxtext 2\boxtext 9\boxtext 4}                                           
  5188. }                                                                               
  5189. @endliteral                                                                     
  5190. \def\boxtext#1{%                                                                
  5191. \vbox{%                                                                         
  5192.       \hrule                                                                    
  5193.       \hbox{\strut \vrule{} #1 \vrule}%                                         
  5194.       \hrule                                                                    
  5195.      }%                                                                         
  5196. }                                                                               
  5197. \moveright 2 in \vbox{\offinterlineskip                                         
  5198. \hbox{\boxtext 6\boxtext 1\boxtext 8}                                           
  5199. \hbox{\boxtext 7\boxtext 5\boxtext 3}                                           
  5200. \hbox{\boxtext 2\boxtext 9\boxtext 4}                                           
  5201. }                                                                               
  5202. \vskip \baselineskip \hrule                                                     
  5203.                                                                                 
  5204.                                                                                 
  5205. \vfill                                                                          
  5206. \datestamp                                                                      
  5207.                                                                                 
  5208. \bye                                                                            
  5209.                                                                                 
  5210.                                                                                 
  5211.