我的数字显示在新页面上,但它应该很容易放在上一页

我的数字显示在新页面上,但它应该很容易放在上一页

在此处输入图片描述当我在脚本中插入 2 张图片时,编译脚本时这些图片会跳转到下一页,而它应该适合所需的页面。即使在脚本中实现 t、h 或 H 也不起作用。我的代码如下:

\documentclass[9pt, a4paper]{article}

% standard packages
\usepackage{titlesec,color,rotating,booktabs,graphicx,natbib}    % standard packages
\usepackage[usenames,dvipsnames,svgnames,table, xcdraw]{xcolor}          % extra colors 
\usepackage{multirow}
\usepackage{longtable}

\usepackage{blindtext}
% PAGE MARGINS
\usepackage[top=2.54cm, bottom=2.54cm, left=3.17cm, right=3.17cm]{geometry}

% FONT (similar to Verdana)
\usepackage[lf]{berenis}
\renewcommand*\familydefault{\sfdefault} 
\usepackage[T1]{fontenc}
% for other fonts, and how to install them, see the LaTeX Font Catalogue:
% http://www.tug.dk/FontCatalogue/

% LINE SPACE
\linespread{1.1}                          % more space between lines
\setlength{\parindent}{5mm}               % indenting first line paragraph

% HYPHENATION (afbreekstreepjes)
\usepackage[english]{babel}                                      % correct hyphenation (afbreekstreepjes)
% set words that are not abbreviated correctly  (expand list when necessary)
\hyphenation{catch-ment areas a-na-lyse}

% Blue headers
%\definecolor{wurblue}{cmyk}{1.0,0,0,0.58}
\usepackage{sectsty}
\allsectionsfont{\color{CornflowerBlue}}

\renewcommand{\arraystretch}{1.5}
%graphs
\usepackage{graphicx}
\graphicspath{figs}
\usepackage{wrapfig}
\usepackage{caption}
\captionsetup{belowskip=0pt}
\usepackage{subcaption}


\newpage
\section{Time planning}
\begin{figure}[t!]
\centering
\begin{subfigure}{\textwidth}
\includegraphics{figs/Milestones.png}
\end{subfigure}
\begin{subfigure}{\textwidth}
\includegraphics{figs/PlanningMOOI.png}
\end{subfigure}
\end{figure}

知道哪里出了问题吗?

答案1

太大,不适合评论……

xelatex在使用和相对较大的演示图像(height=0.6\linewidthwidth=0.8\linewidth)以及浮动放置选项对前导码进行排列(对相关包进行分组,删除重复的包加载)后ht,我无法确认您的问题。结果很好:

在此处输入图片描述

\documentclass[a4paper]{article}
\usepackage[vmargin=2.54cm, 
            hmargin=3.17cm]{geometry}   % page layout
\usepackage[T1]{fontenc}                % font encoding
\usepackage[lf]{berenis}
\renewcommand*\familydefault{\sfdefault}

\usepackage[english]{babel}             % language
% some hyphenation examples
\hyphenation{catch-ment areas a-na-lyse}

\usepackage{titlesec}                   % titles, don't use both packages!
                                        % in case that you use both, 
                                        % "titlesec" had to be before sessty
\usepackage{sectsty}

\usepackage{natbib}                     % bibliography
\usepackage[usenames, dvipsnames, svgnames, % color names
            xcdraw,table]{xcolor}       % colors
\usepackage[demo]{graphicx}             % graphic, in real document remove "demo" option 
\usepackage{wrapfig}
\graphicspath{figs}

\usepackage{rotating}         
\usepackage{booktabs, 
            longtable, multirow}        % tables packages

\usepackage{caption}
\captionsetup{belowskip=0pt}
\usepackage{subcaption}

\usepackage{blindtext}
\linespread{1.1}                        % more space between lines
\setlength{\parindent}{5mm}             % indenting first line paragraph

\begin{document}
%\newpage
\section{Time planning}
\blindtext
    \begin{figure}[ht]
\begin{subfigure}{\textwidth}
\centering
\includegraphics[height=0.6\linewidth, width=0.8\linewidth]{Milestones.png}
\end{subfigure}

\begin{subfigure}{\textwidth}
\centering
\includegraphics[height=0.6\linewidth, width=0.8\linewidth]{PlanningMOOI.png}
\end{subfigure}
    \end{figure}
\blindtext
\end{document}

相关内容