Graphics, Figures & TablesPicture jumping to new Page

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
jlatex
Posts: 4
Joined: Wed Aug 03, 2011 9:22 pm

Picture jumping to new Page

Post by jlatex »

I'm trying to have 2 pictures vertically above one another.

Code: Select all

\documentclass{report}

\usepackage{graphicx}	%allows the inclusion of graphics
\usepackage[labelfont=bf, font={bf,small}, aboveskip=2pt,singlelinecheck=false]{caption}
\usepackage[top = 1.25in, bottom = 1.25in, left = 1.25in, right = 1.25in]{geometry}
\usepackage{setspace}
%\usepackage{showframe}


\newcommand{\pic}[2]
{\begin{figure}[!ht]
%setting picture border
\setlength\fboxsep{0pt}	%offset from edge of picture
\setlength\fboxrule{0.75pt}	%border size
\fbox{\includegraphics[width = 5.99in,height=3.97in]{#1}}
\caption{#2}
\end{figure}}

\begin{document}
\section{Section 1}
\subsection{Subsection 1}
Text goes here

\pagebreak
%newpage
%clearpage

\pic{Pic1}{Test Picture 1}
\pic{Pic2}{Test Picture 2}
\pic{Pic3}{Test Picture 3}

\end{document}
The first picture is always the only one on the page but the rest of the pictures seem to fit vertically above each other. It works if the pictures are smaller but they have to be that exact size. Any way to get this done?
Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10397
Joined: Mon Mar 10, 2008 9:44 pm

Picture jumping to new Page

Post by Stefan Kottwitz »

Hi,

if you don't like the pictures to float, perhaps don't use a figure environment.

There are some LaTeX lengths regarding figures you could tweak, listed here.

Stefan
LaTeX.org admin
Post Reply