math into latex -k8凯发
-
your latex
-
editing cycle
- a text editor is used to create a source file
- “typesets” the source file and views the result on the monitor
- making changes and observing the results of these changes
- print the file and mostly creates a pdf file of the typeset version
-
three productivity tools
-
synchronization
- move quickly between the source file and the typeset file
-
block comment
- comment or uncomment a block of text at one time
-
jump to a line
- jump to a line specified in the source file by the line number
-
typing text
-
a source file
- text
- math (formulas)
-
instructions (commands) to latex
- command with an argument
- command without an argument
-
environment.
- content:
the text that is typed between
two environment commands
- start with a backslash ( \ )
-
the keyboard
-
used to type text
- a-z a-z 0-9
= * / ( ) [ ]
-
punctuation marks can be used
- , ; . ? ! : ` ' -
- the space bar, the tab key, and the return (or enter) key
-
special keys used in latex commands
-
# $ % & ~ _ ^ \ { } @ " |
- only @ requires no special command
- others need to insert a backslash ( \ ) before
-
your first note
-
comments
- everything on the line after % is ignored
-
document class
- control how the document is formatted
-
environment
- \begin{document} and \end{document}
-
text
- typed within the document environment
-
lines too wide
- latex uses points (pt) to measure distances
- hyphenate a hyphenated word only at the hyphen
- latex’s standard hyphenation routine cannot handle german hyphenation and so on
-
more text features
-
display the date on which the document is typeset
- \today
-
environments to justify text
- \begin{flushright} ... \end{flushright}
- \begin{center} ... \end{center}
- \begin{flushleft} ... \end{flushleft}
-
text style
-
\emph
- emphasize text
-
\textbf
- bold text
-
\texttt
- typewriter style text
-
form of the latex commands
- backslash( \ )
-
command name
- terminated by the first nonalphabetic character
- case sensitive
-
arguments (if have)
- takes the next character as argument if braces non-exist
-
multiple role of hyphens
-
double hyphens are used for number ranges
- 89--64 as 89-64
-
triple hyphens for the em dash punctuation mark
- --- as —
-
new line command
- \\ (or \newline):
-
create additional space between lines
- \\[distance]
- square brackets means optional
- distance may be given in points (pt), centimeters (cm), or inches (in)
-
new page command
- \newpage
-
special rules for special characters
-
accented characters and some european characters
- e.g. \"{a}
-
typing math
-
math environments
-
inline
- open and close with $
-
displayed
- open with \[ and close with \]
-
spacing rules
- ignore space with two exceptions
- spaces terminate commands
-
spaces in the arguments of certain commands
- e.g. /text
-
formula
-
arithmetic
-
\cdot or \times
- . or x in ab as a.b or a x b
-
\frac
- for fractions and seldom used inline
-
(underscore)_ and (caret)^
- subscript and superscript
- should be enclosed in braces or take the first one as argument
-
(prime)'
- automatically superscripted in math
-
binomial coefficients
- \binom{}{}
-
congruences
-
a \equiv v \pmod{\theta}
- topic
-
a \equiv v \pod{\theta}
- topic
-
delimiters
-
\left and \right
- resize the parentheses according to the symbols inside
-
\quad
- a spacing command
-
ellipses
-
\dots
- ellipsis ( . . . ) in text
-
integrals
-
\int
- an integral
- the lower limit is specified as a subscript
- the upper limit is specified as a superscript
-
\,
- a spacing command
-
math accents
- \bar{a}
- \hat{a}
- \tilde{a}
- \vec{a}
-
matrices
-
\begin{matrix} ... \end{matrix}
- matrix environment
- has to appear within a math environment
- as a rule, it's in a displayed math environment
- does not provide delimiters
-
&
- separate matrix elements within a row
-
\\
- separate rows
- do not end the last row with a new line command
-
\begin{pmatrix} ... \end{pmatrix}
\begin{vmatrix} ... \end{vmatrix}
- provide delimiters as
\left( ... \right)
\left| ... \right|
-
operators
- \sin
- \lim_{x \to 0} f(x) = 0
-
large operators
- \sum
- for sum
- \sum_{i=1}^{n} x_{i}^{2}
- \prod
- for product
- \prod_{i=1}^{n} x_{i}^{2}
-
roots
-
\sqrt
- \sqrt{a 2b}
- \sqrt[n]{5}
-
text
- \text
-
displayed formulas
-
equations
- \begin{equation} ... \end{equation}
- the equation number is automatically generated
-
use symbolic label to refer to the equation
- the argument of the \label command
- used the convention that the label of an equation starts with e:
- referenced
- \ref
- the number of the formula
- \eqref
- provide the reference number in parentheses
- \pageref
- the page of the formula
- ~
- nonbreakable space
- ensure the equation number on the same line
-
symbolic referencing
- symbol
- the argument of the \label command
- can be referenced with \ref, \eqref, or \pageref commands
- same mechanism for all of the generated numbering systems
- sections, subsections, subsubsections, equations,
theorems, lemmas, and bibliographic references
- except that for bibliographic references
- \bibitem
- define a bibliographic item and
- \cite
- cite a bibliographic item
-
tagged
- \tag
- the tag replaces the equation number
- tags are absolute while numbers relative
- \notag
- prevent the numbering
- useful in a fromula more than one line
-
aligned formulas
-
\begin{align} ... \end{align}
- simple alignments
- \\
- line separator
- should not have one to terminate the last line
- &
- alignment point
- place it before where you want to be aligned
- annotated alignment
- &&
- a mark for the start of the annotation
- align* environment
- no line be numbered
-
cases
- within a math environment such as equation or align environment
- \begin{cases} ... \end{cases}
- you can put inline math inside the argument of a \text command
- \\
- separate the lines
- &
- indicate the annotation
-
first article
-
the anatomy of an article
-
preamble
- everything from the first line to the line \begin{document}
- specify additional commands that are used throughout the document
- specifies the document class and enhancements or packages
-
\documentclass
- the only required command
- \usepackage{}
- \newtheorem{}{}
-
body.
- the content of the document environment
- between the lines \begin{document} and \end{document}
-
top matter
- title page information and the abstract
- follows the line \begin{document} and concludes with the line \maketitle
-
main matter
- \section{}
- \begin{theorem} ... \end{theorem}
- \begin{figure}[hbt]
\centering\includegraphics{}
\caption{}
\end{figure}
- \begin{proof} ... \end{proof}
-
back matter
- \begin{thebibliography}{n}
\bibitem{maker}
content
bibitem{}...
\end{thebibliography}
- n tell latex to make room for number
9 for references fewer than 10
99 for references between 10 and 99
and so on
- reference with the \cite{marker} command
-
an article template
-
top matter
-
\thanks
- places an unmarked footnote at the bottom of the first page
-
\author
- multiple authors get separate \author and \address commands
-
\address
- separate the lines with \\
- do not put a \\ at the end of the last line
-
\date
- \date{\today} typesets today’s date
- \date{march 14, 2009}
-
\title
- the only required command
- break the title into separate lines with \\
do not put a \\ at the end of the last line
-
\maketitle
- if you do not give the \maketitle command, even the \title command is optional
on the other hands, if there exists \maketitle and no \title, there comes an error
-
sectioning
- \section{content}\label{mark}
...
\ref{mark}
- section number is automatically assigned
- \section* produces an unnumbered section
- \subsection \subsubsection
\subsection* \subsubsection*
-
proclamations
- defined in the preamble with \newtheorem
- theorem number is automatically assigned
- \begin{theorem}\label{mark}
content
\end{theorem}
...ref{mark}
-
references
-
examples
- an article
in a journal
- \bibitem{sf90}
soo-key foo,
\emph{lattice constructions},
ph.d. thesis,
university of winnebago, winnebago, mn,
december, 1990.
- a book
- \bibitem{gm68}
george~a. menuhin,
\emph{universal algebra}.
d.~van nostrand, princeton, 1968.
\bibitem{
- a ph.d. thesis
- \bibitem{em57}
ernest~t. moynahan,
\emph{on a problem of m. stone},
acta math. acad. sci. hungar. \textbf{8} (1957),
455--460.
- a technical report
- \bibitem{em57a}
ernest~t. moynahan,
\emph{ideals and congruence relations in
lattices.} ii,
magyar tud. akad. mat. fiz. oszt. k\"{o}zl.
\textbf{9} (1957), 417--434.
- you have to arrange the references in thebibliography environment to see them
latex only takes care of the numbering and the citations in the text
-
on using latex
-
error messages
- typographical errors
- errors in mathematical formulas or in the formatting of the text
- errors in your instructions to latex
- tip
typeset often
-
logical and visual design
- you should concentrate on what you say
let latex take care of the visual design