Inserting a Figure into a Latex Document

  • Context: LaTeX 
  • Thread starter Thread starter EngWiPy
  • Start date Start date
  • Tags Tags
    Figure Latex
Click For Summary

Discussion Overview

The discussion revolves around how to include multiple figures on the same page in a LaTeX document, specifically addressing issues with figures from MATLAB that are occupying separate pages. Participants explore various positioning options and commands within LaTeX.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant inquires about including two figures on the same page in LaTeX, noting that figures from MATLAB are each occupying a separate page.
  • Another participant suggests using positioning specifiers such as [h] and the override [!] construct to control figure placement, while acknowledging the challenges of getting figures to appear as desired.
  • A later reply requests clarification on the positioning construct and asks for a sample code to illustrate its use.
  • A participant provides a sample code snippet for inserting figures, explaining the various positioning specifiers available in LaTeX and their intended functions.
  • One participant reports that despite trying the suggested positioning options, the figures still do not appear in the desired locations, but mentions that using the scale attribute in the figure environment achieves the desired outcome.

Areas of Agreement / Disagreement

Participants express differing experiences with LaTeX's figure placement, with some agreeing on the difficulty of controlling figure positions while others find success with specific attributes. No consensus is reached on a single solution for the figure placement issue.

Contextual Notes

Participants note that LaTeX has internal controls that may override user-specified positioning, leading to uncertainty about the effectiveness of various commands. The discussion reflects a range of experiences and approaches to figure placement.

Who May Find This Useful

This discussion may be useful for individuals working with LaTeX who are looking to include multiple figures on the same page, particularly those encountering similar challenges with figure placement from MATLAB.

EngWiPy
Messages
1,361
Reaction score
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
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.
 
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
 
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
 
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 environment which does what I want exactly.

Thank you.

Regards
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
9K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 13 ·
Replies
13
Views
2K