Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 3.35 KB | None | 0 0
  1. \documentclass{article}
  2.  
  3. \usepackage{multirow}
  4. \usepackage{graphicx}
  5. \usepackage{cleveref}
  6.  
  7. \begin{document}
  8.  
  9. \title{\LaTeX{} Lecture 3}
  10. \author{Sanjana Shemonti}
  11. \maketitle
  12.  
  13.  
  14. \section{Tables}\label{sec:1}
  15. \noindent
  16. A simple table:
  17. \begin{table}[!tbh]
  18.    \centering
  19.        \begin{tabular}{|l|l|}
  20.        \hline
  21.        \textbf{Ice Cream Flavor} & \textbf{Count}\\
  22.        \hline
  23.        Chocolate Chips & 2\\
  24.        Butterscotch & 3\\
  25.        Vanilla Blackforest & 1\\
  26.        \hline
  27.        \end{tabular}
  28.    \label{tab:1}
  29.    \caption{\textbf{This is a very simple table}}
  30. \end{table}
  31.  
  32.  
  33. \noindent
  34. A table with a row spanning multiple columns:
  35. \begin{table}[!tbh]
  36.    \centering
  37.        \begin{tabular}{|l|l|}
  38.        \hline
  39.        \multicolumn{2}{|c|}{\textbf{IceCream Fest}}\\ %mane 2 ta col eksathe korlo. kono & dey nai
  40. %\multicolumn{num_cols}{alignment}{contents}.
  41.         \hline
  42.         \textbf{Ice Cream Flavor} & \textbf{Count}\\
  43.        \hline
  44.        Chocolate Chips & 2\\
  45.        Butterscotch & 3\\
  46.        Vanilla Blackforest & 1\\
  47.        \hline
  48.        \end{tabular}
  49.    \label{tab:2}
  50.    \caption{\textbf{This is a multicolumn table}}
  51. \end{table}
  52.  
  53. \noindent
  54. A table with a column spanning multiple rows (needs the multirow package):
  55. \begin{table}[!tbh]
  56.    \centering
  57.        \begin{tabular}{|l|l|l|}
  58.        \hline
  59.        \multirow{2}{*}{Chocolate} & \textbf{Snickers} & \textbf{KitKat}\\ %\multirow{''num_rows''}{''width''}{''contents''} || (* for the width means the content's natural width).
  60.  
  61.         \cline{2-3} %The \cline command draws horizontal lines across the columns specified, beginning in column i and ending in column j, which are identified in the mandatory argument.
  62.         & 2 & 3\\
  63.         \hline
  64.         \end{tabular}
  65.    \label{tab:3}
  66.    \caption{This is a multirow table}
  67. \end{table}
  68.  
  69.  
  70. \newpage
  71. \begin{table}[ht]
  72.    \caption{Multi-column and multi-row table}
  73.    \begin{center}
  74.        \begin{tabular}{ccc}
  75.            \hline
  76.            \multicolumn{2}{c}{\multirow{2}{*}{Multi-col-row}}&X\\
  77.            \multicolumn{2}{c}{} & X\\
  78.            \hline
  79.            \vline{} X & \vline{} X & \vline{} X\\
  80.            \hline
  81.        \end{tabular}
  82.    \end{center}
  83.    \label{tab:multicol}
  84. \end{table}
  85.  
  86. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  87. \section{Figures}
  88. Figures need graphicx package. We can see the BUET logo in Figure~\ref{fig:buetlogo}.
  89. If you need to draw your own figure either use \textbf{tikz} package,
  90. or use dedicated software to draw images for \LaTeX{} like \textbf{LatexDraw} or \textbf{XFig}.
  91.  
  92. \begin{figure}[h]
  93. \centering
  94. \includegraphics[width=0.3\textwidth]{buetlogo.png}
  95. \caption{BUET logo.}
  96. \label{fig:buetlogo}
  97. \end{figure}
  98.  
  99.  
  100. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  101. \section{Hardcoded Bib}
  102. Various rules of writing are explained in \cite{eos}.
  103. \begin{thebibliography}{9}
  104. \bibitem{eos}
  105. W. Strunk and E.B. White\textit{The Elements of Style}.
  106. \bibitem{mw}
  107. D. Knuth.\textit{Mathematical Writing}.
  108. \end{thebibliography}
  109.  
  110. Another bibliography from the .bib file \cite{bib1}
  111. %\bibliographystyle{plain}
  112. %\bibliographystyle{acm}
  113. \bibliographystyle{ieeetr}
  114. %\bibliographystyle{alpha}
  115. \bibliography{l3}
  116.  
  117. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement