[Tex/LaTex] Adjust vertical line between columns

columnslineparacolspacing

I'm using the paracol environment. I have two columns that have quite a gap between them. To help distinguish between them I am using \setlength{\columnseprule}{0.4pt}. Is there any way to adjust the vertical line so that it is closer to the second column (farther from the first) instead of right down the middle?

\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}

enter image description here

Best Answer

I introduce (hardwire) the skew into the macro \pcol@hfil, where the .8 and .2 values (2 occurrences each) were previously .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}

enter image description here

This "fix" can likewise be accomplished with 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}
Related Question