How can I show the frames for inter-column margin under the twocolumn document class option?
The showframe package only draws the page margins + headers and footers. But I want to see a line for the margin between two columns.
How can I show the frames for inter-column margin under the twocolumn document class option?
The showframe package only draws the page margins + headers and footers. But I want to see a line for the margin between two columns.
One option using \@outputdblcol:
\documentclass[twocolumn]{article}
\usepackage{lipsum}
\usepackage{showframe}
\newlength\Fcolumnseprule
\setlength\Fcolumnseprule{0.4pt}
\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}%
\vrule \@width\Fcolumnseprule\hfil
{\normalcolor\vrule \@width\columnseprule}%original:
%\normalcolor\vrule \@width\columnseprule
\hfil\vrule \@width\Fcolumnseprule
\hb@xt@\columnwidth {%
\box\@outputbox \hss}%
}%
}%
\@combinedblfloats
\@outputpage
\begingroup
\@dblfloatplacement
\@startdblcolumn
\@whilesw\if@fcolmade \fi
{\@outputpage
\@startdblcolumn}%
\endgroup
\fi
}
\makeatother
\begin{document}
\lipsum[1-30]
\end{document}
A patch makes the code shorter:
\documentclass[twocolumn]{article}
\usepackage{lipsum}
\usepackage{showframe}
\usepackage{etoolbox}
\newlength\Fcolumnseprule
\setlength\Fcolumnseprule{0.4pt}
\makeatletter
\newcommand\ShowInterColumnFrame{
\patchcmd{\@outputdblcol}
{{\normalcolor\vrule \@width\columnseprule}}
{\vrule \@width\Fcolumnseprule\hfil
{\normalcolor\vrule \@width\columnseprule}
\hfil\vrule \@width\Fcolumnseprule
}
{}
{}
}
\makeatother
\ShowInterColumnFrame
\begin{document}
\lipsum[1-30]
\end{document}
\setlength\columnseprule{0.4pt}` – Gonzalo Medina Oct 05 '15 at 18:20multicolor thetwocolumnclass option? – Werner Oct 05 '15 at 18:26