更改“twocolumn”选项以获取从右到左的列

更改“twocolumn”选项以获取从右到左的列

当使用双列选项在纸上书写时,先从左侧开始,然后从右侧开始,我希望将双列选项更改为从右侧开始在纸上书写

\documentclass[twocolumn]{article}
\usepackage{lipsum}

\setlength{\columnseprule}{.4pt}

% change twocolumn option to start writing from right side

\begin{document}

\lipsum[1-4] 

\end{document} 

答案1

事实证明这并不难。你只需要进行修补,\@outputdblcol以便反转两列的顺序。显然,这不会改变任何其他内容,使其从右到左。

\documentclass[twocolumn]{article}
\usepackage{lipsum}

\setlength{\columnseprule}{.4pt}

% change twocolumn option to start writing from right side
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@outputdblcol}
  {\hb@xt@\textwidth{%
     \hb@xt@\columnwidth{\box\@leftcolumn \hss}%
     \hfil
     {\normalcolor\vrule \@width\columnseprule}%
     \hfil
     \hb@xt@\columnwidth{\box\@outputbox \hss}}}
  {\hb@xt@\textwidth{%
     \hb@xt@\columnwidth{\box\@outputbox \hss}%
     \hfil
     {\normalcolor\vrule \@width\columnseprule}%
     \hfil
     \hb@xt@\columnwidth{\box\@leftcolumn \hss}}}
   {\message{Patching \string\@ouputdblcol\space succeded^^J}}
   {\message{Patching \string\@ouputdblcol\space failed^^J}}
\makeatother

\begin{document}

\lipsum[1-4] 

\end{document} 

在此处输入图片描述

相关内容