尝试将换行图与 [t] 对齐

尝试将换行图与 [t] 对齐

因此,我尽力按以下方式调整我的小节:

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

下一小节将完全相同,只是 wrapfigure 将有一个 {l} 参数。

这是我得到的:

在此处输入图片描述

如您所见,对齐方式不正确。我确保图像没有任何可用空间。图像未与子子节的顶部对齐,这会产生这种奇怪的外观。有 6 个子子节,这让页面看起来很糟糕。

有办法修复这个问题吗?[t] 对环绕图形不起作用,而且我不擅长使用表格,所以我不知道如何让它看起来更好。

答案1

用于\setlength\intextsep{0pt}消除包装图形的顶部和底部的多余空间。

\intextsep是放置在所有浮动上方和下方的垂直空间,而不仅仅是环绕图形。为了仅影响它们,此代码被添加到序言中

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

只有包装图

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}

相关内容