Latex Notes 5
Latex Notes 5
First, there are the upper- and lowercase letters and the ten digits 0 - 9.
Next, there are the following sixteen punctuation characters
.: ;,?! ‘ ` ( )[]-/*@
The character \ is called backslash, and should not be confused with the more familiar
/, as in 1/2.
Most latex commands begin with a \ character.
The { and } characters are called curly braces or simply braces.
The five characters + = | < > are used mainly in mathematical formulas, although +
and = can be used in ordinary text.
There are two different quote symbols: ' and ‘.
You may think of ' as an ordinary "single quote" and ' as a funny
symbol, perhaps displayed like ` on your screen.
There are other "invisible" characters in your file: space characters, such as the
one you usually enter by pressing the space bar, and special characters that
indicate the end of a line, usually entered by pressing the return key (sometimes
labeled enter).
These invisible characters are all considered the same by latex.
Any sequence of space characters is handled the same as a single one, so it doesn't
matter if the space between two words is formed by one space character or several
of them.
However, a blank line -- one containing nothing but space characters -- is
interpreted by latex as the end of a paragraph.
Sentences and Paragraphs
Describing simple sentences and paragraphs to Latex poses no problem; you pretty much
type what comes naturally.
Latex ignores the way input is formatted, paying attention only to the logical concepts
end-of-word, end-of-sentence, and end-of-paragraph.
Quotation Marks
Typing a double quote followed by a single quote, or vice versa, poses a problem because
something like ‘” would be ambiguous.
The solution is to type the command \, (a \ character followed by a comma) between the
two quotation marks.
The \, is a typesetting command that causes Latex to insert a small amount of space.
Don't leave any space in the input file before or after the \, command.
Dashes
You can produce three different sizes of dash by typing one “ - ” , two
“ -- ”, or three characters “ --- ”
There are ten special characters, mentioned earlier, that you type only as part of
Latex commands.
The other three special characters (~, ^, and \) can be produced using verbatim
environment.
Space After a Period
This works most of the time, but not always-abbreviations like "etc." being
the most common exception.
You tell latex that a period doesn't end a sentence by using a \ command (a
\ character followed by a space or the end of a line) to make the space after
the period.
It doesn't matter how many spaces you leave after the \ character, but don't leave
any space between the period and the backslash.
If a sentence-ending period follows an uppercase letter, you will have to tell Latex
that the period ends the sentence. You do this by preceding the period with a \@
command.
If a sentence-ending period is followed by a right parenthesis or a right quote
(single or double), then the period's extra space goes after the parenthesis or
quote.
In these cases too, Latex will need a hand if its assumption that a period ends a
sentence unless it follows an uppercase letter is wrong.
Extra space is also added after a question mark (?), exclamation point (!), or
colon (:) just as for a period-that is, unless it follows an uppercase letter.
The \ and \@ commands are used the same way with each of these
punctuation characters.
Simple Text-Generating Commands
The \mbox command tells Latex to print its entire argument on the same line.
In the following example, Latex will never split "Lamport" across lines.
Footnotes
Footnotes are produced with a \footnote command having the text of the
footnote as its argument.
\footnote{ Text }
There is no space between the Gnus and the \footnote in this example;
adding space would have put an unwanted space between the text and the footnote
marker.
A \footnote command cannot be used in the argument of most commands;
Produces a footnote with text as its text and num as its number.
\footnotemark[num]
\footnotemark[num]
Used in conjunction with \footnotetext to footnote text where a \footnote command cannot
be used. It produces a footnote mark (the footnote number that appears in the running
text), but it does not produce a footnote
\footnotetext [num] {text}
The text of every document starts with a \begin{document} command and ends with an
\end{document} command.
The part of the input file preceding the \begin{document} command is called the preamble.
The Document Class
The preamble begins with a \documentclass command whose argument is one of the
predefined classes of document that Latex knows about.
In addition to choosing the class, you can also select from among certain document-class
options. The options for the article and report classes include the following:
11pt -: Specifies a size of type known as eleven point, which is ten percent larger than
the ten-point type normally used.
12pt -: Specifies a twelve-point type size, which is twenty percent larger than ten
point.
If no option is specified, 10pt is assumed.
The \documentclass command can be used either with or without the option-choosing part.
The options, enclosed in square brackets, are an optional argument of the command.
It is a Latex convention that optional arguments are enclosed in square brackets, while
mandatory arguments are enclosed in curly braces.
Latex ignores spaces after a command name like \documentclass and between command
arguments.
The document class defines the commands for specifying Latex’s standard logical
structures.
Additional structures are defined by packages, which are loaded by the
\usepackage command,
eg. \usepackage{color}, \usepackage{amsmath}, \usepackage{amssymb}
The document class determines what sectioning commands are provided, the standard
classes have the following ones
The article document class does not contain the \chapter command.
The sectional unit denoted by each of these commands must appear as a subunit of the one
denoted by the preceding command, except that the use of \part is optional.
A subsection must be part of a section, which, in the report or book document class, must
be part of a chapter.
Also, for sections, you do not need to use \begin and \end commands to indicate
which content belongs to a given block.
Subparagraphs have an additional indentation too. And they can also contain
more than one paragraph of text.
Appendix
If there is an appendix, it is begun with an \appendix command and uses the same
sectioning commands as the main part of the document.
The \appendix command does not produce any text; it simply causes sectional
units to be numbered properly for an appendix.
Qoute Environment
The quote environment produces a display suitable for a short quotation.
The quote environment is used for either a short quotation or a sequence of short
quotations separated by blank lines.
He turned and said to me: "I've done all I'm going to. I refuse to have any
further part in it. My answer is no!", and then he left.
The quotation environment is used for quotations of more than one paragraph; as usual,
the paragraphs are separated by blank lines.
Poetry
A new stanza is begun with one or more blank lines; lines within a stanza are separated by a \ \
command.
The \ \ * command is the same as \ \ except that it prevents Latex from starting a new
page at that point.
It can be used to prevent a poem from being broken across pages in a distracting way.
For this we can use the \em , which tells Latex to start emphasizing text.
\begin{em}
.
.
.
\end{em}
\em is a declaration
\em produces neither text nor space; instead, it affects the way Latex prints the text
that follows it.
Most aspects of the way Latex formats a document-the type style, how wide the
margins are, and so on-are determined by declarations.
Changing the Type Style
In Latex, a type style is specified by three components:
shape, series, and family.
These commands can be combined in a logical fashion to produce a wide variety of type styles.
Each of the text-style commands described previously has a corresponding
declaration.
For eg. Boldface text can be obtained with either the \ textbf text-producing
command or the \bfseries declaration.
Wide versions of the \hat and \tilde accent are produced by the \widehat and
\widetilde commands.
These commands try to choose the appropriate
sized accent to fit over their argument, but they can't produce very wide accents.
The letters i and j should lose their dots when accented.
The following six special punctuation symbols can be used in any mode:
Ellipsis
The commands \ldots and \cdots produce two different kinds of ellipsis ( ... )
Use \ldots between commas and between juxtaposed symbols like a ... z;
The \ldots command works in any mode, but \cdots, \vdots, and \ddots can be used only
in math mode.
Over- and Underlining
Stacking Symbols- The \stackrel command stacks one symbol above another.
The \stackrel command's first argument is printed in small type, like a superscript
Calligraphic Letters
Latex provides twenty-six uppercase calligraphic letters also called script letters.
They are produced by a special type style invoked with the \mathcal command.
Changing Style in Math Mode
Latex provides the following commands for changing type style in math mode:
They change the style only of letters, numbers, and uppercase Greek letters.
Nothing else is affected.
Latex normally uses an italic type style for letters in math mode.
\mathfrac{ } produces Fractur style.
amssymb package is needed for this style.
\mathbb{ } produces Blackboard bold style.
amssymb package is needed for it.
\boldmath declaration
This declaration cannot be used in math mode. To produce a bold subformula, put the
subformula in an \mbox.
Math Style
Latex uses the following four math styles when typesetting formulas:
Note that \pmod has an argument and produces parentheses, while \bmod produces only the
"mod",
List of functions
We can also put a slash through a symbol by typing \not before it.
Roots
The \sqrt command produces the square root of its argument; it has an optional first
argument for other roots.
substack
There are some mathematical symbols whose size depends upon what kind of math
environment they appear in; they are bigger in the displaymath and equation
environments than in the ordinary math environment.
Subscript-sized expressions that appear above and below them are typed as
ordinary subscripts and superscripts.
Greek Letters
The command to produce a lowercase Greek letter is obtained by adding a \ to the
name of the letter.
For an uppercase Greek letter, just capitalize the first letter of the command name.
Some lowercase letters have variant forms, made by commands beginning with \var.
Symbols
The shaded symbols require the Iatexsym package to be loaded with a \usepackage command.