Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Keeping tables/figures close to where they are mentioned

\usepackage{amsfonts}
\usepackage{pdfpages}
\usepackage[hidelinks,unicode]{hyperref} %- to zeby byly polskie znaki w bookmarkach + konwersja na utf8
%\usepackage[hidelinks]{hyperref}
\usepackage{etoolbox}
\usepackage[T1,OT4]{fontenc}

\usepackage{graphicx}

\usepackage{hypcap}

\usepackage{anysize}
\marginsize{3.5cm}{2.5cm}{2cm}{2cm}

\let\origfigure\figure
\let\endorigfigure\endfigure

\renewcommand\baselinestretch{1.5}
\patchcmd{\thebibliography}{*}{}{}{}

\makeatletter
\g@addto@macro\@floatboxreset\centering
\makeatother


\SetSectionFormatting[breakbefore]{chapter} {24pt plus5pt minus2pt}
{\FormatHangHeading{\fontsize{17}{17}\textbf}} {10pt plus3pt}
\SetSectionFormatting{section} {24pt plus5pt minus2pt}
{\FormatHangHeading{\fontsize{14}{14}\textbf}} {10pt plus3pt}
\SetSectionFormatting{subsection} {24pt plus5pt minus2pt}
{\FormatHangHeading{\fontsize{12}{12}\textbf}} {10pt plus3pt}

\makeatletter
\pretocmd{\tableofcontents}{%
  \if@openright\cleardoublepage\else\clearpage\fi
  \pdfbookmark[0]{\contentsname}{toc}%
}{}{}%
\makeatother

\begin{document}
%\language 12345 % wyłącza dzielenie wyrazów
\pagenumbering{Alph}
\begin{titlepage}
\pdfbookmark{Strona tytułowa}{}
\includepdf[pages=1-]{strona_tytulowa.pdf}
\end{titlepage}
\pagenumbering{arabic}
\tableofcontents
\input{tresc.tex}
\input{bibliografia.tex}
\end{document}

tresc.tex:

\chapter{Bzdety}\label{rozdzial-bzdety}
W rozdziale \ref{rozdzial-bzdety} ze strony \pageref{rozdzial-bzdety} znajduje się obrazek \ref{obraz-jesien} na stronie \pageref{obraz-jesien}.

The first paragraph.

\begin{figure}
    \includegraphics[scale=1]{a.jpg}
    \caption[Opcjonalny skrócony opis do spisu obrazków]{Opis}
    \label{obraz-jesien}
\end{figure}


The second paragraph.

I expected something like:

The first paragraph.

[image]
[caption]

The second paragraph.

I got:

The first paragraph.    

The second paragraph.

[image]
[caption]

Image is at the very center of next page. How can I fix this?

share|improve this question

marked as duplicate by Martin Scharrer Jul 16 '11 at 10:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
This is not a minimal working example (MWE). It will be easier to help you if you provide one. –  N.N. Jul 16 '11 at 10:06
    
This is the most duplicated question ever. Should the linked solutions not helped you please edit your question to state why and flag it for moderator attention. –  Martin Scharrer Jul 16 '11 at 10:07

1 Answer 1

up vote 1 down vote accepted

Use a placement specifier, e.g. you can use [h] as in the following:

\begin{figure}[h]
... figure contents ...
\end{figure}
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.