5

In the following example, there's a spurious space in the one-column variant. The problem seems to be that in two-column mode, the \section command is at the "beginning of a column" and no space is inserted before, while in the one-column variant, there's a content before the \section which makes the standard before-section skip to be inserted.

How to remove the space in the one-column case?

(Remark: multicol is not an option.)

\documentclass{article}

\usepackage{lipsum}
\usepackage[latin]{babel}

\long\def\Xonecolumn#1{%
\vbox{\parindent0pt\relax#1\vspace{1ex}}%
}

\long\def\Xtwocolumn#1{\twocolumn[%
\vbox{\parindent0pt\relax#1\vspace{1ex}}%
]}

\let\Xcolumn\Xonecolumn
%\let\Xcolumn\Xtwocolumn

\begin{document}

\Xcolumn{{\Large In the real case, here is a title, authors, an abstract and so on and so forth\par}
\rule[1ex]{\linewidth}{0.4pt}}

\section{My first section}

\lipsum

\end{document}
  • May be something like \vspace{-2em} before of \section? – Fran Nov 3 '12 at 23:33
  • @Fran "something" like that, I can do myself. I want a general solution that doesn't need anything more inserted. – yo' Nov 4 '12 at 11:43
  • the general solution could be something as \makeatletter \renewcommand{\section}{\@startsection {section}{1}{0mm}{0\baselineskip}{0.5\baselineskip} {\bfseries\large}} \makeatother but I do not know of to make only for the first section. – Fran Nov 4 '12 at 17:43
  • @Fran Yeah, I can use fancyhdr anyways, the question is: How to detect if the text really starts with a sectioning command? I would be more happy to be able to "\unskip a future skip". – yo' Nov 4 '12 at 17:55
1

Well, since there's no better answer, I'll answer this with my final solution:

It is an article header so in the real usage, a command \section will always follow. Hence we can suppress the initial space introduced by this command. In my case, this is 2.25ex plus 1.25ex minus .2ex.

So it seems that the proper solution is

\long\def\Xonecolumn#1{%
\vbox{\parindent0pt\relax#1\vspace{1ex}}%
\vspace*{-2.25ex plus -1.25ex minus -.2ex}%
}

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.