导入的 PDF 图形位于文本上方

导入的 PDF 图形位于文本上方

我正在使用 MikTeX 2.9,我试图从 pdf 文件中添加一个图形,但它总是被放置在我的常规文本之上或部分超出页面并位于我的页脚部分。我没有使用列。我尝试在其周围放置 \frame{} 来显示边界框,但它似乎不在边界框内。以下是相关代码:

序言,大体上来自一个模板:

\documentclass[11pt]{article} % use larger type; default would be 10pt

\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)

%%% Examples of Article customizations
% These packages are optional, depending whether you want the features they provide.
% See the LaTeX Companion or other references for full information.

%%% PAGE DIMENSIONS
\usepackage{geometry} % to change the page dimensions
\geometry{letterpaper} % or letterpaper (US) or a5paper or....
% \geometry{margin=2in} % for example, change the margins to 2 inches all round
% \geometry{landscape} % set up the page for landscape
%   read geometry.pdf for detailed page layout information

\usepackage{graphicx} % support the \includegraphics command and options

% \usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent

%%% PACKAGES
\usepackage{booktabs} % for much better looking tables
\usepackage{array} % for better arrays (eg matrices) in maths
\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
% These packages are all incorporated in the memoir class to one degree or another...

%%% HEADERS & FOOTERS
\usepackage{fancyhdr} % This should be set AFTER setting up the page geometry
\pagestyle{fancy} % options: empty , plain , fancy
\renewcommand{\headrulewidth}{0pt} % customise the layout...
\lhead{}\chead{}\rhead{}
\lfoot{}\cfoot{\thepage}\rfoot{}

%%% SECTION TITLE APPEARANCE
\usepackage{sectsty}
\allsectionsfont{\sffamily\mdseries\upshape} % (See the fntguide.pdf for font help)
% (This matches ConTeXt defaults)

%%% ToC (table of contents) APPEARANCE
\usepackage[nottoc,notlof,notlot]{tocbibind} % Put the bibliography in the ToC
\usepackage[titles,subfigure]{tocloft} % Alter the style of the Table of Contents
\renewcommand{\cftsecfont}{\rmfamily\mdseries\upshape}
\renewcommand{\cftsecpagefont}{\rmfamily\mdseries\upshape} % No bold!

%%% END Article customizations

\usepackage{xcolor} %for color in the text, to help with my notes to us
\usepackage{mathtools} % for definition symbol


\usepackage{longtable}

\usepackage{booktabs} % For \toprule, \midrule and \bottomrule
\usepackage{siunitx} % Formats the units and values
\usepackage{pgfplotstable} % Generates table from .csv

\usepackage{csvsimple}
\usepackage{rotating}
\usepackage{lscape}
%\usepackage{mcode} % for putting Mathlab code into the document.
\usepackage{times}
\usepackage{babel}
% should that word in brackets below be strict?  
%\usepackage[sctrict]{changepage}
\usepackage{changepage}

\usepackage{float} % for the [H] option to force placement of figures and other floats where I typed them.
\usepackage[section]{placeins} % so floats won't go beynd their own section
%
%\widowpenalty=300
%\clubpenalty=300
\usepackage[hyphens]{url}
\urlstyle{same}
\usepackage{breakurl}
\usepackage{hyperref} % for hyperlinks

\usepackage{fancyhdr}
%\pagestyle{fancy}

%\lhead{This is my name}
%\rhead{this is page \thepage}
\cfoot{C.Celice, N. Kethineni, K. Sumi}
\rfoot{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.4pt}


\usepackage{listings} % for listing R code


\usepackage{amsmath} % For cases in math mode
\usepackage{amsmath,amsfonts,amssymb,amsthm} % For blackboard bold
\setlength\parindent{0pt}
\usepackage{pdfpages} % inserts more than one page of a pdf file

\usepackage{float} % for the [H] option to force placement of figures and other floats where I typed them.

\usepackage[normalem]{ulem} % for striking through text

\usepackage[skip=10pt]{caption}

\title{{\Huge Optimization of Airplane Landing Times}}
\author{Catherine Angela Celice\\ Wayne State University\\[email protected] \and Nalini Kethineni\\ Wayne State University\\[email protected] \and Kamrun Nahar Sumi\\ Wayne State University\\[email protected]}
\date{} % Activate to display a given date or no date (if empty),
         % otherwise the current date is printed 


\begin{document}
\maketitle

以下是该图周围的代码:

\section{The Mixed Integer Programming Method}

In this study, we consider the case where either of the plane i or j can land first. The reference paper also demonstrates all the necessary constraints for this case. All of the constraints mentioned above have one thing in common, ie. they are valid when i is not equal to j. This means that the plane cannot make pair of itself. \\

