0

So I'm trying my best to align my subsections this way:

\subsubsection{Cylindrical Robot Arm:}

\begin{wrapfigure}{r}{0.3\textwidth} \centering \includegraphics[width=3cm]{II.Theoretical Concept and state of the art/Industrial Robot Arms/Images/cylindrical Robot arm.png} \captionsetup{justification=centering,margin=0.1cm} \caption{Cylindrical Robot Arm} \end{wrapfigure}

This type of robot arms has at least one base rotary joint and one prismatic joint, which provide it with linear and rotational movement. These joints form a cylindrical coordinate system, making this robot arm effective and useful in industries that deal with tubing and cylindrical components as well as industries involving die casting... \WFclear \vspace{1cm}

The next subsection would be exactly the same except the wrapfigure will have an {l} argument instead.

This is what I get:

enter image description here

As you can see the alignment isn't right. I made sure the image doesn't have any free space. The image isn't aligned to the top of the subsubsection, which creates this weird look. There are 6 subsubsections and that made the page look bad.

Is there a way to fix this ? [t] didn't work on wrap figure and I'm not good with tables so I don't know how to make it look better.

Ingmar
  • 6,690
  • 5
  • 26
  • 47

1 Answers1

6

Use \setlength\intextsep{0pt} to eliminate extra top and below space of the wrapped figure.

\intextsep is the vertical space placed above and below all floats not just a wrap figure. To affect only them this code is added to the preamble

\usepackage{etoolbox}
\BeforeBeginEnvironment{wrapfigure}{\setlength{\intextsep}{0pt}}

From Only the wrap figures

b

\documentclass[12pt,a4paper]{article}

\usepackage{wrapfig}

\usepackage{graphicx}

\usepackage{caption}

\usepackage{kantlipsum} % only for dummy tex

% From https://tex.stackexchange.com/a/436852/161015 \usepackage{etoolbox} \BeforeBeginEnvironment{wrapfigure}{\setlength{\intextsep}{0pt}}% eliminate extra top and below space <<<<

\begin{document}

\subsubsection*{Cylindrical Robot Arm:}

\begin{wrapfigure}{r}{0.3\textwidth} \centering \includegraphics[width=3cm]{example-image-a} \captionsetup{justification=centering,margin=0.1cm} \caption{Cylindrical Robot Arm} \end{wrapfigure}

This type of robot arms has at least one base rotary joint and one prismatic joint, which provide it with linear and rotational movement. These joints form a cylindrical coordinate system, making this robot arm effective and useful in industries that deal with tubing and cylindrical components as well as industries involving die casting...

\subsubsection*{Delta Robot Arm:}

\begin{wrapfigure}{l}{0.3\textwidth} \centering \includegraphics[width=3cm]{example-image-b} \captionsetup{justification=centering,margin=0.1cm} \caption{Delta Robot Arm} \end{wrapfigure} \kant[1]

\end{document}

Simon Dispa
  • 39,141