我正在使用paracol
环境。我有两列,它们之间有很大的间隙。为了帮助区分它们,我使用了\setlength{\columnseprule}{0.4pt}
。有没有办法调整垂直线,使其更靠近第二列(离第一列较远),而不是正中间?
\documentclass[twoside,12pt]{book}
\usepackage{paracol}
\usepackage{lipsum}
\begin{document}
\columnratio{0.65}
\setlength{\columnsep}{4em}
\setlength{\columnseprule}{0.4pt}
\begin{paracol}{2}
column 1:
\lipsum[1]
\switchcolumn
column 2:
\lipsum[2]
\end{paracol}
\end{document}
答案1
我将倾斜引入(硬连线)到宏中\pcol@hfil
,其中.8
和.2
值(各出现2次)之前为.5
。
\documentclass[twoside,12pt]{book}
\usepackage{paracol}
\usepackage{lipsum}
\makeatletter
\def\pcol@hfil#1{{%
\@tempdima\csname pcol@columnsep#1\endcsname\relax
\ifdim\columnseprule>\z@
\hskip.8\@tempdima\@plus1fil\relax
\hskip-.8\columnseprule
\@ifundefined{pcol@colseprulecolor#1}%
{\pcol@colseprulecolor}{\@nameuse{pcol@colseprulecolor#1}}%
\copy\pcol@tempbox \hskip-.2\columnseprule
\hskip.2\@tempdima\@plus1fil\relax
\else \hskip\@tempdima\@plus1fil\relax
\fi}}
\makeatother
\begin{document}
\columnratio{0.65}
\setlength{\columnsep}{4em}
\setlength{\columnseprule}{0.4pt}
\begin{paracol}{2}
column 1:
\lipsum[1]
\switchcolumn
column 2:
\lipsum[2]
\end{paracol}
\end{document}
同样可以通过以下方式完成此“修复” xpatch
:
\documentclass[twoside,12pt]{book}
\usepackage{paracol}
\usepackage{lipsum}
\usepackage{xpatch}
\makeatletter
\xpatchcmd{\pcol@hfil}{.5}{.8}{}{}
\xpatchcmd{\pcol@hfil}{.5}{.8}{}{}
\xpatchcmd{\pcol@hfil}{.5}{.2}{}{}
\xpatchcmd{\pcol@hfil}{.5}{.2}{}{}
\makeatother
\begin{document}
\columnratio{0.65}
\setlength{\columnsep}{4em}
\setlength{\columnseprule}{0.4pt}
\begin{paracol}{2}
column 1:
\lipsum[1]
\switchcolumn
column 2:
\lipsum[2]
\end{paracol}
\end{document}