\sectiontitle{Further Features of Plain \TeX} \label{pl-furth} \subsectiontitle{Producing Blank Space in Plain \TeX} To produce (horizontal) blank space within a paragraph, use \verb?\hskip?, followed by the length of the blank space. The length of the skip should be expressed in a unit recognized by \TeX. These recognized units are given in the following table: \begin{quote} \begin{tabular}{lll} \verb?pt? & point & (1 in = 72.27 pt) \\ \verb?pc? & pica & (1 pc = 12 pt) \\ \verb?in? & inch & (1 in = 25.4 mm) \\ \verb?bp? & big point & (1 in = 72 bp) \\ \verb?cm? & centimetre & (1 cm = 10 mm) \\ \verb?mm? & millimetre & \\ \verb?dd? & didot point & (1157 dd = 1238 pt) \\ \verb?cc? & cicero & (1 cc = 12 dd) \\ \verb?sp? & scaled point & (65536 sp = 1 pt) \end{tabular} \end{quote} Thus to produce a horizontal blank space of 20 mm in the middle of a paragraph one would type \verb?\hskip 20 mm?. (There is however a mild quirk of \TeX\ which arises very rarely: if the word following the horizontal skip happens to begin with the letters `plus' then you will probably get an error message, probably \begin{quote} \begin{verbatim} ! Missing number, treated as zero. \end{verbatim} \end{quote} For an explanation of why this occurs, see the \TeX book. This problem can be avoided by typing `\verb?\hskip 20 mm \relax?'). To produce (vertical) blank space between paragraphs, use \verb?\vskip?, followed by the length of the vertical skip. Thus to obtain \begin{quotation} {\small This is the first paragraph of some text. It is separated from the second paragraph by a vertical skip of 10 millimetres.} \vskip 10 mm {\small This is the second paragraph.} \end{quotation} one should type \begin{quote} \begin{verbatim} This is the first paragraph of some text. It is separated from the second paragraph by a vertical skip of 10 millimetres. \vskip 10 mm This is the second paragraph. \end{verbatim} \end{quote} \subsectiontitle{Blank Spaces: Fine Tuning} We describe certain features of \TeX\ relating to blank spaces and paragraph indentation which will improve the appearance of the final document. Experienced users of \TeX\ will improve the appearance of their documents if they bear these remarks in mind. First note that, as a general rule, you should never put a blank space after a left parenthesis or before a right parenthesis. If you were to put a blank space in these places, then you run the risk that \TeX\ might start a new line immediately after the left parenthesis or before the right parenthesis, leaving the parenthesis marooned at the beginning or end of a line. \TeX\ has its own rules for deciding the lengths of blank spaces. For instance, \TeX\ will put an extra amount of space after a full stop if it considers that the full stop marks the end of a sentence. \begin{quotation} \footnotesize The rule adopted by \TeX\ is to regard a period (full stop) as the end of a sentence if it is preceded by a lowercase letter. If the period is preceded by an uppercase letter then \TeX\ assumes that it is not a full stop but follows the initials of somebody's name. \end{quotation} This works very well in most cases. However \TeX\ occasionally gets things wrong. This happens with a number of common abbreviations (as in `Mr.\ Smith' or in `etc.'), and, in particular, in the names of journals given in abbreviated form (e.g., `Proc.\ Amer.\ Math.\ Soc.'). The way to overcome this problem is to put a backslash before the blank space in question. Thus we should type \begin{quote} \begin{verbatim} Mr.\ Smith etc.\ and Proc.\ Amer.\ Math.\ Soc. \end{verbatim} \end{quote} \TeX\ determines itself how to break up a paragraph into lines, and will occasionally hyphenate long words where this is desirable. However it is sometimes necessary to tell \TeX\ not to break at a particular blank space. The special character used for this purpose is \verb?~?. It represents a blank space at which \TeX\ is not allowed to break between lines. It is often desirable to use \verb?~? in names where the forenames are represented by initials. Thus to obtain `W.~R.~Hamilton' it is best to type \verb?W.~R.~Hamilton?. It is also desirable in phrases like `Example~7' and `the length~$l$ of the rod', obtained by typing \verb?Example~7? and \verb?the length~$l$ of the rod?. This feature of \TeX\ may be safely ignored by beginners, though more experienced \TeX nical typists should gradually accustom themselves to using it occasionally where appropriate. \TeX\ will automatically indent paragraphs (with the exception of the first paragraph of a new section). One can prevent \TeX\ from indenting a paragraph though by beginning the paragraph with the control sequence \verb?\noindent?. Thus one obtains \begin{quotation} \small \noindent This is the beginning of a paragraph which is not indented in the usual way. This has been achieved by placing an appropriate control sequence at the beginning of the paragraph. \end{quotation} by typing \begin{quote} \begin{verbatim} \noindent This is the beginning of a paragraph which is not indented in the usual way. This has been achieved by placing an appropriate control sequence at the beginning of the paragraph. \end{verbatim} \end{quote} Conversely, the control sequence \verb?\indent? forces \TeX\ to indent the paragraph. \def\inftyint{\int_{-\infty}^{+\infty}} \def\intwrtx#1{\int_{-\infty}^{+\infty} #1 \,dx} \def\intwrt#1#2{\int_{-\infty}^{+\infty} #2 \,d #1} \subsectiontitle{Defining your own Control Sequences in Plain \TeX} Suppose that we are producing a paper that makes frequent use of some mathematical expression. For example, suppose that integrals like $$\int_{-\infty}^{+\infty} f(x)\,dx.$$ occur frequently throughout the text. This formula is obtained by typing \begin{quote} \begin{verbatim} $$\int_{-\infty}^{+\infty} f(x)\,dx.$$ \end{verbatim} \end{quote} It would be nice if we could type \verb?\inftyint? (say) to obtain the integral sign at the beginning. This can be done using \verb?\def?. What we do is to place a line with the command \begin{quote} \begin{verbatim} \def\inftyint{\int_{-\infty}^{+\infty}} \end{verbatim} \end{quote} near the beginning of the input file. Then we only have to type \begin{quote} \begin{verbatim} $$\inftyint f(x)\,dx.$$ \end{verbatim} \end{quote} to obtain the above formula. We can modify this procedure slightly. Suppose that we we defined a new control sequence \verb?\intwrtx? by putting the line \begin{quote} \begin{verbatim} \def\intwrtx#1{\int_{-\infty}^{+\infty} #1 \,dx} \end{verbatim} \end{quote} at the beginning of the input file. If we then type the line \begin{quote} \begin{verbatim} $$\intwrtx{f(x)}.$$ \end{verbatim} \end{quote} then we obtain $$\intwrtx{f(x)}.$$ What has happened is that the expression in curly brackets after \verb?\intwrtx? has been substituted in the expression defining \verb?\intwrtx?, replacing the \verb?#1? in that expression. The \verb?#1? occurring after the \verb?\intwrtx? in the line defining this control sequence indicates to \TeX\ that that it is to expect one expression (in curly brackets) after \verb?\intwrtx? to substitute for \verb?#1? in the definition of \verb?\intwrtx?. If we defined a control sequence \verb?\intwrt? by \begin{quote} \begin{verbatim} \def\intwrt#1#2{\int_{-\infty}^{+\infty} #2 \,d #1} \end{verbatim} \end{quote} then it would expect two expressions to substitute in for \verb?#1? and \verb?#2? in the definition of \verb?\intwrt?. Thus if we then type \begin{quote} \begin{verbatim} $$\intwrt{y}{f(y)}.$$ \end{verbatim} \end{quote} we obtain $$\intwrt{y}{f(y)}.$$