换行图形之前完全对齐文本

换行图形之前完全对齐文本

尽管我没有指定,但图 4.15 左侧的文本是两端对齐的。我希望此页面的布局保持不变,所有文本都两端对齐。相反,以“车辆配置数据...”开头的段落是两端对齐的,即最后一行被拉伸到右边距结束。

我尝试按照这里的建议在包装图周围加上括号:包裹图形后的文本对齐,但不起作用。两者都不起作用,只是将该文本块放在 \begin{flushleft} 环境中。两者最终都将文本放在换行的图形上。

我该如何解决?

\documentclass[11pt]{report}
\usepackage[margin=2cm]{geometry}
\usepackage{amsmath,amsfonts,amssymb,amsthm, bm} %changed
\usepackage{bm}
\usepackage{graphicx}
\graphicspath{{./Images/}}

\usepackage{parskip}
\usepackage{setspace}
    \doublespacing

\usepackage{import}


% my packages
\usepackage{verbatim}
\usepackage[backend=bibtex,style=trad-plain]{biblatex}
\addbibresource{papersNS.bib}
\usepackage{wrapfig}
\usepackage[skip=1pt]{caption}
\usepackage{subcaption}
\usepackage[linesnumbered,ruled,noline]{algorithm2e}
\usepackage{xcolor,colortbl}
\definecolor{Gray}{gray}{0.85}
\newcolumntype{a}{>{\columncolor{Gray}}l}
\usepackage{graphics}
\usepackage{float}


\begin{document}
the de Havilland beaver fixed wing aircraft, in order to obtain the state space models required to derive the LQR gains. 

\begin{figure}[H]
    \centering
    \includegraphics[width=0.4\textwidth]{6DOF.png}
    \setlength{\belowcaptionskip}{-16pt}
    \caption{\label{fig:6DOF}`sixDOF\_simulation' SIMULINK model}
\end{figure}
\setlength{\belowcaptionskip}{0pt}


A pre-existing SIMULIINK model template from the Aerospace Blockset, shown in Figure \ref{fig:6DOF}, was used to linearise the state space model around the operating point. In order to do so, the operating point initial flight conditions were specified in the script shown below in Figure \ref{fig:code1}.

\begin{wrapfigure}{r}{0.3\textwidth}
    \centering
    \vspace{-20pt}
    \includegraphics[width=0.3\textwidth]{code1_1.png}
    \begin{singlespace}
        \setlength{\belowcaptionskip}{-16pt}
        \caption{\label{fig:code1}Initializing Flight Conditions}
    \end{singlespace}
\end{wrapfigure}
\setlength{\belowcaptionskip}{0pt}
The vehicle configuration data used here is from the original design of the UAV [??]. Once the initial conditions had been configured, the desired trim condition had to be specified for the linearisation. As mentioned previously, the operating point was chosen to be steady flight at a constant altitude. This means when defining the trim condition for the operating point, the altitude and yaw has to be specified as known quantities. 
\begin{wrapfigure}{l}{0.25\textwidth}
    \centering
    \vspace{-20pt}
    \includegraphics[width=0.25\textwidth]{code2.png}
    \begin{singlespace}
        \setlength{\belowcaptionskip}{-16pt}
        \caption{\label{fig:code2}Linearising the airframe around a trimmed operating point}
    \end{singlespace}
\end{wrapfigure}
\setlength{\belowcaptionskip}{0pt}
\vspace{-20pt}

The Matlab script in Figure \ref{fig:code2} is responsible for linearising the airframe. It does so by first defining a trim condition for the operating point of the airframe in lines 8-36.

In these lines, all the states are initialized to be the same as in Figure \ref{fig:code1}. This portion of the code also declares the yaw and height to be known quantities, therefore eliminating them as possible states in the state space model. Once the trim condition has been specified, an operating point satisfying it is found in line 39. The airframe is then linearised about this operating point in lines 42-50. The state space model found is only valid for small deviations of the airframe about this operating point.   

The results of this Matlab script are shown in Figure \ref{fig:code_results}. The LQR controller being designed will control deviations of the states about this operating
\end{document}

在此处输入图片描述

答案1

如果“quantities”一词应为段落结尾,则应在其后留一个空行。您(意外地)在段落中多了一个没有文本的行。我猜这就是您插入 的原因\vspace{-20pt},以隐藏空行以及 parskip。

环绕图形被指定为非浮动(小 l),但无论如何都必须浮动,因为该段落已经环绕了前一个图形,并且控制台和日志文件中应该有关于此问题的警告。

您似乎有很多显式的垂直间距命令(\vspace、\setlength)与软件包(setspace、parskip)相冲突。如果没有这些命令,您的文档写作可能会更流畅。

相关内容