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 \item • Thing 2 version appeared in 1978). Leslie Lamport was responsible for to express the sets of real numbers (R or R), integers (Z or Z), A Thing 2 creating L TEX a more user friendly version of TEX. A team of rational numbers (Q or Q), and natural numbers (N or N). A A L TEX programmers created the current version, L TEX 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] = fx 2 R : x > 0 and x ≤ 1g. (Without the \text In properly typeset mathematics variables appear in italics command it treats \and" as three variables: \item (e.g., f(x) = x2 + 2x − 3). The exception to this rule is Thing 1 1. Thing 1 (0; 1] = fx 2 R : x > 0andx ≤ 1g.) 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 mathematical 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 · Equations division symbol \div ÷ Equations are mathematical expressions that are given their like\\ division (slash) / = circle plus \oplus ⊕ own line and are centered on the page. These are usually used this. circle times \otimes ⊗ for important equations that deserve to be showcased on their This compiles own line or for large equations that cannot fit inline. To equal = = like not equal \ne 6= produce an inline expression, place the mathematical this. expression between the symbols and . Typing less than < < \[ \] Use \noindent to prevent a paragraph from indenting. \[x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\] yields greater than > > p less than or equal to \le ≤ −b ± b2 − 4ac Comments x = : greater than or equal to \ge ≥ 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 1 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 + ··· fraction \frac{a}{b} a I want this $\displaystyle \sum_{n=1}^{\infty} Delimiters pb \frac{1}{n}$, not this $\sum_{n=1}^{\infty} description command output square root \sqrt{x} px \frac{1}{n}$. yields parentheses (x) (x) nth root \sqrt[n]{x} n x 1 brackets [x] [x] exponentiation a^b ab X 1 P1 1 I want this , not this : subscript a n n=1 n curly braces \{x\} fxg a_b b n=1 To make your delimiters large enough to fit the content, use absolute value |x| jxj 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 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 | j derivative \frac{df}{dx} composition \circ ◦ dx does not divide \not | 6 j 0 piecewise |x|= derivative \f' f div \operatorname{div} div function \begin{cases} ( \frac{\partial f} @f x x ≥ 0 partial derivative mod \mod mod x & x\ge 0\\ jxj = {\partial x} @x greatest common divisor \gcd gcd -x & x<0 −x x < 0 Z integral \int ceiling \lceil x \rceil dxe \end{cases} ZZ floor \lfloor x \rfloor bxc Greek and Hebrew letters double integral \iint Geometry and trigonometry command output command output ZZZ 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!1 1 triangle \triangle ABC 4ABC \delta δ \xi ξ X summation \sum_{n=1}^{\infty}a_n an segment \overline{AB} AB \epsilon \zeta ζ n=1 sine \sin sin \varepsilon " \Delta ∆ 1 Y cosine \cos cos \eta η \Gamma Γ product \prod_{n=1}^{\infty}a_n an tangent \tan tan \gamma γ \Lambda Λ n=1 cotangent \cot cot \iota ι \Omega Ω Logic secant \sec sec \kappa κ \Phi Φ cosecant \csc csc \lambda λ \Pi Π description command output inverse sine \arcsin arcsin \mu µ \Psi Ψ not \sim ∼ inverse cosine \arccos arccos \nu ν \Sigma Σ and \land ^ inverse tangent \arctan arctan \omega ! \Theta Θ or \lor _ \phi φ \Upsilon Υ if...then \to ! Symbols (in text mode) ' Ξ if and only if \leftrightarrow $ \varphi \Xi The followign symbols do not have to be surrounded by dollar \pi π \aleph @ logical equivalence \equiv ≡ therefore \therefore signs. \psi \beth i ) there exists \exists 9 description command output \rho ρ \daleth k for all \forall 8 dollar sign \$ $ \sigma σ \gimel j implies \Rightarrow ) percent \% % Set theory equivalent \Leftrightarrow , ampersand \& & description command output pound \# # set brackets \{1,2,3\} f1; 2; 3g Linear algebra backslash \textbackslash n element of \in 2 description command output left quote marks `` \ right quote marks " not an element of \not\in 62 vector \vec{v} ~v '' single left quote ` subset of \subset ⊂ vector \mathbf{v} v ` single right quote ' subset of \subseteq ⊆ norm ||\vec{v}|| jj~vjj ' hyphen X-ray not a subset of \not\subset 6⊂ \left[ X-ray en-dash pp. 5{15 contains \supset ⊃ \begin{array}{ccc} pp. 5--15 em-dash Yes|or no? contains \supseteq ⊇ 1 & 2 & 3 \\ 2 1 2 3 3 Yes---or no? union \cup [ matrix 4 & 5 & 6\\ 4 4 5 6 5 Resources intersection \cap \ 7 & 8 & 0 7 8 0 10 TUG: The TEX Users Group [ \end{array} CTAN: The Comprehensive T X Archive Network big union \bigcup_{n=1}^{10}A_n An E \right] A n=1 Handwriting-to-L TEX sites: Detexify, WebEquation 10 The Comprehensive LATEX Symbol List \ \left| big intersection \bigcap_{n=1}^{10}A_n An The Not So Short Introduction to LATEX 2" \begin{array}{ccc} n=1 Software that generates LATEX code: Mathematica, Maple, empty set \emptyset ; 1 & 2 & 3 \\ 1 2 3 GeoGebra power set \mathcal{P} P determinant 4 & 5 & 6 \\ 4 5 6 LATEX for the Mac: MacTEX minimum min 7 & 8 & 0 7 8 0 \min LATEX for the PC:T EXnicCenter and MiKTEX maximum max \end{array} \max LATEX online: ShareLaTeX, Overleaf, Sage supremum sup \right| \sup LATEX integration with Microsoft Office, Apple iWork, etc: infimum inf determinant \det(A) det(A) \inf 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.