% !TeX program = xelatex
\documentclass{article}
\usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}
\usepackage{fontspec}
\usepackage[tikz]{multicolrule}[2019/10/01]
\usepackage{lipsum}
\usepackage{fancyvrb}
\usepackage{bbding}
\usepackage{pgfornament}
\usepackage{bidi}
\usetikzlibrary{math,calc}
\setlength{\columnsep}{24pt}
\setlength{\columnseprule}{.5pt}
\begin{document}

\section*{Style Gallery}
This file gives brief examples covering all defined line styles and
other functions available in \texttt{multicolrule}. See the documentation
for instructions on how to set them in your own documents.

\subsection*{Works without Tikz}
\begin{multicols}{2}[Default]
\lipsum[1]
\end{multicols}

\begin{multicols}{2}[Solid]
  \SetMCRule{line-style=solid}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Double (+ color test)]
  \SetMCRule{color=red,double=2pt}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Triple (+ color-model test)]
  \SetMCRule{triple=2pt,color-model=cmy,color={0.7,0.5,0.3}}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Dots]
\SetMCRule{line-style=dots}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Dense Dots]
  \SetMCRule{line-style=dense-dots}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Loose Dots]
  \SetMCRule{line-style=loose-dots}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Dashed (ultra-thin)]
  \SetMCRule{width=ultra-thin,line-style=dashed}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Densely Dashed (very-thin)]
  \SetMCRule{width=very-thin,line-style=densely-dashed}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Loosely Dashed (thin)]
  \SetMCRule{width=thin,line-style=loosely-dashed}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Dotted (semithick)]
  \SetMCRule{width=semithick,line-style=dotted}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Densely Dotted (thick)]
  \SetMCRule{width=thick,line-style=densely-dotted}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Loosely Dotted (very thick)]
  \SetMCRule{width=very-thick,line-style=loosely-dotted}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Custom Tile]
  \SetMCRule{custom-tile={\SparkleBold}{12pt}{12pt}}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Custom Pattern]
  \SetMCRule{custom-pattern={\HandRight}{0pt}{0pt}}
  \lipsum[1]
\end{multicols}

\subsection*{Tikz Only}
\begin{multicols}{2}[Circles]
  \SetMCRule{width=3pt,line-style=circles}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Dense Circles]
  \SetMCRule{width=3pt,line-style=dense-circles}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Loose Circles]
  \SetMCRule{width=3pt,line-style=loose-circles}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Solid Circles]
  \SetMCRule{width=3pt,line-style=solid-circles}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Dense Solid Circles]
  \SetMCRule{width=3pt,line-style=dense-solid-circles}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Loose Solid Circles]
  \SetMCRule{width=3pt,line-style=loose-solid-circles}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Dash-Dot (ultra-thick)]
  \SetMCRule{width=ultra-thick,line-style=dash-dot}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Densely Dash-Dot]
  \SetMCRule{line-style=densely-dash-dot}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Loosely Dash-Dot]
  \SetMCRule{line-style=loosely-dash-dot}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Dash-Dot-Dot]
  \SetMCRule{line-style=dash-dot-dot}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Densely Dash-Dot-Dot]
  \SetMCRule{line-style=densely-dash-dot-dot}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Loosely Dash-Dot-Dot]
  \SetMCRule{line-style=loosely-dash-dot-dot}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Custom Line]
  \SetMCRule{width=1pt,custom-line={\path (TOP) to [ornament=88] (BOT);}}
  \lipsum[1-2]
\end{multicols}

\begin{multicols}{2}[Custom line that is too wide for the separator]
  \SetMCRule{color=gray,repeat=4,repeat-distance=4pt,width=1pt,custom-line={\path (TOP) to [ornament=88] (BOT);}}
  \lipsum[1-2]
\end{multicols}

\begin{multicols}{2}[Custom line with horizontal lines flush with vertical rule\footnote{Based on an answer to tex.stackexchange question 47828}]
  \SetMCRule{color=gray,width=0.4pt, expand=2pt, custom-line={
      \coordinate (TOPLEFT) at ($(TOP)-(\columnwidth+.5\columnsep,\columnseprule)$);
      \coordinate (TOPRIGHT) at ($(TOP)+(\columnwidth+.5\columnsep,-\columnseprule)$);
      \coordinate (BOTLEFT) at ($(BOT)-(\columnwidth+.5\columnsep,-\columnseprule)$);
      \coordinate (BOTRIGHT) at ($(BOT)+(\columnwidth+.5\columnsep,\columnseprule)$);
      \draw[line width=\columnseprule] (TOPLEFT) -- (TOPRIGHT)
      (TOP) -- (BOT) (BOTLEFT) -- (BOTRIGHT);}}
  \lipsum[1-2]
\end{multicols}

\setlength{\columnsep}{2in}

