home *** CD-ROM | disk | FTP | other *** search
/ ftp.muug.mb.ca / 2014.06.ftp.muug.mb.ca.tar / ftp.muug.mb.ca / pub / tex / gentle.tex
Text File  |  1993-02-09  |  199KB  |  5,343 lines

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