
Quiero que una imagen esté en la parte superior de la página y que la nueva sección comience debajo de la imagen en la misma página. Intenté posicionar la imagen usando [t] pero nada cambia. La imagen aparece en el centro de la página y la nueva sección comienza en la nueva página... ¿Cómo puedo solucionar eso?
Aquí está mi 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}
Respuesta1
Después:
reduciendo tu ejemplo al mínimo (lo mantengo
lmodern
porque no tiene las mismas métricas que Computer Modern);reemplazando todo
\begin{figure}[h]
con\begin{figure}[ht]
(la salida de LaTeX le indicó que ya estaba funcionando de esta manera de todos modos);eliminar las
\makebox[\textwidth][c]{...}
llamadas inútiles (\includegraphics[width=1\textwidth]{...}
ya creas un cuadro ancho\textwidth
);usar imágenes presentes en todas las instalaciones de TeX (si desea incluir aquí imágenes con dimensiones precisas para permitirnos reproducir su problema, use algo como
\includegraphics[width=\textwidth, height=1cm]{example-image}
, o similar conexample-image-a
,example-image-b
, etc.);eliminando todas las etiquetas inútiles (aquí) y duplicadas (¡lea el resultado de LaTeX!),
uno llega 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}
Esto no parece una colocación incorrecta de la figura...