This is an example of a typical figure environment to load an image and what each line is used for:
Command(s) | Notes |
---|---|
\begin{figure}[htbp!] |
The beginning of the figure environment. The [htbp!] is explored in left section. |
|
To make your image center-aligned |
|
This is the line that calls your image. Make sure you have uploaded your image into the file tree if you're using Overleaf. It is important that your image file name is only one word, you may use hyphens but no spaces. Scaling is optional, do take note that if you scale it too large, it will not appear in your document at all. |
|
Optional: If you want to add a caption |
|
Optional: For easy cross-referencing, it's a good idea to add a label. This is an internal label and will not appear in the final document. |
\end{figure} |
As "figure" is an environment, you have to begin and end it. |
Here's an example of how the code would look like if you wanted to wrap text around a figure. Note that you need to load the wrapfig package in the preamble.
Command(s) | Notes |
---|---|
|
Note that you do not have to contain this in a The |
Positioning of figures in LaTeX can be very complicated and frustrating. Here's a brief overview of the various commands used to control positioning of figures.
Command(s) | Notes |
---|---|
h |
Place the float here, i.e. approximately at the same point it occurs in the source text (however it may not appear exactly at the spot) |
t |
Position at the top of the page |
b |
Position at the bottom of the page |
p |
Put on a special page for floats only. |
! |
Use in conjunction with other parameters to override internal parameters LaTeX pre-programmed float positions |
H |
Requires the float package. This works similar to h! but is better at implementing, it is prone to errors if used frequently though. |
You are expected to comply with University policies and guidelines namely, Appropriate Use of Information Resources Policy, IT Usage Policy and Social Media Policy. Users will be personally liable for any infringement of Copyright and Licensing laws. Unless otherwise stated, all guide content is licensed by CC BY-NC 4.0.