Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm typesetting a document in the [twocolumn] format. I found (Googled) that a way how to place some material spread over both columns is as in the following code:

\documentclass[twocolumn]{article}

\usepackage{lipsum}

\begin{document}

\twocolumn[\begin{@twocolumnfalse}
  \centerline{\Large\bfseries This is my manually set ``wide'' title}
  \vspace{3ex}
\end{@twocolumnfalse}]

\lipsum

\end{document}

I would like to:

  1. Understand what does the code really do.
  2. Ask whether there is a better way how to do that.
  3. Get some good documentation with [twocolumn] explained.
share|improve this question
1  
The @twocolumnfalse isn't necessary to write about the whole line. It's the default behaviour of \twocolumn[]. –  Marco Daniel May 28 '12 at 8:49
    
@MarcoDaniel thanks. –  tohecz May 28 '12 at 9:13
add comment

2 Answers

up vote 8 down vote accepted

Quoting Kopka and Daly, Guide to LaTeX, p. 54:

\twocolumn[<header text>]

Terminates the current page, starting a new one with two columns per page. The optional header text is written at the top of the page in one column with the width of the whole page.

[...]

The [standard class] option twocolumn automatically changes certain page style parameters, such as indentation, compared with the one-column format. This does not occur with the command \twocolumn. These additional changes must be made with the corresponding \setlength declarations if they are desired. If the bulk of the document is in two-column format, the class option is to be preferred.

Note that the argument of \chapter will also span the width of the whole page in twocolumn mode. Using \chapter inside the optional argument of \twocolumn will produce an error (Float(s) lost).

EDIT: According to the UK TeX FAQ, there is at least one case in standard LaTeX where manually switching to @twocolumnfalse is useful: One-column abstracts in a two-column article. Try to comment out \begin{@twocolumnfalse} and \end{@twocolumnfalse} in the following example:

\documentclass{article}

\newcommand*{\sometext}{Lorem ipsum dolor sit amet, consectetuer
    adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
    adipiscing vitae, felis. Curabitur dictum gravida mauris.}

\begin{document}

\twocolumn[
  \begin{@twocolumnfalse}
    \begin{abstract}
    \sometext
    \end{abstract}
  \end{@twocolumnfalse}
]

\sometext

\end{document}
share|improve this answer
    
Thanks for some explanation from a book, the problem with {abstract} is exactly the reason why I cannot omit @twocolumnfalse. –  tohecz May 28 '12 at 11:56
add comment

It is the same as:

\twocolumn[\@twocolumnfalse
  \centerline{\Large\bfseries This is my manually set ``wide'' title}
  \vspace{3ex}
   ]

except that it (ab)uses \begin to execute \csname @twocolumnfalse\endcsname and so avoid messing around with \makeatletter.

The optional argument to twocolumn is set in a full width box before the columns start. the \@iftwocolumn is set to false will have no effect in that example but if there were more complicated code in that section then it may test that flag. The only things I can see** in standard latex that test \if@twocolumn are things related to floats and \clearpage neither of which are relevant in that position. But there could be other package code that needs to know if it is in full page setting or within a single column.

** As pointed out in chat and @lockstep's answer, the standard classes test this switch in the definition of \abstract so abstracts within the optional argument to \twocolumn are affected by adding the setting of @twocolumnfalse.

share|improve this answer
    
Don't forget that \begin .. \end also adds grouping, keeping the if-switch change local. –  Martin Scharrer May 28 '12 at 9:42
    
Not on that position as the twocolumn argument is a box so it is already local, that is, it adds group but the group doesn't change the behaviour except for edge cases with \aftergroup –  David Carlisle May 28 '12 at 9:43
    
Thanks, I wasn't sure about that. –  Martin Scharrer May 28 '12 at 9:46
    
Thanks David for your effort, however, I decided to accept lockstep's answer since he first pointed out what is @twocolumnfalse good for. Hope you don't mind. –  tohecz May 30 '12 at 14:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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