\begin{multicols}{2}[Notepad image between two columns\footnote{Based on an answer to tex.stackexchange question 522305}]
      \SetMCRule{color=blue!10,width=2pt, custom-line={
      \tikzmath {coordinate \t, \b;
        \t = (TOP)-(.45\columnsep,0);
        integer \r, \s;
        \r = \ty / 16;
        \s = \ty - \r*16;
        \t = (\t)-(0,.5*\s);
        \b = (\t)+(.9\columnsep,-\r*16);
      }
      \draw [line width=\columnseprule]
      (\t) -- ++(.9\columnsep,0) -- (\b) -- ++(-.9\columnsep,0) -- cycle;
      \foreach \fila in {1,...,\r}
      {
        \draw [line width=\columnseprule]
        ($(\t)-(0,\fila*16pt)$) -- ++(0.90\columnsep,0);
      }
  }}
  \lipsum[1-2]
\end{multicols}

\subsection*{Extended Rules}
\setlength{\columnsep}{24pt}

\begin{multicols}{2}[Solid -- extend bottom 16pt]
  \SetMCRule{line-style=solid,extend-bot=16pt}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Dots -- extend top 16pt]
  \SetMCRule{line-style=dots,extend-top=16pt}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Dashed -- expand -8pt]
  \SetMCRule{line-style=dashed,expand=-8pt}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Dots -- expand 8pt]
  \SetMCRule{line-style=dots,expand=8pt}
  \lipsum[1]
\end{multicols}

\begin{multicols}{2}[Dots -- shift 16pt]
  \SetMCRule{line-style=dots,shift=16pt}
  \lipsum[1-2]
\end{multicols}

\begin{multicols}{2}[Extend-fill with extend-reserve]
  \SetMCRule{line-style=solid,extend-fill,extend-reserve=\baselineskip}
  \lipsum[1-2]
\end{multicols}
And something at the end to show the reserved space.

\begin{multicols}{2}[Strut with extend-fill + extend-reserve]
  \SetMCRule{line-style=strut,extend-fill,extend-reserve=\baselineskip}
  \lipsum[1-3]
\end{multicols}
This text is here to show the effect of the strut used as a separator above. 

\subsection*{Patterns}

\DeclareMCRulePattern{left-hand}{custom-tile={\HandLeft}{8pt}{8pt}}
\DeclareMCRulePattern{right-hand}{custom-tile={\HandRight}{8pt}{8pt}}
\DeclareMCRulePattern{shrinking}{line-style=solid,color=blue,extend-top=-16pt}
\begin{multicols}{3}[Alternating Patterns]
  \SetMCRule{patterns={left-hand,right-hand}}
  \lipsum[1-3]
\end{multicols}

\begin{multicols}{3}[Shrink and color first rule only]
  \raggedcolumns
  \SetMCRule{patterns=shrinking,pattern-for=1}
  \lipsum[1-2]
\end{multicols}

\begin{multicols}{4}[Shrink and color second and third rules only]
  \raggedcolumns
  \SetMCRule{patterns=shrinking,pattern-after=1,pattern-for=2}
  \lipsum[1-2]
\end{multicols}

\DeclareMCRulePattern{circlei}{width=3pt,line-style=loose-solid-circles,color=black}
\DeclareMCRulePattern{circleii}{width=6pt,line-style=loose-solid-circles,color=black!75}
\DeclareMCRulePattern{circleiii}{width=9pt,line-style=loose-solid-circles,color=black!50}
\DeclareMCRulePattern{circleiv}{width=12pt,line-style=loose-solid-circles,color=black!25}
\SetMCRule{patterns={circlei,circleii,circleiii,circleiv}}
\begin{multicols}{4}[Growing and fading circles]
  \raggedcolumns
  \lipsum[1-2]
\end{multicols}

\begin{multicols}{4}[The same, pattern cycling across environment boundary]
  \raggedcolumns
  \lipsum[1-2]
\end{multicols}

\DeclareMCRulePattern{invisible}{width=thin,line-style=strut}
\SetMCRule{patterns={left-hand,invisible,right-hand}}
\begin{multicols}{4}[Invisible middle divider with strut]
  \raggedcolumns
  \lipsum[1-2]
\end{multicols}

\DeclareMCRulePattern{blue-double}{width=thick,line-style=solid,color=blue,double=3pt}
\DeclareMCRulePattern{orange-triple}{width=thick,line-style=solid,color=orange,triple=3pt}
\begin{multicols}{2}[Nested multicols environments]
\SetMCRule{patterns={blue-double,blue-double,orange-triple}}

\lipsum[1][1-5]

\begin{multicols}{2}
\lipsum[1][1-3]
\end{multicols}  

\lipsum[1][1-5]

\lipsum[1][1-5]

\begin{multicols}{2}
\lipsum[1][1-3]
\end{multicols}  

\lipsum[1][1-5]

\end{multicols}

\subsection*{RTL Test}

\RLmulticolcolumns
\SetMCRule{patterns={}}
\begin{multicols}{2}[Reverse Columns Only]
  \SetMCRule{custom-tile={+}{8pt}{8pt}}
  \lipsum[1]
\end{multicols}

\begin{RTL}
  \begin{multicols}{2}[Mode RTL Full]
    \SetMCRule{line-style=dashed}
    \lipsum[1]
  \end{multicols}
\end{RTL}


\end{document}
