같은 페이지에 이미지와 새 섹션이 있습니다.

같은 페이지에 이미지와 새 섹션이 있습니다.

이미지가 페이지 상단에 있고 새 섹션이 같은 페이지의 이미지 아래에서 시작되기를 원합니다. [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과 동일한 측정 항목이 없기 때문에 유지하고 있습니다).

  • all을 \begin{figure}[h]다음으로 대체합니다 \begin{figure}[ht](LaTeX 출력에서는 어쨌든 이미 이런 방식으로 작동하고 있다고 알려줍니다).

  • 쓸모없는 \makebox[\textwidth][c]{...}호출 제거( \includegraphics[width=1\textwidth]{...}이미 넓은 상자가 생성됨 \textwidth)

  • 모든 TeX 설치에 있는 이미지 사용(문제를 재현할 수 있도록 정확한 크기의 이미지를 여기에 포함시키려면 , \includegraphics[width=\textwidth, height=1cm]{example-image}등과 유사한 example-image-a것을 사용하십시오 example-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}

여기에 이미지 설명을 입력하세요

이것은 잘못된 그림 배치로 간주되지 않습니다 ...

관련 정보