Table \ref{MIPruns} shows the analysis details of a static case single runway ALP for the number of aircraft: $10, 50, 100, 150, 250,$ and 500. The number of variables increases from 40 to 2000 with the increase of aircraft number from 10 to 500. On the other hand, the rate of increase of number of constraints are much higher compared to the number of variables with the increase of number of aircrafts. For example, the number of constraints for 10 aircrafts is 231 whereas the number of constraints for 500 aircraft is a little over than half million. As shown in the table, optimal solution is only found for plane number 10 and 50. For more than 50 aircrafts, the convergence rate is extremely slow and optimal solution was not found within the time specified in this table. For the 100 aircrafts, the simulation was run for 2 hours and 17 minutes, yet optimal solution was not found. The gap at final step for 100 aircraft was found to be 25\%. Therefore, a stopping criterion of 20 minutes and 20\% gap was applied for the rest of the aircrafts. As shown in this table \ref{MIPruns}, the gap is close to 50\% for number of aircrafts more than 100.\\




\begin{table}[h]
\centering
\caption{Analysis Results of a Static Case and Single Runway ALP}
\label{MIPruns}
\begin{tabular}{|p{8mm}|p{14mm}|p{18mm}|p{11mm}|p{14mm}|p{14mm}|c|p{14mm}|}
\hline 
No. of planes & No. of variables & No. of constraints & Optimal solution found & Optimal value at final step & Stopping Criteria & Gap (\%) & Run time (s)\\
\hline
10 & 40 & 231 & Yes & 700 & Not applied & 0 & 3 sec\\  
\hline
50 & 200 & 5152 & Yes & 1775 & Not applied & 0 & 5 sec\\
\hline
100 & 400 &20301 & No & 5274 & 2 hr s 17 mins & 25 & $>$2hrs 17 min\\
\hline
150 & 600 & 45452 & No & 12310 & 20 minutes & 54 & $>$20 mins\\
\hline
250 & 1000 & 125752 & No & 16130 & 20 minutes & 45 & $>$20 mins\\
\hline
500 & 2000 & 501502 & No & 34378 & 21 minutes & 40 & $>$20 mins\\
\hline
\end{tabular}
%\end{adjustwidth*}
\end{table}


Figure \ref{MIPoptvsplanes} shows the optimal solution at final step against the number of aircrafts. As shown in the figure, the optimal solution increases with the increase of number of aircrafts since penalty cost is higher for higher number of aircrafts. The trend between aircraft number 250 and 500 seems linear in the above graph because there is no data point between them. If there were more data points between them, the line might have been nonlinear between these two points. This graph shows that more runways are mandatory in order to reduce the cost when the number of landing aircrafts are high.\\
%

%%\vspace{1cm}
\begin{figure}
\hspace*{-1cm}
%\begin{center}

\frame{\includegraphics[scale=0.8,  trim = 2cm 25cm 1.5cm 2cm]{"Kamrun Figure 1".pdf}}

\caption{Optimal Value at Final Step Versus the Number of Aircraft.}
\label{MIPoptvsplanes}
%\end{center}
\end{figure}

\vspace{15cm}

%\vspace{5cm}

Table \ref{MIPruns} suggests us to investigate the convergence rate, i.e. change of optimal solution value over time, for large number of aircraft where optimal solution was found within 20 minutes. Figure \ref{MIPconvergence} shows the convergence rate for the aircraft number 100, 150, 250, and 500. In these graphs, the x axis represents the simulation time and y axis represent the objective function value. For all the cases, it is observed that the objective function value remains either constant or significantly low which can be assumed as constant. This means that even if the simulation is run for longer time, it is highly unlikely to get the optimal solution with 0\% gap at reasonable timeframe. For example, the simulation was run for 2 hours and 17 minutes for the 100 aircrafts, but the objective function value was not changing over time. This proves that it is extremely difficult to get exact solution for the aircraft number greater than 50 which matched with the research findings in the research articles. Therefore, a different approach must be taken, i.e. a metaheuristic approach will be a better method to solve this problem faster with the compromise of solution accuracy.\\

我尝试在各个地方添加 vspace。但没用。我尝试使用 figure* 代替 figure。我尝试使用 [h]、[t],但没有位置建议。我仍然遇到同样的问题。我删除了辅助文件和所有内容,但删除了 tex 文件。问题仍然存在。我以前从未遇到过这种情况。

顺便说一句,我也尝试过从 pdf 文件导入表格,但发生了同样的事情,所以我手动输入了。我导入的第二个图表工作正常,但它确实占用了整整一页。

任何提示,甚至是包含此图表的其他方法都将不胜感激。谢谢。

答案1

助教通过输入以下内容修复了该问题:

\begin{figure}[!htbp]

而不是以下任何一个:

\begin{figure}
\begin{figure*}
\begin{figure}[h]
\begin{figure}[t]
\begin{figure}[b]

我不知道它为什么有效,但它确实有效。感谢所有试图帮助我的人。

相关内容