Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{article}
- \usepackage{multirow}
- \usepackage{graphicx}
- \usepackage{cleveref}
- \begin{document}
- \title{\LaTeX{} Lecture 3}
- \author{Sanjana Shemonti}
- \maketitle
- \section{Tables}\label{sec:1}
- \noindent
- A simple table:
- \begin{table}[!tbh]
- \centering
- \begin{tabular}{|l|l|}
- \hline
- \textbf{Ice Cream Flavor} & \textbf{Count}\\
- \hline
- Chocolate Chips & 2\\
- Butterscotch & 3\\
- Vanilla Blackforest & 1\\
- \hline
- \end{tabular}
- \label{tab:1}
- \caption{\textbf{This is a very simple table}}
- \end{table}
- \noindent
- A table with a row spanning multiple columns:
- \begin{table}[!tbh]
- \centering
- \begin{tabular}{|l|l|}
- \hline
- \multicolumn{2}{|c|}{\textbf{IceCream Fest}}\\ %mane 2 ta col eksathe korlo. kono & dey nai
- %\multicolumn{num_cols}{alignment}{contents}.
- \hline
- \textbf{Ice Cream Flavor} & \textbf{Count}\\
- \hline
- Chocolate Chips & 2\\
- Butterscotch & 3\\
- Vanilla Blackforest & 1\\
- \hline
- \end{tabular}
- \label{tab:2}
- \caption{\textbf{This is a multicolumn table}}
- \end{table}
- \noindent
- A table with a column spanning multiple rows (needs the multirow package):
- \begin{table}[!tbh]
- \centering
- \begin{tabular}{|l|l|l|}
- \hline
- \multirow{2}{*}{Chocolate} & \textbf{Snickers} & \textbf{KitKat}\\ %\multirow{''num_rows''}{''width''}{''contents''} || (* for the width means the content's natural width).
- \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.
- & 2 & 3\\
- \hline
- \end{tabular}
- \label{tab:3}
- \caption{This is a multirow table}
- \end{table}
- \newpage
- \begin{table}[ht]
- \caption{Multi-column and multi-row table}
- \begin{center}
- \begin{tabular}{ccc}
- \hline
- \multicolumn{2}{c}{\multirow{2}{*}{Multi-col-row}}&X\\
- \multicolumn{2}{c}{} & X\\
- \hline
- \vline{} X & \vline{} X & \vline{} X\\
- \hline
- \end{tabular}
- \end{center}
- \label{tab:multicol}
- \end{table}
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \section{Figures}
- Figures need graphicx package. We can see the BUET logo in Figure~\ref{fig:buetlogo}.
- If you need to draw your own figure either use \textbf{tikz} package,
- or use dedicated software to draw images for \LaTeX{} like \textbf{LatexDraw} or \textbf{XFig}.
- \begin{figure}[h]
- \centering
- \includegraphics[width=0.3\textwidth]{buetlogo.png}
- \caption{BUET logo.}
- \label{fig:buetlogo}
- \end{figure}
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \section{Hardcoded Bib}
- Various rules of writing are explained in \cite{eos}.
- \begin{thebibliography}{9}
- \bibitem{eos}
- W. Strunk and E.B. White\textit{The Elements of Style}.
- \bibitem{mw}
- D. Knuth.\textit{Mathematical Writing}.
- \end{thebibliography}
- Another bibliography from the .bib file \cite{bib1}
- %\bibliographystyle{plain}
- %\bibliographystyle{acm}
- \bibliographystyle{ieeetr}
- %\bibliographystyle{alpha}
- \bibliography{l3}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement