Tex: проблема с пакетом wrapfig при выравнивании текста - PullRequest
1 голос
/ 22 апреля 2020

При использовании пакета wrapfig с таблицей внутри раздела первая строка таблицы не выравнивается по тексту, который ее переносит. Эта проблема отсутствует при работе вне раздела.

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

Это дает:

Text not aligned with wrapped table's first row

В то время как в идеале я хотелось бы получить что-то вроде:

Text hypothetically aligned with wrapped table's first row (not a TeX output)

1 Ответ

1 голос
/ 22 апреля 2020

Вы можете попробовать настроить \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}
...