2

I have a two-column style, but sometimes I want to put some text across the whole page. An easy way to do this is inside one of the starred float environments. I am using table*.

However, I notice that when I put ordinary paragraph text and headings inside a table* (with no tabular), some spacing elements change. There is no longer any paragraph indentation and no space appears between paragraphs and headings.

Is there a list somewhere of which lengths are changed in the table* environment? How can I configure text inside table* to have the same spacing as my normal body text?

2

floats execute \@parboxrestore (like parbox) and \@floatboxreset which mostly does \reset@font\normalsize to normalize the fonts.

\@parboxrestore is:

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

So mostly \fussy to undo \sloppy and setting \parindent and \parskip to whatever values are set by your document class will produce a standard setting.

or locally set \let\@parboxrestore\relax before your float so none of the above happens.

However for normal text spanning two columns it is usually better to use

\twocolumn[
 normal text spanning both columns here
 ]
  • Thanks, David. I found this does exactly what I want: \newenvironment{onecolumnfloat}[1][t]{% \let\@floatboxreset\relax% \let\@parboxrestore\relax% \begin{table*}[#1]\unskip}{\end{table*}} – Michael D. Mar 18 '16 at 23:06
  • \twocolumn[] is fine for simple text but there are limitations on what you can put as a parameter. Defining a new environment is more robust. – Michael D. Mar 18 '16 at 23:08
  • @MichaelDavis but the [] argument is a fixed unit, but a table is a float and normal paragraph text doesn't normally float. The only limitation (which applies to both) is that the text is a box so can not be longer than the page. – David Carlisle Mar 18 '16 at 23:23
  • The paragraph I tried to float had some \verb text in it, which is illegal in the [] but allowed in the {onecolumnfloat} environment. The environment also allows having several paragraphs of text and even tables or figures so it's a bit more flexible. – Michael D. Mar 19 '16 at 8:18
  • @MichaelDavis oh details.. both of those are easily avoidable actually:-) (but it's fine: if the float doesn't float either by luck or because it's pinned with \clearpage then it will work well enough for your use case. – David Carlisle Mar 19 '16 at 8:20
1

You can try with the strip environment, from the cuted package:

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

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.