6

multicol or memoir would be preferred. \columnseprule, I understand, is responsible for drawing a solid vertical line between columns. Is there a parsimonious way to achieve the following?

-----pretext---
###### : ######
###### : ######
###### : ######
###### : ######
###### : ######
###### : ######
-----posttext--
Simon Kuang
  • 1,861

2 Answers2

8

Here is a solution

\documentclass[twocolumn]{memoir}

\usepackage{xpatch}
\usepackage{graphicx}

\makeatletter
\xpatchcmd{\@outputdblcol}{\vrule\@width\columnseprule}{\rotatebox{90}{\parbox{\textheight}{\dotfill}}}{}{}
\makeatother

\usepackage{lipsum}



\begin{document}
\lipsum
\end{document}

enter image description here

touhami
  • 19,520
7

This is a preliminary version uing the multicol package as requested:

\documentclass{memoir}
\usepackage{multicol}
\usepackage{etoolbox}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\usepackage{lipsum}
%
\newcounter{mymulticol}
\setlength\columnsep{20pt}
%
\makeatletter
\def\LR@dotcolumn@boxes{%
     \process@cols\mult@gfirstbox{%
       \ifdim\dp\count@>\dimen\tw@
         \global\dimen\tw@\dp\count@ \fi
       \mc@col@status@write
       \box\count@\hss{\columnseprulecolor\tikzmark{middle-\themymulticol}\vrule
              \@width\columnseprule}\hss}%
     \ifdim\dp\mult@rightbox>\dimen\tw@
       \global\dimen\tw@\dp\mult@rightbox \fi
     \mc@lastcol@status@write
     \box\mult@rightbox\stepcounter{mymulticol}\tikzmark{end-\themymulticol}%
}
\newcommand\LRdotmulticolcolumns
    {\let\mc@align@columns
      \LR@dotcolumn@boxes}
\LRdotmulticolcolumns
\AtBeginEnvironment{multicols}{\stepcounter{mymulticol}\tikzmark{start-\themymulticol}}     

\AtEndEnvironment{multicols}{%
\raisebox{0pt}[0pt][0pt]{\tikz[remember picture,overlay]{
  \draw[dotted] 
    ([yshift=-17pt]{{pic cs:middle-\themymulticol}|-{pic cs:start-\themymulticol}}) --
    ([yshift=-2pt]{{pic cs:middle-\themymulticol}|-{pic cs:end-\themymulticol}});
}}}
\makeatother

\begin{document}

\lipsum[4]
\begin{multicols}{2}
\lipsum[4]
\end{multicols}
\lipsum[4]
\begin{multicols}{2}
\lipsum[4]
\end{multicols}
\lipsum[4]

\end{document}

The result:

enter image description here

The code needs two runs for the dotted lines to reach their final positions

The result:

Gonzalo Medina
  • 505,128