Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass[10pt]{article} %default 10pt, can use 10-12 pt
- \usepackage{amsmath}
- %/usr/share/texlive/texmf-dist/tex/context/base/supp-pdf.mkii
- \setcounter{section}{-1} %for start section 0
- %https://en.wikibooks.org/wiki/LaTeX/Counters
- \begin{document}
- \title{\LaTeX{} Lecture 2}
- \date{}
- \maketitle
- \section*{Footnote} %\section*{Name} %no numbering
- This line has a footnote.\footnote{A sample footnote}
- \section{Font Size}
- \subsection{Predefined Sizes}
- {\tiny This is in tiny fontsize.}\\
- {\scriptsize This is in script fontsize.}\\
- {\footnotesize This is in footnotesize fontsize.}\\
- {\small This is in small fontsize.}\\
- {\normalsize This is in normal fontsize.}\\
- {\large This is in large fontsize.}\\
- {\Large This is in Large fontsize.}\\
- {\LARGE This is in LARGE fontsize.}\\
- {\huge This is in huge fontsize.}\\
- {\Huge This is in Huge fontsize.}
- Or use:
- \begin{small}
- hey I am small!!
- \end{small}
- \subsection{Custom Size}
- { %\fontsize{<size>}{<line space>}
- \fontsize{100pt}{400pt}\selectfont
- This is ridiculously large (4cm size, 1cm line space). klajsdkla sdkla dalkdalkdjalkd jalk jlk jalkd jasldkjalk ajlka dkhkdj ahdkjahdkjaskjahakjsd
- }
- \section{Changing Fonts}
- {
- \fontencoding{T1}
- \fontfamily{phv}
- \fontseries{m}
- \fontshape{it}
- \selectfont
- This is Helvetica in medium series, italic. Check out some other options from Wikibook.\\
- }
- {
- \fontencoding{\encodingdefault}
- \fontfamily{\familydefault}
- \fontseries{\seriesdefault}
- \fontshape{\shapedefault}
- \selectfont
- Back to the defaults.\\
- }
- {
- \usefont{T1}{phv}{m}{it}Back to Helvetica, but with different syntax.
- }
- \section{Verbatim}
- Verbatim is used when you want to output something word for word as it is without any interpretation.\\
- This is inline verbatim: \verb|!@#$\/%^&*|.\\~\\ %newline just dhong kore
- This is block level verbatim:
- \begin{verbatim}
- !@#$%^&*
- \end{verbatim}
- \section{Mathematical Symbols}
- It is better to include the \textbf{amsmath} or the \textbf{mathtools} package before writing mathematical symbols.
- Many symbols will actually work without them, but some will require either one of the packages.
- We discussed a handful of symbols in class, if you need to use more checkout the \LaTeX{} Wikibook.
- \subsection{A Simple Example}
- This is a simple equation: a + a = 2a\\
- This is a simple equation: $a + a = 2a$\\
- \\~\\
- The equation in first line is in normal text, whereas the one in the second line is in a mathematical environment.
- \subsection{Mathematical Environments}
- Shorthand for mathematical environment:
- math (inline): \$ \ldots \$ or \textbackslash ( \ldots \textbackslash )\\
- displaymath (block level): \$\$ \ldots \$\$ or \textbackslash [ \ldots \textbackslash ]\\
- equation
- \subsection{Summation and Indices}
- Inline summation: $\sum_{i=0}^{n-1}a_{i+1}$\\
- Inline summation with displaystyle: $\displaystyle\sum_{i=0}^na_i$\\
- Summation in block level math:
- $$\sum_{i=0}^na_i$$
- Summation in equation:
- \begin{equation} %change with equation*
- \sum_{i=0}^na_i
- \end{equation}
- \subsection{Miscellaneous}
- Change epsilon to phi, Phi, and varphi in the following equation observe the results.
- \begin{displaymath}
- \forall x \in X, \quad \qquad \exists y \leq \epsilon
- \forall x \in X, \quad \qquad \exists y \leq \phi
- \forall x \in X, \quad \qquad \exists y \leq \Phi
- \forall x \in X, \quad \qquad \exists y \leq \varphi
- \end{displaymath}
- %Most spaces and line breaks do not have any significance, as all spaces are either derived logically from the mathematical expressions, or have to be specified with special commands such as \quad ~ \qquad means two \quad
- \\~\\
- Use operator commands when available, otherwise use textrm/mathrm.
- \begin{displaymath}
- \cos2\theta = \cos^2\theta - \sin^2\theta
- \end{displaymath}
- \begin{displaymath} %cos2@ 2 ar cos gayer sathe lege thake
- \textrm{cos}2\theta = \mathrm{cos}^2\theta - \textrm{sin}^2\theta
- \end{displaymath}
- \\~\\
- Limits and inifinity:
- \begin{displaymath}
- \lim_{x \to \infty} \exp(-x) = 0
- \end{displaymath}
- \\~\\
- Fractions:
- \begin{displaymath}
- \frac{a}{b}
- \end{displaymath}
- \\~\\
- Binomoals:
- \begin{displaymath}
- \binom{n}{k}
- \end{displaymath}
- \\~\\
- Times:
- \begin{displaymath}
- a \times b
- \end{displaymath}
- \\~\\
- $n$th root:
- \begin{displaymath}
- \sqrt[n]{a} \\~\\
- \sqrt{a}
- \end{displaymath}
- \\~\\
- Mods and equivalence:
- \begin{displaymath}
- a \bmod b, \quad a \pmod b, \quad a \equiv b
- \end{displaymath}
- \\~\\
- Integrals:
- \begin{displaymath}
- \int_a^b \qquad 2
- \end{displaymath}
- \\~\\
- Set operations:
- \begin{displaymath}
- a \cap b, \quad a \cup b, \quad a \bigcap b, \quad a \bigcup b
- \end{displaymath}
- \\~\\
- Plus minus:
- \begin{displaymath}
- a \pm 5, \quad a \mp 5
- \end{displaymath}
- \subsection{Automatic Sizing of Parentheses/Braces/Brackets}
- Compare the following two fractions:
- \begin{displaymath}
- (\frac{a}{b})
- \end{displaymath}
- \begin{displaymath}
- \left(\frac{a}{b}\right)
- \end{displaymath}
- \begin{multline*} %star er significance ki? equation number deoa ma deoa
- a^2 + b^2 + 2 + 5 + a^2 + b^2 + 2 + 5 + a^2 + b^2 + 2 + 5 + a^2 + b^2 + 2 + 5=\\
- a^2+ b^2+a^2 +b^2 + 2 + 5 + a^2 + \\
- b^2 + 2 + 5 + a^2 + b^2 + 2 + 5 + a^2 + b^2 + 2 + 5
- \end{multline*} %newline sign dia koi break korbe boila deoa hoy
- \subsection{Matrices}
- \begin{equation}
- \begin{matrix}
- 1 & 0 & 0\\
- 0 & 1 & 0\\
- 0 & 0 & 1
- \end{matrix}
- \end{equation}
- \begin{equation}
- \begin{matrix}
- a & \dots & z\\
- \vdots & \ddots & \vdots\\
- z & \dots & z
- \end{matrix}
- \end{equation}
- \begin{equation}
- x = \left\{
- \begin{array}{cc}
- -1 & \text{if } x < 0\\
- 0 & \text{if } x = 0\\
- +1 & \text{if } x > 0
- \end{array}
- \right. %necessary to enclose the left
- \end{equation}
- \begin{eqnarray*}
- a & = & b+c \\
- & = & c+d\\
- & = & e+e\\
- & = & n\\
- \end{eqnarray*} %omit stars
- \begin{equation*}
- \begin{array}{lll}
- a & = & b+c \\
- & = & c+d\\
- & = & e+e\\
- & = & n\\
- \end{array}
- \end{equation*}
- \begin{equation*}
- X =
- \begin{bmatrix}
- 1 & \dots & 3 \\
- \vdots & \ddots & \vdots \\
- 7 & \dots & 9
- \end{bmatrix}
- \end{equation*}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement