画像と新しいセクションが同じページに表示されます

画像と新しいセクションが同じページに表示されます

画像をページの上部に配置し、同じページの画像の下に新しいセクションを開始したいです。[t] を使用して画像を配置しようとしましたが、何も変わりません。画像はページの中央に表示され、新しいセクションは新しいページから始まります... どうすれば修正できますか?

これが私のコードです:

 \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}

ここに画像の説明を入力してください

答え1

後:

  • 例を最小限に減らす ( lmodernComputer Modern と同じメトリックではないため、そのままにしておきます)。

  • すべてを次のように置き換えます (LaTeX 出力で\begin{figure}[h]は、すでにこの方法で動作していることが示されています)。\begin{figure}[ht]

  • 無駄な\makebox[\textwidth][c]{...}呼び出しを削除します (\includegraphics[width=1\textwidth]{...}すでに幅の広いボックスが作成されています\textwidth)。

  • すべての TeX インストールに存在する画像を使用する (問題を再現できるように正確な寸法の画像をここに含める場合は、 、 などを使用するか、 、 などと類似のものを使用します\includegraphics[width=\textwidth, height=1cm]{example-image}) 。example-image-aexample-image-b

  • 役に立たないラベル(ここでは)と重複するラベル(LaTeX 出力を読んでください!)をすべて削除します。

到着する場所:

\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}

ここに画像の説明を入力してください

これは図の配置が間違っているようには思えません...

関連情報