0% found this document useful (0 votes)
9 views66 pages

Latex Notes 5

The document provides a comprehensive guide on using LaTeX, detailing the characters, commands, and formatting rules necessary for typesetting documents. It covers topics such as input characters, sentence and paragraph formatting, quotation marks, special symbols, document structure, and sectioning commands. Additionally, it explains how to manage footnotes, appendices, and various text styles, including mathematical formatting.

Uploaded by

vbdbmath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views66 pages

Latex Notes 5

The document provides a comprehensive guide on using LaTeX, detailing the characters, commands, and formatting rules necessary for typesetting documents. It covers topics such as input characters, sentence and paragraph formatting, quotation marks, special symbols, document structure, and sectioning commands. Additionally, it explains how to manage footnotes, appendices, and various text styles, including mathematical formatting.

Uploaded by

vbdbmath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

Latex

Characters that can appear in your input file.

First, there are the upper- and lowercase letters and the ten digits 0 - 9.
Next, there are the following sixteen punctuation characters
.: ;,?! ‘ ` ( )[]-/*@

The ten special characters


# $ % & ~ _ ^ \ { } are used only in latex commands.

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

Latex interprets the character ` as a single left quote,


and the character ‘ as a single right quote.

To get a double quote, just type two single quotes


The right-quote character ‘ is the one you're used to thinking of as a single quote, and
the left-quote character ` is on the keyboard key just below the Escape key.

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 is usually no space before or after a dash.


Minus signs are not dashes; they should appear only in mathematical formulas.
Special Symbols

There are ten special characters, mentioned earlier, that you type only as part of
Latex commands.

Seven of those symbols can be produced by typing a \ in front of the


corresponding character.

The other three special characters (~, ^, and \) can be produced using verbatim
environment.
Space After a Period

Typesetters often put a little extra space after a sentence-ending period.

Latex simply assumes that a period ends a sentence unless it follows an


uppercase letter.

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

Simple text-generating commands


1) \TeX produces logo for Tex,
2) \LaTeX produces logo for Latex,
3) \today produces todays date.
Preventing Line Breaks

Line breaking should be prevented at certain inter-word spaces.


For example, the expression "Chapter 3" looks strange if the "Chapter" ends one line
and the "3" begins the next

Typing ~ (a tilde character) produces an ordinary inter-word space at which Latex


will never break a line. Below are some examples indicating when a - should be
used.
It is best not to break a line within certain words. For example, you should
try to avoid splitting a name (especially your own).

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;

\footnote [num] {text}

Produces a footnote with text as its text and num as its number.

\footnotemark[num]

\footnotetext [num] {text}

\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}

Used in conjunction with \footnotemark to footnote text where the \footnote


command cannot be used
The Document

The text of every document starts with a \begin{document} command and ends with an
\end{document} command.

Latex ignores anything that follows the \end{document}.

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.

Twocolumn -: Produces two-column output


Twoside -: Formats the output for printing on both sides of the page.
The classes article and report are single sided and the book class is double sided by
default.
(Latex has no control over the actual printing.)
The option twoside does not tell the printer you use that it should actually make a two-
sided printout.
You specify a document-class option by enclosing it in square brackets immediately after the
"\documentclass", as in
\documentclass [twoside]{report}

Multiple options are separated by commas.


\documentclass [twocolumn,12pt]{article}

Don't leave any space inside the square brackets.

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}

A package can have options, specified by an optional argument of \usepackage


just like the one for \documentclass.
Sizes
Sectioning Command

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.

The \part command is used for major divisions of long documents.

It does not affect the numbering of smaller units.


For eg. in the article class, if the last section of Part 1 is Section 5, then the first section of
Part 2 is Section 6
Notice that you do not need to specify section numbers; LaTeX will sort that out for
you.

Also, for sections, you do not need to use \begin and \end commands to indicate
which content belongs to a given block.

Paragraphs and subparagraphs do not have numbers

Though named ‘‘paragraph’’ we can have several paragraphs of text within


this.

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.

In a book or report it declares that subsequent \chapter commands start an appendix.

In an article it does the same, for \section command.

\appendix switches the document from generating sections (in articles) or


chapters (in books) to producing appendixes.

Section or chapter numbering is restarted and the representation of the


counter switches to alphabetic.
Quotations
Latex provides two different environments for displaying quotations.

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.

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.
Qoutation Environment

The quotation environment is used for quotations of more than one paragraph; as usual,
the paragraphs are separated by blank lines.
Poetry

Poetry is displayed with the verse environment.

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.

The \ \* command is called the *-form of the \ \ command.


\em

You may want to emphasize a large piece of text, such as a quotation.

For this we can use the \em , which tells Latex to start emphasizing text.

{ \em This entire text will be emphasized. }

\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.

Such a command is called a declaration.

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.

None of these text-producing commands or declarations can be used in math mode.


Accents

These cannot be used in Mathmode.


Math Mode Ascents

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 commands \imath and \jmath produce a dotless i and j, respectively.


Symbols

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;

Use \cdots between symbols like +, -, and =.


Latex can also produce vertical and diagonal ellipses, which are used mainly in arrays.

The \ldots command works in any mode, but \cdots, \vdots, and \ddots can be used only
in math mode.
Over- and Underlining

The \overline command puts a horizontal line above its argument.

There's an analogous \underline command for underlining.


Horizontal braces are put above or below an expression with the \overbrace and
\underbrace commands.

In a displayed formula, a subscript or superscript puts a label on the brace.


\stackrel command

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:

\mathit{ }, \mathrm{ }, \mathbf{ }, \mathsf{ }, \mathtt{ }, \mathcal{ }

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

The \boldmath declaration causes everything in a formula to be bold,


including the symbols.

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:

display For normal symbols in a displayed formula.


text For normal symbols in an in-text formula.
script For subscripts and superscripts.
scriptscript For further levels of sub- and superscripting, such as subscripts of
superscripts.

The declarations \displaystyle, \textstyle, \scriptstyle, and \scriptscriptstyle force Latex


to use the indicated style.
"mod" (modulo) function

Two commands produce the "mod" (modulo) function:

\bmod for a binary relation and \pmod for a parenthesized expression.

(Remember b as in binary and p as in parenthesized.)

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

\substack - Used to create multi-line subscripts or superscripts.

\substack{First element \\ Second element \\ Third element …}


Symbols

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy