Figures
- In order to include figures, the graphicx package needs to be imported. It can be done by the following command
\usepackage{graphicx}
- LaTeX supports the following image formats, .png, .jpg and .eps
- To include a figure in your file, the following is needed
-
- figure environment
- \includegraphics{image_name} command
- Note: Extension of the image is not necessary and the image should be saved in the same folder as the .tex file.
\begin{figure}
\includegraphics[options]{image_name}
\caption{figure_caption}
\end{figure}
- options: The following options can be used to customize the figure object,
-
- width = x - To change the width of the image to x
- height = x - To change the height of the image to x
- scale = x - To scale the image by x factor (both height and width will be scaled)
- angle = x - To rotate the image by x degrees
- trim = l b r t, clip = true|false - To trim the image by a desired factor ( l: left, b: bottom, r: right, t: top), clip has to be made equal to true for trim to work
- caption: To add a caption to the image
Tables
- To include a table in your file, the tabular environment is needed. The syntax is as follows,
\begin{tabular} {l c r}
1 & 2 & 3 \
4 & 5 & 6 \
\end{tabular}
This command generates the following table
1 2 3
4 5 6
- The {} following the tabular environment define the number of columns and their orientation in the table. For example,
{l c r} creates 3 columns, left aligned, centrally aligned and right aligned respectively.
- To add more columns, \begin{tabular} {l c r c r l...} command can be used.
- To separate the columns by lines, the following can be done,
-
- \begin{tabular} {l || c || r} for double lines
- \begin{tabular} {l |c | r} for single lines.