Tex: wrapfig package problem aligning text

*爱你&永不变心* 提交于 2020-06-17 03:56:26

问题


Using the wrapfig package with a table inside a section, the table's first row is not aligned with the text that wraps it. This problem is not present when working outside of a section.

\documentclass{article}

\usepackage{wrapfig}
\usepackage{lipsum}

\begin{document}

    \section{Section}

    \begin{wraptable}{l}{0pt}
        \begin{tabular}{cccc}
        A & B & C & D \\
        E & F & G &  H\\        
        \end{tabular}
    \label{Mytable}\caption{This is my table.}
    \end{wraptable}

\textbf{This bit of text should be aligned with the table's top row.}
\lipsum[2]

\end{document}

What this gives is:

Whereas ideally I'd like to get something like:


回答1:


You could try to adjust \intextsep:

\documentclass{article}

\usepackage{wrapfig}
\usepackage{lipsum}




\begin{document}

    \section{Section}

{
\setlength\intextsep{-0.4ex}
    \begin{wraptable}{l}{0pt}
        \begin{tabular}{cccc}
        A & B & C & D \\
        E & F & G &  H\\        
        \end{tabular}
    \label{Mytable}\caption{This is my table.}
    \end{wraptable}

\textbf{This bit of text should be aligned with the table's top row.}
\lipsum[2]

}

\end{document}


来源:https://stackoverflow.com/questions/61370235/tex-wrapfig-package-problem-aligning-text

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!