Inserting a Figure into a Latex Document

In summary: To insert a figure, you can do something like:\begin{figure}[positioning_specifiers]\centering\vspace{2mm}\scalebox{0.5}{\includegraphics{figures.eps}}\caption{here is a caption}\label{fig:label}\end{figure}Everything here should be pretty straightforward. The positioning specifiers tell Latex how you want the picture positioned. However, it has internal controls, and usually ignores what you want because it thinks its better than you. Anyways, the controls are:[h]---Place the float here, i.
  • #1
EngWiPy
1,368
61
Hello,

I want to ask how to include 2 figures at the same page in a Latex document, because when I insert .eps figures from MATLAB, each occpies one page.

Regards
 
Physics news on Phys.org
  • #2
You can try using not only [h] (here), but also the override [!] construct. Check a little bit more on includegraphics documentation.

I will agree though, sometimes getting figures exactly where you want them can be a pain.
 
  • #3
minger said:
You can try using not only [h] (here), but also the override [!] construct. Check a little bit more on includegraphics documentation.

I will agree though, sometimes getting figures exactly where you want them can be a pain.

I didn't understand, what is the construct? and How to use it? Cab you show me a sample, please?

Regards
 
  • #4
To insert a figure, you can do something like:
Code:
	\begin{figure}[positioning_specifiers]
	\centering
	\vspace{2mm}
	\scalebox{0.5}{\includegraphics{figures.eps}}
	\caption{here is a caption}
	\label{fig:label}
	\end{figure}
Everything here should be pretty straightforward. The positioning specifiers tell Latex how you want the picture positioned. However, it has internal controls, and usually ignores what you want because it thinks its better than you. Anyways, the controls are:
[h]---Place the float here, i.e., at the same point it occurs in the source text.
[t]---Position at the top of the page.
---Position at the bottom of the page.
[p]---Put on a special page for floats only.
[!]---Override internal parameters Latex uses for determining `good' float positions

So, if you really want a picture at a certain point in the text, you can try
Code:
	\begin{figure}[!h]
But with latex, who knows
 
  • #5
Ok, I tried to use these things, but it places the figures in positions I don't want as you said. Anyway, I used the scale attribute in the figure enviroment which does what I want exactly.

Thank you.

Regards
 

1. How do I insert a figure into a Latex document?

To insert a figure into a Latex document, you can use the \includegraphics command and specify the file path of the desired image. For example, \includegraphics{image.png}. You will also need to use the \usepackage{graphicx} package in your document's preamble.

2. What file formats are supported for figures in Latex?

The most commonly supported file formats for figures in Latex are PNG, JPG, and PDF. However, you can also use EPS, SVG, and other vector formats by using additional packages or converting the file to a supported format.

3. How can I resize a figure in Latex?

You can resize a figure in Latex by using the \includegraphics command with additional options. For example, \includegraphics[width=0.5\textwidth]{image.png} will resize the figure to half of the document's width. You can also specify the height, scale, or use relative sizes such as \textwidth or \textheight.

4. Can I add a caption and label to my figure in Latex?

Yes, you can add a caption and label to your figure in Latex by using the \caption and \label commands after the \includegraphics command. The label can be used for referencing the figure within the document, and the caption will appear below the figure with an automatic figure number.

5. How can I place my figure in a specific location within the document?

You can place your figure in a specific location within the document by using the \begin{figure}[placement] command. The placement options include h (here), t (top of page), b (bottom of page), p (separate page), and ! (override default placement). For example, \begin{figure}[h] will place the figure at the current location in the document.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
390
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
795
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
980
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
Back
Top