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.

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?

share|improve this question
    
Can you please add to your question a minimal, complete document producing the output of the image? –  Gonzalo Medina Aug 2 '12 at 3:01
add comment

2 Answers

up vote 3 down vote accepted

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}
share|improve this answer
    
The second way is exactly what I was looking for. Thank you so much! –  user13596 Aug 2 '12 at 3:25
    
@user13596: Then you must click the green check mark, I think. –  Harish Kumar Aug 2 '12 at 4:28
add comment

Recommend you use the multicol package which allows you to set \columnseprule to the desired width. Additionally the multicol package allows you to change the number of columns at any point in the document.

\documentclass{article}
\usepackage{multicol,lipsum}
\begin{document}
\setlength{\columnseprule}{1pt}
\begin{multicols}{2}
\lipsum
\end{multicols}
\newpage
\setlength{\columnseprule}{.5pt}
\begin{multicols}{3}
\lipsum
\end{multicols}
\end{document}
share|improve this answer
    
But your answer doesn't change the length of the vertical rule and this seems to be what the OP wants to do. Also, \columnseprule can be changed without multicol. –  Gonzalo Medina Aug 2 '12 at 2:58
    
Exactly! I want to change de length, not the thickness. My code is about 1500 lines, because it depends of a lot of code involving conditionals. Is it reasonable put it here? –  user13596 Aug 2 '12 at 3:05
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.