A Quick Guide to LATEX
Total Page:16
File Type:pdf, Size:1020Kb
A quick guide to LATEX What is LATEX? Text decorations Lists LATEX(usually pronounced “LAY teck,” sometimes “LAH Your text can be italics (\textit{italics}), boldface You can produce ordered and unordered lists. teck,” and never “LAY tex”) is a mathematics typesetting (\textbf{boldface}), or underlined description command output program that is the standard for most professional (\underline{underlined}). \begin{itemize} mathematics writing. It is based on the typesetting program Your math can contain boldface, R (\mathbf{R}), or \item T X created by Donald Knuth of Stanford University (his first Thing 1 Thing 1 E blackboard bold, R (\mathbb{R}). You may want to used these unordered list • version appeared in 1978). Leslie Lamport was responsible for to express the sets of real numbers (R or R), integers (Z or Z), \item Thing 2 A • creating L TEX a more user friendly version of TEX. A team of rational numbers (Q or Q), and natural numbers (N or N). Thing 2 LATEX programmers created the current version, LATEX 2ε. To have text appear in a math expression use \text. \end{itemize} (0,1]=\{x\in\mathbb{R}:x>0\text{ and }x\le 1\} yields Math vs. text vs. functions \begin{enumerate} (0, 1] = x R : x > 0 and x 1 . (Without the \text In properly typeset mathematics variables appear in italics comman{d i∈t treats “and” as t≤hre}e variables: \item (e.g., f(x) = x2 + 2x 3). The exception to this rule is Thing 1 1. Thing 1 (0, 1] = x R : x > 0andx 1 .) ordered list predefined functions (−e.g., sin(x)). Thus it is important to { ∈ ≤ } \item 2. Thing 2 always treat text, variables, and functions correctly. See the Spaces and new lines Thing 2 difference between x and x, -1 and 1, and sin(x) and sin(x). \end{enumerate} There are two ways to present a ma−thematical expression— LATEX ignores extra spaces and new lines. For example, inline or as an equation. This sentence will look Symbols (in math mode) fine after it is compiled. Inline mathematical expressions The basics This sentence will look fine after it is compiled. description command output Inline expressions occur in the middle of a sentence. To Leave one full empty line between two paragraphs. Place \\ at addition + + produce an inline expression, place the math expression the end of a line to create a new line (but not create a new subtraction - $ between dollar signs ( ). For example, typing paragraph). plus or minus \pm − $90^{\circ}$ is the same as $\frac{\pi}{2}$ radians ± This multiplication (times) \times yields 90 is the same as π radians. × ◦ 2 compiles multiplication (dot) \cdot division symbol \div · Equations ÷ Equations are mathematical expressions that are given their like\\ division (slash) / / \oplus own line and are centered on the page. These are usually used this. circle plus circle times \otimes ⊕ for important equations that deserve to be showcased on their This compiles equal = =⊗ own line or for large equations that cannot fit inline. To like produce an inline expression, place the mathematical not equal \ne = this. less than < <∕ expression between the symbols \[ and \]. Typing Use \noindent to prevent a paragraph from indenting. \[x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\] yields greater than > > less than or equal to \le √ 2 b b 4ac Comments greater than or equal to \ge ≤ x = − ± − . ≥ 2a Use % to create a comment. Nothing on the line after the % will approximately equal to \approx ≈ Displaystyle be typeset. $f(x)=\sin(x)$ %this is the sine function infinity \infty ∞ To get full-sized inline mathematical expressions use yields f(x) = sin(x) dots 1,2,3,\ldots 1, 2, 3, . \displaystyle. Use this sparingly. Typing dots 1+2+3+\cdots 1 + 2 + 3 + a · · · I want this $\displaystyle \sum_{n=1}^{\infty} Delimiters fraction \frac{a}{b} b \frac{1}{n}$, not this $\sum_{n=1}^{\infty} description command output square root \sqrt{x} √x \frac{1}{n}$. yields parentheses (x) (x) nth root \sqrt[n]{x} √n x exponentiation a^b ab ∞ 1 1 brackets [x] [x] I want this , not this ∞ . subscript a_b a n n=1 n curly braces \{x\} x b n=1 { } absolute value |x| x ! " To make your delimiters large enough to fit the content, use | | Images them together with \right and \left. For example, natural log \ln(x) ln(x) \left\{\sin\left(\frac{1}{n}\right)\right\}_{n}^ logarithms \log_{a}b loga b You can put images (pdf, png, jpg, or gif) in your document. x They need to be in the same location as your .tex file when {\infty} produces exponential function e^x=\exp(x) e = exp(x) 1 ∞ degree \deg(f) deg(f) you compile the document. Omit [width=.5in] if you want sin . the image to be full-sized. n # $ %&n \begin{figure}[ht] Curly braces are non-printing characters that are used to \includegraphics[width=.5in]{imagename.jpg} gather text that has more than one character. Observe the \caption{The (optional) caption goes here.} differences between the four expressions x^2, x^{2}, x^2t, \end{figure} x^{2t} when typeset: x2, x2, x2t, x2t. Functions Calculus Number theory description command output description command output description command output maps to \to → df divides | composition \circ derivative \frac{df}{dx} does not divide \ndv | piecewise |x|= ◦ dx ∕ | derivative \f’ f ′ div \dv div function \begin{cases} x x 0 \frac{\partial f} 9f mod \mod mod x & x\ge 0\\ x = ≥ partial derivative greatest common divisor \gcd gcd | | x x < 0 {\partial x} 9x -x & x<0 '− ceiling \lceil x \rceil x integral \int \end{cases} floor \lfloor x \rfloor ⌈x⌉ * ⌊ ⌋ Greek and Hebrew letters double integral \iint Geometry and trigonometry command output command output ** description command output \alpha α \tau τ triple integral \iiint angle \angle ABC ∠ABC \beta β \theta θ *** limits \lim_{x\to \infty} lim degree 90^{\circ} 90◦ \chi χ \upsilon υ x →∞ triangle \triangle ABC ABC \delta δ \xi ξ ∞ △ \sum_{n=1}^{\infty}a_n segment \overline{AB} AB \epsilon * \zeta + summation an n=1 sine \sin sin \varepsilon ! \Delta ∆ ! ∞ cosine \cos cos \eta , \Gamma Γ \prod_{n=1}^{\infty}a_n product an tangent \tan tan \gamma - \Lambda Λ n=1 cotangent \cot cot \iota . \Omega Ω + secant \sec sec \kappa / \Phi Φ Logic cosecant \csc csc \lambda 0 \Pi Π inverse sine \arcsin arcsin \mu µ \Psi Ψ description command output inverse cosine \arccos arccos \nu 1 \Sigma Σ not \neg ∼ inverse tangent \arctan arctan \omega 2 \Theta Θ and \land ∧ \phi 3 \Upsilon Υ or \lor ∨ Symbols (in text mode) \varphi 4 \Xi Ξ if...then \implies → The followign symbols do not have to be surrounded by dollar \pi 5 \aleph if and only if \iff ↔ signs. \psi 6 \beth ℵ logical equivalence \equiv ℶ ≡ description command output \rho \daleth therefore \therefore 7 ℸ ∴ dollar sign \$ $ \sigma \gimel there exists \exists % %\ percent ג 8 for all \forall ∃ Set theory ∀ ampersand \& & pound \# # description command output Linear algebra set brackets \{1,2,3\} 1, 2, 3 backslash \textbackslash { } ‘‘ \ element of \in description command output left quote marks “ ∈ ’’ not an element of \not\in vector \vec{v} :v right quote marks ” ∕∈ ‘ subset of \subset vector \mathbf{v} v single left quote ‘ ⊂ ’ subset of \subseteq norm ||\vec{v}|| :v single right quote ’ not a subset of \not\subset ⊆ || || hyphen X-ray X-ray ∕⊂ \left[ contains \supset \begin{array}{ccc} en-dash pp. 5--15 pp. 5–15 ⊃ Yes---or no? contains \supseteq 1 & 2 & 3 \\ 1 2 3 em-dash Yes—or no? union \cup ⊇ ∪ matrix 4 & 5 & 6\\ 4 5 6 Resources intersection \cap 7 & 8 & 0 , 7 8 0 . ∩10 TUG: The TEX Users Group \end{array} - / big union \bigcup_{n=1}^{10}A_n An CTAN: The Comprehensive TEX Archive Network \right] A n=1 Handwriting-to-L TEX sites: Detexify, WebEquation (10 The Comprehensive LAT X Symbol List \left| E big intersection \bigcap_{n=1}^{10}A_n An The Not So Short Introduction to LATEX 2! \begin{array}{ccc} A n)=1 Software that generates L TEX code: Mathematica, Maple, empty set \emptyset 1 & 2 & 3 \\ 1 2 3 GeoGebra power set \mathcal{P} ∅ determinant 4 & 5 & 6 \\ 4 5 6 0 0 LATEX for the Mac: MacTEX minimum \min mP in 7 & 8 & 0 0 7 8 0 0 0 0 LATEX for the PC: TEXnicCenter and MiKTEX maximum \max max \end{array} 0 0 0 0 LATEX online: Overleaf, Sage supremum \sup sup \right| 0 0 LATEX integration with Microsoft Office, Apple iWork, etc: infimum \inf inf determinant \det(A) det(A) MathType, LATEXiT limit superior \limsup lim sup trace \operatorname{tr}(A) tr(A) limit inferior \liminf lim inf dimension \dim(V) dim(V ) Dave Richeson, Dickinson College, http://divisbyzero.com/ closure \overline{A} A.