浮动元素内部间距的变化

浮动元素内部间距的变化

我有一个双列样式,但有时我想将一些文本放在整个页面上。一个简单的方法是在带星号的浮动环境中执行此操作。我使用的是 table*。

然而,我注意到,当我将普通段落文本和标题放入表格*(无表格)中时,一些间距元素会发生变化。不再有任何段落缩进,段落和标题之间也没有空格。

是否有一个列表,其中列出了在 table* 环境中更改的长度?如何配置 table* 中的文本以使其与正常正文文本具有相同的间距?

答案1

浮点执行\@parboxrestore(如 parbox)并且\@floatboxreset主要用于\reset@font\normalsize规范字体。

\@parboxrestore是:

\def\@arrayparboxrestore{%
  \let\if@nobreak\iffalse
  \let\if@noskipsec\iffalse
  \let\par\@@par
  \let\-\@dischyph
  \let\'\@acci\let\`\@accii\let\=\@acciii
  \parindent\z@ \parskip\z@skip
  \everypar{}%
  \linewidth\hsize
  \@totalleftmargin\z@
  \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
  \parfillskip\@flushglue \lineskip\normallineskip
  \baselineskip\normalbaselineskip
  \sloppy}
\def\@parboxrestore{\@arrayparboxrestore\let\\\@normalcr}

因此,大多数情况下\fussy,撤消\sloppy和设置\parindent以及\parskip文档类设置的任何值都会产生标准设置。

或者在浮动之前进行本地设置\let\@parboxrestore\relax,这样上述情况就不会发生。

然而,对于跨越两列的普通文本,通常最好使用

\twocolumn[
 normal text spanning both columns here
 ]

答案2

strip您可以从包中尝试该环境cuted

\documentclass[twocolumn]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{indentfirst} \usepackage{lipsum}
\usepackage{cuted}
\usepackage{etoolbox} \BeforeBeginEnvironment{strip}{\setlength\stripsep{0pt}\vspace{\dimexpr-\baselineskip \relax}}
\AtEndEnvironment{strip}{ \vspace{-\topsep}}
 \begin{document}

Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. text. Some text.

% \begin{strip}\parindent = 1em\par 一些文本。 ...

  Some text. Some text. Some text.Some text. Some Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text. Some text.
\end{strip}

Some text. Some text. Some text.Some text. Some Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. Some text. Some text.Some text. Some text. Some text. text. Some text.

\end{document} 

在此处输入图片描述

相关内容