0

The text on the left of Figure 4.15 is full justified even though I didn't specify that. I want the layout of this page to stay the same with all the text being justified. Instead the paragraph beginning "The vehicle configuration data..." is full justified, i.e. the last line is stretched to end on the right margin.

I tried putting braces around the wrapfigure as suggested here: Text alignment after wrapped figure, but it didn't work. Neither did, just putting that block of text inside a \begin{flushleft} environment. Both end up putting text over the wrapped figures.

How do I fix this?

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

enter image description here

2
  • 1
    justified tex is the default in tex, and you have not specified \raggedright anywhere Apr 17, 2020 at 18:18
  • @DavidCarlisle But all the paragraphs on this page except for the one beginning with "The vehicle configuration ...." are aligned the way I want it to be, i.e. justified. I want it to be justified just not fully justified, such that the lines are stretched out so that the last line ends on the right margin
    – Chryron
    Apr 17, 2020 at 18:34

1 Answer 1

1

If the word "quantities" is supposed to be the end of a paragraph, leave a blank line after it. You (accidentally) have one more line in the paragraph, with no text. I guess that's why you inserted \vspace{-20pt}, to hide the blank line, as well as the parskip.

The wrapfigure was specified to be non-floating (little l) but had to float anyway because the paragraph was already wrapping around a previous figure, and there should be a warning about that on your console and in the log file.

You seem to have a lot of explicit commands for vertical spacing (\vspace, \setlength) that fight against packages (setspace, parskip). Your document writing would probably be smoother without some of these.

1
  • 1
    That fixed it! Thanks!
    – Chryron
    Apr 17, 2020 at 19:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .