twocolumn,两列边距均位于列的左侧

twocolumn,两列边距均位于列的左侧

我想要两列左侧的边距。

类似帖子显示如何在列之间移动两个边距,但我只希望在列之间移动第二列边距。

我确信这很简单,但我不是乳胶大师,而且感到沮丧。

答案1

您可以\if@firstcolumn从 marginpar 处理程序中删除测试,以便始终将注释添加在左侧,然后安排列 sep 大于 marginpar 宽度

在此处输入图片描述

\documentclass[twocolumn,a5paper]{article}
\setlength\columnsep{4cm}
\addtolength\oddsidemargin{2cm}
\setlength\marginparwidth{3cm}


\makeatletter
\def\@addmarginpar{\@next\@marbox\@currlist{\@cons\@freelist\@marbox
    \@cons\@freelist\@currbox}\@latexbug\@tempcnta\@ne
    \if@twocolumn
        % always \if@firstcolumn 
          \@tempcnta\m@ne
       % \fi
    \else
      \if@mparswitch
         \ifodd\c@page \else\@tempcnta\m@ne \fi
      \fi
      \if@reversemargin \@tempcnta -\@tempcnta \fi
    \fi
    \ifnum\@tempcnta <\z@  \global\setbox\@marbox\box\@currbox \fi
    \@tempdima\@mparbottom
    \advance\@tempdima -\@pageht
    \advance\@tempdima\ht\@marbox
    \ifdim\@tempdima >\z@
      \@latex@warning@no@line {Marginpar on page \thepage\space moved}%
    \else
      \@tempdima\z@
    \fi
    \global\@mparbottom\@pageht
    \global\advance\@mparbottom\@tempdima
    \global\advance\@mparbottom\dp\@marbox
    \global\advance\@mparbottom\marginparpush
    \advance\@tempdima -\ht\@marbox
    \global\setbox \@marbox
                   \vbox {\vskip \@tempdima
                          \box \@marbox}%
    \global \ht\@marbox \z@
    \global \dp\@marbox \z@
    \kern -\@pagedp
    \nointerlineskip
    \hb@xt@\columnwidth
      {\ifnum \@tempcnta >\z@
          \hskip\columnwidth \hskip\marginparsep
       \else
          \hskip -\marginparsep \hskip -\marginparwidth
       \fi
       \box\@marbox \hss}%
    \nointerlineskip
    \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}}
\makeatother

\def\z{\stepcounter{enumi}\theenumi, one two three four five. Red blue Green. }
\def\zz{\z\z Sone text\marginpar{some text in the margin} with a note. }
\def\zzz{\zz\z\z\zz}
\begin{document}

\zzz \zz \zz \zzz

\z\z\zzz\zz \z\z\zzz\zz

\zz\z\zzz \zz\z\zzz
\end{document}

相关内容