Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 6.07 KB | None | 0 0
  1. \documentclass[10pt]{article} %default 10pt, can use 10-12 pt
  2.  
  3. \usepackage{amsmath}
  4. %/usr/share/texlive/texmf-dist/tex/context/base/supp-pdf.mkii
  5. \setcounter{section}{-1} %for start section 0
  6.  
  7. %https://en.wikibooks.org/wiki/LaTeX/Counters
  8.  
  9. \begin{document}
  10. \title{\LaTeX{} Lecture 2}
  11. \date{}
  12. \maketitle
  13.  
  14. \section*{Footnote} %\section*{Name} %no numbering
  15. This line has a footnote.\footnote{A sample footnote}
  16.  
  17. \section{Font Size}
  18.  
  19. \subsection{Predefined Sizes}
  20. {\tiny This is in tiny fontsize.}\\
  21. {\scriptsize This is in script fontsize.}\\
  22. {\footnotesize This is in footnotesize fontsize.}\\
  23. {\small This is in small fontsize.}\\
  24. {\normalsize This is in normal fontsize.}\\
  25. {\large This is in large fontsize.}\\
  26. {\Large This is in Large fontsize.}\\
  27. {\LARGE This is in LARGE fontsize.}\\
  28. {\huge This is in huge fontsize.}\\
  29. {\Huge This is in Huge fontsize.}
  30.  
  31.  
  32. Or use:
  33. \begin{small}
  34. hey I am small!!
  35. \end{small}
  36.  
  37. \subsection{Custom Size}
  38. {   %\fontsize{<size>}{<line space>}
  39. \fontsize{100pt}{400pt}\selectfont
  40. This is ridiculously large (4cm size, 1cm line space). klajsdkla sdkla dalkdalkdjalkd jalk jlk jalkd jasldkjalk ajlka dkhkdj ahdkjahdkjaskjahakjsd
  41. }
  42.  
  43. \section{Changing Fonts}
  44. {
  45.     \fontencoding{T1}
  46.     \fontfamily{phv}
  47.     \fontseries{m}
  48.     \fontshape{it}
  49.     \selectfont
  50.     This is Helvetica in medium series, italic. Check out some other options from Wikibook.\\
  51. }
  52. {
  53.     \fontencoding{\encodingdefault}
  54.     \fontfamily{\familydefault}
  55.     \fontseries{\seriesdefault}
  56.     \fontshape{\shapedefault}
  57.     \selectfont
  58.     Back to the defaults.\\
  59. }
  60. {
  61.     \usefont{T1}{phv}{m}{it}Back to Helvetica, but with different syntax.
  62. }
  63.  
  64. \section{Verbatim}
  65. Verbatim is used when you want to output something word for word as it is without any interpretation.\\
  66. This is inline verbatim: \verb|!@#$\/%^&*|.\\~\\ %newline just dhong kore
  67. This is block level verbatim:
  68. \begin{verbatim}
  69. !@#$%^&*
  70. \end{verbatim}
  71.  
  72. \section{Mathematical Symbols}
  73. It is better to include the \textbf{amsmath} or the \textbf{mathtools} package before writing mathematical symbols.
  74. Many symbols will actually work without them, but some will require either one of the packages.
  75. We discussed a handful of symbols in class, if you need to use more checkout the \LaTeX{} Wikibook.
  76.  
  77. \subsection{A Simple Example}
  78. This is a simple equation: a + a = 2a\\
  79. This is a simple equation: $a + a = 2a$\\
  80. \\~\\
  81. The equation in first line is in normal text, whereas the one in the second line is in a mathematical environment.
  82.  
  83. \subsection{Mathematical Environments}
  84. Shorthand for mathematical environment:
  85.  
  86. math (inline): \$ \ldots \$ or \textbackslash ( \ldots \textbackslash )\\
  87. displaymath (block level): \$\$ \ldots \$\$ or \textbackslash [ \ldots \textbackslash ]\\
  88. equation
  89.  
  90. \subsection{Summation and Indices}
  91. Inline summation: $\sum_{i=0}^{n-1}a_{i+1}$\\
  92. Inline summation with displaystyle: $\displaystyle\sum_{i=0}^na_i$\\
  93. Summation in block level math:
  94. $$\sum_{i=0}^na_i$$
  95. Summation in equation:
  96. \begin{equation}  %change with equation*
  97. \sum_{i=0}^na_i
  98. \end{equation}
  99.  
  100. \subsection{Miscellaneous}
  101. Change epsilon to phi, Phi, and varphi in the following equation observe the results.
  102. \begin{displaymath}
  103.     \forall x \in X, \quad \qquad \exists y \leq \epsilon
  104.     \forall x \in X, \quad \qquad \exists y \leq \phi
  105.     \forall x \in X, \quad \qquad \exists y \leq \Phi
  106.     \forall x \in X, \quad \qquad \exists y \leq \varphi
  107. \end{displaymath}
  108. %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
  109. \\~\\
  110. Use operator commands when available, otherwise use textrm/mathrm.
  111. \begin{displaymath}
  112.     \cos2\theta = \cos^2\theta - \sin^2\theta
  113. \end{displaymath}
  114. \begin{displaymath} %cos2@ 2 ar cos gayer sathe lege thake
  115.     \textrm{cos}2\theta = \mathrm{cos}^2\theta - \textrm{sin}^2\theta
  116. \end{displaymath}
  117. \\~\\
  118. Limits and inifinity:
  119. \begin{displaymath}
  120.     \lim_{x \to \infty} \exp(-x) = 0
  121. \end{displaymath}
  122. \\~\\
  123. Fractions:
  124. \begin{displaymath}
  125.     \frac{a}{b}
  126. \end{displaymath}
  127. \\~\\
  128. Binomoals:
  129. \begin{displaymath}
  130.     \binom{n}{k}
  131. \end{displaymath}
  132. \\~\\
  133. Times:
  134. \begin{displaymath}
  135.     a \times b
  136. \end{displaymath}
  137. \\~\\
  138. $n$th root:
  139. \begin{displaymath}
  140.     \sqrt[n]{a} \\~\\
  141.     \sqrt{a}
  142. \end{displaymath}
  143. \\~\\
  144. Mods and equivalence:
  145. \begin{displaymath}
  146.     a \bmod b, \quad a \pmod b, \quad a \equiv b
  147. \end{displaymath}
  148. \\~\\
  149. Integrals:
  150. \begin{displaymath}
  151.     \int_a^b \qquad 2
  152. \end{displaymath}
  153. \\~\\
  154. Set operations:
  155. \begin{displaymath}
  156.     a \cap b, \quad a \cup b, \quad a \bigcap b, \quad a \bigcup b
  157. \end{displaymath}
  158. \\~\\
  159. Plus minus:
  160. \begin{displaymath}
  161.     a \pm 5, \quad a \mp 5
  162. \end{displaymath}
  163.  
  164. \subsection{Automatic Sizing of Parentheses/Braces/Brackets}
  165. Compare the following two fractions:
  166. \begin{displaymath}
  167.     (\frac{a}{b})
  168. \end{displaymath}
  169. \begin{displaymath}
  170.     \left(\frac{a}{b}\right)
  171. \end{displaymath}
  172.  
  173. \begin{multline*} %star er significance ki? equation number deoa ma deoa
  174. a^2 + b^2 + 2 + 5 + a^2 + b^2 + 2 + 5 + a^2 + b^2 + 2 + 5 + a^2 + b^2 + 2 + 5=\\
  175. a^2+  b^2+a^2 +b^2 + 2 + 5 + a^2 +  \\
  176. b^2 + 2 + 5 + a^2 + b^2 + 2 + 5 + a^2 + b^2 + 2 + 5
  177. \end{multline*} %newline sign dia koi break korbe boila deoa hoy
  178.  
  179. \subsection{Matrices}
  180. \begin{equation}
  181.     \begin{matrix}
  182.         1 & 0 & 0\\
  183.         0 & 1 & 0\\
  184.         0 & 0 & 1
  185.     \end{matrix}   
  186. \end{equation}
  187. \begin{equation}
  188.     \begin{matrix}
  189.         a & \dots & z\\
  190.         \vdots & \ddots & \vdots\\
  191.         z & \dots & z
  192.     \end{matrix}   
  193. \end{equation}
  194.  
  195. \begin{equation}
  196. x = \left\{
  197. \begin{array}{cc}
  198.     -1 & \text{if }  x < 0\\
  199.     0 & \text{if }  x = 0\\
  200.     +1 & \text{if } x > 0
  201. \end{array}
  202. \right. %necessary to enclose the left
  203. \end{equation}
  204.  
  205. \begin{eqnarray*}
  206. a & = & b+c \\
  207. & = & c+d\\
  208. & = & e+e\\
  209. & = & n\\
  210. \end{eqnarray*} %omit stars
  211.  
  212. \begin{equation*}
  213. \begin{array}{lll}
  214. a & = & b+c \\
  215.  & = & c+d\\
  216. & = & e+e\\
  217. & = & n\\
  218. \end{array}
  219. \end{equation*}
  220.  
  221. \begin{equation*}
  222. X =
  223. \begin{bmatrix}
  224. 1 & \dots & 3 \\
  225. \vdots  & \ddots  & \vdots \\
  226. 7 & \dots & 9
  227. \end{bmatrix}
  228. \end{equation*}
  229.  
  230.  
  231. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement