如何在twocolumn
文档类别选项下显示列间边距的框架?
该showframe
包仅绘制了页边距 + 页眉和页脚。但我想看到两列之间的边距线。
答案1
一个选项是使用\@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}
补丁使代码更短:
\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}