\sectiontitle{Further Features of \LaTeX} \label{la-furth} \subsectiontitle{Producing Blank Space in \LaTeX} To produce (horizontal) blank space within a paragraph, use \verb?\hspace? and \verb?\hspace*?, followed by the length of the blank space enclosed within curly brackets. 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?\hspace{20 mm}? (or \verb?\hspace*{20 mm}?. The difference between \verb?\hspace? and \verb?\hspace*? is that if \TeX\ decides to break between lines at the point where an \verb?\hspace? is specified, then the \verb?\hspace? is ignored. Using \verb?\hspace*? forces \TeX\ to produce a horizontal space, whether of not \TeX\ breaks between lines. To produce (vertical) blank space between paragraphs, use \verb?\vspace? and \verb?\vspace*?, followed by the length of the blank space enclosed within curly brackets. A \verb?\vspace? will be ignored if it comes at a break between pages, whereas blank space will always be produced by \verb?\vspace*?, whether or not there is a page break. 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.} \vspace{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. \vspace{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. \subsectiontitle{The Preamble of the \LaTeX\ Input file} We describe the options available in \LaTeX\ for specifying the overall style of a document. Every \LaTeX\ document should begin with a \verb?\documentstyle? command followed by the \verb?\begin{document}? command, and must end with the \verb?\end{document}? command. A typical such document is the following: \begin{quote} %% \begin{verbatim} %% \documentstyle[tcda,12pt]{article} \begin{verbatim} \documentstyle[a4,12pt]{article} \begin{document} This is the first paragraph of a typical document. It is produced in a `12~point' size. A {\it point} is a unit of length used by printers. One point is approximately $1/72$~inch. In a `12~point' font the height of the parentheses is 12~points (i.e. about $1/6$~inch) and the letter~`m' is about 12 points long. This is the second paragraph of the document. There are also `10 point' and `11 point' styles available in \LaTeX. The required size is specified in the `documentstyle' command. If no such size is specified then the 10~point size is assumed. \end{document} \end{verbatim} \end{quote} The syntax of the \verb?\documentstyle? command is as follows. The command begins with \verb?\documentstyle? and ends with the names of one of the available styles, enclosed in curly brackets. The available styles are `{\tt article}', `{\tt report}', `{\tt book}' and `{\tt letter}'. Between the ``\verb?\documentstyle?'' and the name of the document style, one may place a list of {\it options}. These options are separated by commas and the list of options is enclosed in square brackets (as in the above example). The options available (which are usually the names of certain `style files') include the following: \begin{description} \item[11pt] Specifies a size of type known as {\it eleven-point}, which is ten percent larger than the ten-point type normally used. \item[12pt] Specifies a twelve-point type size, which is twenty percent larger than ten-point. %%\item[twoside] Formats the output for printing on both %% sides of the page. \item[twocolumn] Produces two-column output. %% \item[tcda] A (locally produced) `style file' which \item[a4] A `style file' which ensures that the page is appropriately positioned on A4 size paper. It is recommended that most \LaTeX\ documents produced on the LaserWriter in the School of Mathematics use this option. %% \item[tcdh] A (locally produced) `style file' which %% ensures that the page is appropriately positioned on %% the headed notepaper of the T.C.D. School of Mathematics. \end{description} \begin{quotation} \small Typing simply \verb?\documentstyle{article}? will produce a document in ten-point type size. However the printed output will not be nicely positioned on A4 paper, since the default size is intended for a different (American) paper size. \end{quotation} Pages will be automatically numbered at the bottom of the page, unless you specify otherwise. This can be done using the \verb?\pagestyle? command. This command should come after the \verb?\documentstyle? command and before the \verb?\begin{document}? command. This command has the syntax \verb?\pagestyle{?{\it option}\verb?}?, where the {\it option} is one of the following: \begin{description} \item[plain] The page number is at the foot of the page. This is the default page style for the {\tt article} and {\tt report} document styles. \item[empty] No page number is printed. \item[headings] The page number (and any other information determined by the document style) is put at the top of the page. \item[myheadings] Similar to the {\bf headings} pagestyle, except that the material to go at the top of the page is determined by \verb?\markboth? and \verb?\markright? commands (see the \LaTeX\ manual). \end{description} For example, the input file \begin{quote} %% \begin{verbatim} %% \documentstyle[tcda]{article} \begin{verbatim} \documentstyle[a4]{article} \pagestyle{empty} \begin{document} The main body of the document is placed here. \end{document} \end{verbatim} \end{quote} produces a document without page numbers, using the standard ten-point type size. \newcommand{\inftyint}{\int_{-\infty}^{+\infty}} \newcommand{\intwrtx}[1]{\int_{-\infty}^{+\infty} #1 \,dx} \newcommand{\intwrt}[2]{\int_{-\infty}^{+\infty} #2 \,d #1} \subsectiontitle{Defining your own Control Sequences in \LaTeX} 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?\newcommand?. What we do is to place a line with the command \begin{quote} \begin{verbatim} \newcommand{\inftyint}{\int_{-\infty}^{+\infty}} \end{verbatim} \end{quote} near the beginning of the input file (the best place being after the \verb?\documentstyle? command but before the \verb?\begin{document}? command). 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} \newcommand{\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 number 1 inside square brackets in the \verb?\newcommand? line defining \verb?\intwrtx? indicates to \LaTeX\ 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} \newcommand{\intwrt}[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)}. \]