
Quero que uma imagem fique no topo da página e que a nova seção comece abaixo da imagem na mesma página. Tentei posicionar a imagem usando [t], mas nada muda. A imagem aparece no centro da página e a nova seção começa na nova página... Como posso corrigir isso?
Aqui está o meu código:
\documentclass[12pt,a4paper]{article}
\usepackage[MeX]{polski}
\usepackage{lmodern}
\usepackage{inputenc}
\usepackage{fontenc}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts,amsthm}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage[tight,footnotesize]{subfigure}
\usepackage{listings}
\usepackage{courier}
\usepackage{fixltx2e}
\usepackage{xcolor}
\usepackage[section]{placeins}
\usepackage[small]{caption}
\usepackage[polish]{babel}
\usepackage{advdate}
\usepackage[colorlinks=true,citecolor=blue,linkcolor=blue,urlcolor=blue]{hyperref}
\usepackage[top=2cm,left=2cm,bottom=2cm,right=2cm]{geometry}
\begin{document}
\title{zzz}
\author{zzz}
\date{\today}
\maketitle
\section{A}\label{sec:a}
\begin{figure}[h]
\makebox[\textwidth][c]{\includegraphics[width=1\textwidth]{a.jpg}}
\caption{xxxx}
\label{label}
\end{figure}
\begin{figure}[h]
\makebox[\textwidth][c]{\includegraphics[width=1\textwidth]{a.jpg}}
\caption{xxxx}
\label{label}
\end{figure}
\begin{figure}[ht]
\makebox[\textwidth][c]{\includegraphics[width=1\textwidth]{a.jpg}}
\caption{xxxx}
\label{label}
\end{figure}
\begin{figure}[ht]
\makebox[\textwidth][c]{\includegraphics[width=1\textwidth]{a.jpg}}
\caption{xxxx}
\label{label}
\end{figure}
\section{B}\label{sec:b}
\end{document}
Responder1
Depois:
reduzindo seu exemplo ao mínimo (vou mantê-lo
lmodern
porque não possui as mesmas métricas do Computer Modern);substituindo all
\begin{figure}[h]
por\begin{figure}[ht]
(a saída do LaTeX informou que já estava funcionando dessa maneira);removendo as
\makebox[\textwidth][c]{...}
chamadas inúteis (você\includegraphics[width=1\textwidth]{...}
já cria uma caixa larga\textwidth
);usando imagens presentes em todas as instalações do TeX (se você quiser incluir aqui imagens com dimensões precisas para nos permitir reproduzir seu problema, use algo como
\includegraphics[width=\textwidth, height=1cm]{example-image}
, ou similar comexample-image-a
,example-image-b
, etc.);removendo todos os rótulos inúteis (aqui) e duplicados (leia a saída do LaTeX!),
chega-se a:
\documentclass[12pt,a4paper]{article}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage[top=2cm,left=2cm,bottom=2cm,right=2cm]{geometry}
\title{zzz}
\author{zzz}
\date{\today}
\begin{document}
\maketitle
\section{A}
\begin{figure}[ht]
\includegraphics[width=\textwidth]{example-image}
\caption{xxxx}
\end{figure}
\begin{figure}[ht]
\includegraphics[width=\textwidth]{example-image}
\caption{xxxx}
\end{figure}
\begin{figure}[ht]
\includegraphics[width=\textwidth]{example-image}
\caption{xxxx}
\end{figure}
\begin{figure}[ht]
\includegraphics[width=\textwidth]{example-image}
\caption{xxxx}
\end{figure}
\section{B}
\end{document}
Isso não parece um posicionamento incorreto da figura ...