[Tex/LaTex] Length of the rule (twocolumn)

rulestwo-column

When \documentclass[a4paper, twocolumn] is declared, is there a way to change the size of the vertical rule created by LaTeX? (I need to increase it)

enter image description here

Any ideas?

Best Answer

One option would be to redefine \@outputdblcol (from the LaTeX kernel) to let the rule have some depth; the following example shows this redefinition (signaled with %NEW); I used a depth equal to 2ex, but you can use any other value; of course, this modification will apply to all the document:

\documentclass[twocolumn]{article}
\setlength\columnseprule{1pt}
\usepackage{lipsum}

\makeatletter
\def\@outputdblcol{%
\if@firstcolumn
\global \@firstcolumnfalse
\global \setbox\@leftcolumn \box\@outputbox
\else
\global \@firstcolumntrue
\setbox\@outputbox \vbox {%
\hb@xt@\textwidth {%
\hb@xt@\columnwidth {%
\box\@leftcolumn \hss}%
\hfil
{\normalcolor\vrule \@depth2ex \@width\columnseprule}%NEW (original without \@depth2ex)
\hfil
\hb@xt@\columnwidth {%
\box\@outputbox \hss}%
}%
}%
\@combinedblfloats
\@outputpage
\begingroup
\@dblfloatplacement
\@startdblcolumn
\@startdblcolumn.
\@whilesw\if@fcolmade \fi
{\@outputpage
\@startdblcolumn}%
\endgroup
\fi
}

\makeatother

\begin{document}

\lipsum[1-40]

\end{document}

A fragment of the bottom part of the first page showing the extension:

enter image description here

With the help of the etoolbox package, the code reduces to (using now a 3ex depth):

\documentclass[twocolumn]{article}
\setlength\columnseprule{1pt}
\usepackage{lipsum}
\usepackage{etoolbox}

\makeatletter
\patchcmd{\@outputdblcol}{\vrule \@width\columnseprule}{\vrule \@depth3ex \@width\columnseprule}{}{}
\makeatother

\begin{document}

\lipsum[1-40]

\end{document}
Related Question