Page 1 :
UNIT-I, Chapter 2, Basic IATEX, 2.1 Sample Document and Key Concepts, We begin with an example. Illustrated on the next page is a LETĘX document, generated from the source file example.tex. The contents of the file are, reproduced on the left, and the box on the right shows the output produced, when the file is run through IATEX and displayed. We follow this convention, throughout the book: raw ATEX on the left, output on the right. Of courşe,, rather than appearing in a little box, your output will be formatted in full-size, pages., If you glance through the raw LATEX on the left of the next page (and at this, stage you shouldn't look too carefully at the details), you will see various extra, words preceded by the "backslash" character "\" such as \begin{equation}, and \end{equation}, and special characters like $, , and . These tell LATEX, how to format the document. LATEX knows a large number of formatting, commands, but we hope to make it clear in this book that most situations can, be handled with a relatively small subset., You will also notice the lines, \documentclass{article}, \begin{document}, at the beginning of the file and, \end{document}, at the end. Lines like these must appear in every LATEX document, and their use, is discussed in §4.1. The rest of the examples in the book are to be regarded, as small chunks of LATEX that live inside a complete document, and hence, they will not include these commands. Extra commands are sometimes placed, between \documentclass and \begin{document}; this part of the document, is known as the preamble (see Figure 4.1 on page 43)., 5, Scanned by TapScanner
Page 2 :
CHAPTER 2. BASIC ATEX, 6., \documentclass{article}, This is a short document to illustrate, the basic use of LATEX., Simply leave a blank line to get a new, paragraph; indentation is automatic., Mathematical expressions such as, y = 3 sin r are obtained with dollar, signs. Equations can be displayed, as, \begin{document}, This is a short document, to illustrate the basic use of, \LaTeX., in, Simply leave a blank line to, get a new paragraph;, indentation is automatic., y = 3 sin r., Numbered equations are also possible:, (2.1), y = 3 cos T., Mathematical expressions, such as $y = 3 \sin x$, are obtained with dollar signs. k, Because we have labeled this equation, we can refer to it without having to, know its number. Thus, the preceding, equation was number (2.1)., Powers (superscripts), as in I, are, obtained with ; more complicated, %3D, Equations can be displayed,, as in, y = 3 \sin x., powers must live in curly braces:, 2+a., Nưmbered equations are also, Likewise, subscripts are obtained, with the underscore: y3 or Yn+1., possible:, \begin{equation}\label{equa}, y' 3 \cos x., \end{equation}, We use both in r2+a, %3D, Because we have labeled this, equation we can refer to it, without having to know its, Thus, the preceding, number., equation was, number (\ref{equa})., Powers (superscripts), as in $x 2$,, are obtained with \verb"";, more complicated powers must live, in curly braces: $x {2+\alpha}$., Likewise, subscripts are obtained, with the underscore: $y_3$ or, $y_{n+1}$., We use both in $x_{n+1}*{2+\alpha}$., \end{document}, Scanned by TapScanner
Page 3 :
2.1. SAMPLE DOCUMENT AND KEY CONCEPTS, LATEX generally regards groups of characters separated by spaces as words%;, a "newline" generated by the Return (or Enter) key is also thought of as a, space. The number of spaces between words is immaterial the output will, look the same with one or twenty. Also, since a single "newline" character is, treated as an interword space, it doesn't matter where newlines occur in the, file; LATEX will make up its own mind about how to break a paragraph into, lines, hyphenating words if necessary to produce neat output., A blank line-or any number of blank lines together-signifies the end, of a paragraph. Judicious use of blank lines and spaces makes your tex file, much easier to read and understand. A paragraph is automatically indented, by LATEX, except when it is the first in a section. If you want to override this, feature, insert the \noindent command at the start of the new paragraph., The following characters have a special meaning in LATEX:, I & $ %, - -{ } #, In case you really want one of these characters to appear in the output, most, of them can be generated by preceding the character with a backslash., The special characters &, \$,, %, \-, \{, \}, and \# may be, printed by preceding each with, a backslash. We can then put, The special characters &, $, %, -, {,, }, and # may be printed by preceding, each with a backslash. We can then, text in \{curly braces\}., put text in {curly braces}., If a % sign is included in a line without being preceded by a backslash,, the remainder of the line is ignored. This provides a mechanism for inserting, comments into the LATEX file. Look at the next example carefully and compare, the input with the output., It is likely that 50\% of the time, you will be frustrated because you |It is likely that 50% of the time you, forgot to precede the % symbol by, will be frustrated because you forgot, a backslash., to precede the a backslash., The special characters (and ordinary characters, too) can also be displayed, in a typewriter font using the \verb command. For example, \verb+% and\+, produces %"and\. The character immediately following \verb, in this case +,, acts as the opening delimiter-everything will be printed out "verbatim" up to, the next occurrence of that character. The text between the delimiters should, not be broken across lines in the source file. For this reason, \verb is suitable, only for short bursts of verbatim output., Scanned by TapScanner, 7,
Page 4 :
CHAPTER 2 BASIC WTEX, 8., 2.2 Type Style, For variation and emphasis, the style of the type can be altered. More precisely, you can control the shape, series, and family of the type. There are four shapes, \textup(Upright type), \textit(Italic type}, \textsl{Slanted type), \textsc{Small caps type}, Upright type Italic type Slanted type, SMALL CAPS TYPE, and two series, \textmd{Medium}, \textbf(Boldface}, Medium Boldface, and three families, \textrm{Roman}, \textsf{Sans serif}, \texttt(Typewriter}, Roman Sans serif Typewriter, Note that the text whose type is to be changed is enclosed in curly braces after, the command. You can combine the three features, as in, \textsl{Don't \textbf{overuse}, Don't overuse type-changing., It, type-changing.}, \textsf{It \textit{annoys} the, \textsc{reader}.}, \texttt{And loses \textsl{impact}.}, annoys the READER., And loses, impact., In addition, ATEX has the \emph command that causes the enclosed text to be, emphasized. So \emph{important} becomes important. The particular effect, produced by \emph depends on the type in current use., \textsc{Pile on \emph{lots}, of subtlety.}, \textsf{Sans serif adds a little, PILE ON lots OF SUBTLETY., Sans, serif adds a little je ne sais rien. Nouns, \emph{je ne sais rien}.}, \textsl{Nouns should \emph{never}, be verbed.}, should never be verbed., Characters of different sizes are sometimes needed for titles, headings, etc., The default size is 10 points, a point being a printing term for approximately, 1/72 of an inch. To produce an entire document in a different type size, the, 11pt or 12pt options can be specified with \documentclass, as discussed in, §4.1. The declarations, \Huge \huge \LARGE \Large \large \normalsize, \small \footnotesize \scriptsize \tiny, Scanned by TapScanner
Page 5 :
2.3. ENVIRONMENTS, 9., can be used to change the size selectively. These declarations, and the words, to which they apply, are enclosed in curly braces to limit their scope. A space, separates the command from the text., {\LARGE LARGE text} makes ideal, {\Large Large text} for, shortsighted people;, {\tiny tiny text} makes, ideal {\scriptsize, LARGE, Large text for shortsighted people;, text makes ideal, tiny text makes ideal scriptsize text for, scriptsize text} for, longsighted people., longsighted people., If the particular combination of shape, series, family, and size is not, available on your system, LATEX will warn you and substitute a "nearby", alternative., 2.3 Environments, Environments are portions of the document that we wish LATEX to treat, differently from the main body. They are generally created by enclosing the, text between the commands, \begin{environment name}, \end{environment name}., In this section we discuss some common nonmathematical environments., 2.3.1, Lists, There are several list-making environments. The itemize version produces, "bullets.", \begin{itemize}, \item Every sentence should, make sense in isolation., • Every sentence should make, Like that one., sense in isolation. Like that one., \item There is a lot to be, said for brevity., \item Many words can, • There is a lot to be said for, brevity., ostensibly be deleted., \item Eschew the, • Many words can ostensibly be, deleted., highfalutin., \item Understatement is a, mindblowingly effective, • Eschew the highfalutin., weapon., \end{itemize}, • Understatement is a mindblow-, ingly effective weapon., Notice how each new entry is preceded by the \item command., Scanned by TapScanner