I am writing a paper in LaTeX. I will need both the one-column and two-column versions of the paper. For this, the figure sizes/configurations need to be different in the two documents. I am looking for a command like \iftwocolumn! Do you know if it exists and if not how can I define and use it?

I would need something like:


2 Answers 2


\linewidth or \columnwidth should work, since a non-twocolumn document technically consists of a single column (of width \columnwidth).

However, if you're using the traditional twocolumn mode of (say) article, the condition \if@twocolumn is available for testing/branching.

Here's a short example showing the difference:

\usepackage{graphicx,showframe}% http://ctan.org/pkg/{graphicx,showframe}
\else% \@twocolumnfalse

Note that you require the use of a \makeatletter...\makeatother pair, since the command definition of the conditional contains @. See What do \makeatletter and \makeatother do?

  • It looks like that \if@twocolumn works in the opposite way
    – katang
    Dec 29, 2014 at 20:29

Here is how I made a conditional to do different things with one or two columns:



\whencolumns{One Column}{Two Columns}

When this is defined, you can do the original question like:


This method does assume that the entire document is one or two columns and isn't switching.


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.