| 1 |
% !TeX program = xelatex |
| 2 |
\documentclass{article} |
| 3 |
\usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry} |
| 4 |
\usepackage{fontspec} |
| 5 |
\usepackage[tikz]{multicolrule}[2019/10/01] |
| 6 |
\usepackage{lipsum} |
| 7 |
\usepackage{fancyvrb} |
| 8 |
\usepackage{bbding} |
| 9 |
\usepackage{pgfornament} |
| 10 |
\usepackage{bidi} |
| 11 |
\usetikzlibrary{math,calc} |
| 12 |
\setlength{\columnsep}{24pt} |
| 13 |
\setlength{\columnseprule}{.5pt} |
| 14 |
\begin{document} |
| 15 |
|
| 16 |
\section*{Style Gallery} |
| 17 |
This file gives brief examples covering all defined line styles and |
| 18 |
other functions available in \texttt{multicolrule}. See the documentation |
| 19 |
for instructions on how to set them in your own documents. |
| 20 |
|
| 21 |
\subsection*{Works without Tikz} |
| 22 |
\begin{multicols}{2}[Default] |
| 23 |
\lipsum[1] |
| 24 |
\end{multicols} |
| 25 |
|
| 26 |
\begin{multicols}{2}[Solid] |
| 27 |
\SetMCRule{line-style=solid} |
| 28 |
\lipsum[1] |
| 29 |
\end{multicols} |
| 30 |
|
| 31 |
\begin{multicols}{2}[Double (+ color test)] |
| 32 |
\SetMCRule{color=red,double=2pt} |
| 33 |
\lipsum[1] |
| 34 |
\end{multicols} |
| 35 |
|
| 36 |
\begin{multicols}{2}[Triple (+ color-model test)] |
| 37 |
\SetMCRule{triple=2pt,color-model=cmy,color={0.7,0.5,0.3}} |
| 38 |
\lipsum[1] |
| 39 |
\end{multicols} |
| 40 |
|
| 41 |
\begin{multicols}{2}[Dots] |
| 42 |
\SetMCRule{line-style=dots} |
| 43 |
\lipsum[1] |
| 44 |
\end{multicols} |
| 45 |
|
| 46 |
\begin{multicols}{2}[Dense Dots] |
| 47 |
\SetMCRule{line-style=dense-dots} |
| 48 |
\lipsum[1] |
| 49 |
\end{multicols} |
| 50 |
|
| 51 |
\begin{multicols}{2}[Loose Dots] |
| 52 |
\SetMCRule{line-style=loose-dots} |
| 53 |
\lipsum[1] |
| 54 |
\end{multicols} |
| 55 |
|
| 56 |
\begin{multicols}{2}[Dashed (ultra-thin)] |
| 57 |
\SetMCRule{width=ultra-thin,line-style=dashed} |
| 58 |
\lipsum[1] |
| 59 |
\end{multicols} |
| 60 |
|
| 61 |
\begin{multicols}{2}[Densely Dashed (very-thin)] |
| 62 |
\SetMCRule{width=very-thin,line-style=densely-dashed} |
| 63 |
\lipsum[1] |
| 64 |
\end{multicols} |
| 65 |
|
| 66 |
\begin{multicols}{2}[Loosely Dashed (thin)] |
| 67 |
\SetMCRule{width=thin,line-style=loosely-dashed} |
| 68 |
\lipsum[1] |
| 69 |
\end{multicols} |
| 70 |
|
| 71 |
\begin{multicols}{2}[Dotted (semithick)] |
| 72 |
\SetMCRule{width=semithick,line-style=dotted} |
| 73 |
\lipsum[1] |
| 74 |
\end{multicols} |
| 75 |
|
| 76 |
\begin{multicols}{2}[Densely Dotted (thick)] |
| 77 |
\SetMCRule{width=thick,line-style=densely-dotted} |
| 78 |
\lipsum[1] |
| 79 |
\end{multicols} |
| 80 |
|
| 81 |
\begin{multicols}{2}[Loosely Dotted (very thick)] |
| 82 |
\SetMCRule{width=very-thick,line-style=loosely-dotted} |
| 83 |
\lipsum[1] |
| 84 |
\end{multicols} |
| 85 |
|
| 86 |
\begin{multicols}{2}[Custom Tile] |
| 87 |
\SetMCRule{custom-tile={\SparkleBold}{12pt}{12pt}} |
| 88 |
\lipsum[1] |
| 89 |
\end{multicols} |
| 90 |
|
| 91 |
\begin{multicols}{2}[Custom Pattern] |
| 92 |
\SetMCRule{custom-pattern={\HandRight}{0pt}{0pt}} |
| 93 |
\lipsum[1] |
| 94 |
\end{multicols} |
| 95 |
|
| 96 |
\subsection*{Tikz Only} |
| 97 |
\begin{multicols}{2}[Circles] |
| 98 |
\SetMCRule{width=3pt,line-style=circles} |
| 99 |
\lipsum[1] |
| 100 |
\end{multicols} |
| 101 |
|
| 102 |
\begin{multicols}{2}[Dense Circles] |
| 103 |
\SetMCRule{width=3pt,line-style=dense-circles} |
| 104 |
\lipsum[1] |
| 105 |
\end{multicols} |
| 106 |
|
| 107 |
\begin{multicols}{2}[Loose Circles] |
| 108 |
\SetMCRule{width=3pt,line-style=loose-circles} |
| 109 |
\lipsum[1] |
| 110 |
\end{multicols} |
| 111 |
|
| 112 |
\begin{multicols}{2}[Solid Circles] |
| 113 |
\SetMCRule{width=3pt,line-style=solid-circles} |
| 114 |
\lipsum[1] |
| 115 |
\end{multicols} |
| 116 |
|
| 117 |
\begin{multicols}{2}[Dense Solid Circles] |
| 118 |
\SetMCRule{width=3pt,line-style=dense-solid-circles} |
| 119 |
\lipsum[1] |
| 120 |
\end{multicols} |
| 121 |
|
| 122 |
\begin{multicols}{2}[Loose Solid Circles] |
| 123 |
\SetMCRule{width=3pt,line-style=loose-solid-circles} |
| 124 |
\lipsum[1] |
| 125 |
\end{multicols} |
| 126 |
|
| 127 |
\begin{multicols}{2}[Dash-Dot (ultra-thick)] |
| 128 |
\SetMCRule{width=ultra-thick,line-style=dash-dot} |
| 129 |
\lipsum[1] |
| 130 |
\end{multicols} |
| 131 |
|
| 132 |
\begin{multicols}{2}[Densely Dash-Dot] |
| 133 |
\SetMCRule{line-style=densely-dash-dot} |
| 134 |
\lipsum[1] |
| 135 |
\end{multicols} |
| 136 |
|
| 137 |
\begin{multicols}{2}[Loosely Dash-Dot] |
| 138 |
\SetMCRule{line-style=loosely-dash-dot} |
| 139 |
\lipsum[1] |
| 140 |
\end{multicols} |
| 141 |
|
| 142 |
\begin{multicols}{2}[Dash-Dot-Dot] |
| 143 |
\SetMCRule{line-style=dash-dot-dot} |
| 144 |
\lipsum[1] |
| 145 |
\end{multicols} |
| 146 |
|
| 147 |
\begin{multicols}{2}[Densely Dash-Dot-Dot] |
| 148 |
\SetMCRule{line-style=densely-dash-dot-dot} |
| 149 |
\lipsum[1] |
| 150 |
\end{multicols} |
| 151 |
|
| 152 |
\begin{multicols}{2}[Loosely Dash-Dot-Dot] |
| 153 |
\SetMCRule{line-style=loosely-dash-dot-dot} |
| 154 |
\lipsum[1] |
| 155 |
\end{multicols} |
| 156 |
|
| 157 |
\begin{multicols}{2}[Custom Line] |
| 158 |
\SetMCRule{width=1pt,custom-line={\path (TOP) to [ornament=88] (BOT);}} |
| 159 |
\lipsum[1-2] |
| 160 |
\end{multicols} |
| 161 |
|
| 162 |
\begin{multicols}{2}[Custom line that is too wide for the separator] |
| 163 |
\SetMCRule{color=gray,repeat=4,repeat-distance=4pt,width=1pt,custom-line={\path (TOP) to [ornament=88] (BOT);}} |
| 164 |
\lipsum[1-2] |
| 165 |
\end{multicols} |
| 166 |
|
| 167 |
\begin{multicols}{2}[Custom line with horizontal lines flush with vertical rule\footnote{Based on an answer to tex.stackexchange question 47828}] |
| 168 |
\SetMCRule{color=gray,width=0.4pt, expand=2pt, custom-line={ |
| 169 |
\coordinate (TOPLEFT) at ($(TOP)-(\columnwidth+.5\columnsep,\columnseprule)$); |
| 170 |
\coordinate (TOPRIGHT) at ($(TOP)+(\columnwidth+.5\columnsep,-\columnseprule)$); |
| 171 |
\coordinate (BOTLEFT) at ($(BOT)-(\columnwidth+.5\columnsep,-\columnseprule)$); |
| 172 |
\coordinate (BOTRIGHT) at ($(BOT)+(\columnwidth+.5\columnsep,\columnseprule)$); |
| 173 |
\draw[line width=\columnseprule] (TOPLEFT) -- (TOPRIGHT) |
| 174 |
(TOP) -- (BOT) (BOTLEFT) -- (BOTRIGHT);}} |
| 175 |
\lipsum[1-2] |
| 176 |
\end{multicols} |
| 177 |
|
| 178 |
\setlength{\columnsep}{2in} |
| 179 |
|
| 180 |
\begin{multicols}{2}[Notepad image between two columns\footnote{Based on an answer to tex.stackexchange question 522305}] |
| 181 |
\SetMCRule{color=blue!10,width=2pt, custom-line={ |
| 182 |
\tikzmath {coordinate \t, \b; |
| 183 |
\t = (TOP)-(.45\columnsep,0); |
| 184 |
integer \r, \s; |
| 185 |
\r = \ty / 16; |
| 186 |
\s = \ty - \r*16; |
| 187 |
\t = (\t)-(0,.5*\s); |
| 188 |
\b = (\t)+(.9\columnsep,-\r*16); |
| 189 |
} |
| 190 |
\draw [line width=\columnseprule] |
| 191 |
(\t) -- ++(.9\columnsep,0) -- (\b) -- ++(-.9\columnsep,0) -- cycle; |
| 192 |
\foreach \fila in {1,...,\r} |
| 193 |
{ |
| 194 |
\draw [line width=\columnseprule] |
| 195 |
($(\t)-(0,\fila*16pt)$) -- ++(0.90\columnsep,0); |
| 196 |
} |
| 197 |
}} |
| 198 |
\lipsum[1-2] |
| 199 |
\end{multicols} |
| 200 |
|
| 201 |
\subsection*{Extended Rules} |
| 202 |
\setlength{\columnsep}{24pt} |
| 203 |
|
| 204 |
\begin{multicols}{2}[Solid -- extend bottom 16pt] |
| 205 |
\SetMCRule{line-style=solid,extend-bot=16pt} |
| 206 |
\lipsum[1] |
| 207 |
\end{multicols} |
| 208 |
|
| 209 |
\begin{multicols}{2}[Dots -- extend top 16pt] |
| 210 |
\SetMCRule{line-style=dots,extend-top=16pt} |
| 211 |
\lipsum[1] |
| 212 |
\end{multicols} |
| 213 |
|
| 214 |
\begin{multicols}{2}[Dashed -- expand -8pt] |
| 215 |
\SetMCRule{line-style=dashed,expand=-8pt} |
| 216 |
\lipsum[1] |
| 217 |
\end{multicols} |
| 218 |
|
| 219 |
\begin{multicols}{2}[Dots -- expand 8pt] |
| 220 |
\SetMCRule{line-style=dots,expand=8pt} |
| 221 |
\lipsum[1] |
| 222 |
\end{multicols} |
| 223 |
|
| 224 |
\begin{multicols}{2}[Dots -- shift 16pt] |
| 225 |
\SetMCRule{line-style=dots,shift=16pt} |
| 226 |
\lipsum[1-2] |
| 227 |
\end{multicols} |
| 228 |
|
| 229 |
\begin{multicols}{2}[Extend-fill with extend-reserve] |
| 230 |
\SetMCRule{line-style=solid,extend-fill,extend-reserve=\baselineskip} |
| 231 |
\lipsum[1-2] |
| 232 |
\end{multicols} |
| 233 |
And something at the end to show the reserved space. |
| 234 |
|
| 235 |
\begin{multicols}{2}[Strut with extend-fill + extend-reserve] |
| 236 |
\SetMCRule{line-style=strut,extend-fill,extend-reserve=\baselineskip} |
| 237 |
\lipsum[1-3] |
| 238 |
\end{multicols} |
| 239 |
This text is here to show the effect of the strut used as a separator above. |
| 240 |
|
| 241 |
\subsection*{Patterns} |
| 242 |
|
| 243 |
\DeclareMCRulePattern{left-hand}{custom-tile={\HandLeft}{8pt}{8pt}} |
| 244 |
\DeclareMCRulePattern{right-hand}{custom-tile={\HandRight}{8pt}{8pt}} |
| 245 |
\DeclareMCRulePattern{shrinking}{line-style=solid,color=blue,extend-top=-16pt} |
| 246 |
\begin{multicols}{3}[Alternating Patterns] |
| 247 |
\SetMCRule{patterns={left-hand,right-hand}} |
| 248 |
\lipsum[1-3] |
| 249 |
\end{multicols} |
| 250 |
|
| 251 |
\begin{multicols}{3}[Shrink and color first rule only] |
| 252 |
\raggedcolumns |
| 253 |
\SetMCRule{patterns=shrinking,pattern-for=1} |
| 254 |
\lipsum[1-2] |
| 255 |
\end{multicols} |
| 256 |
|
| 257 |
\begin{multicols}{4}[Shrink and color second and third rules only] |
| 258 |
\raggedcolumns |
| 259 |
\SetMCRule{patterns=shrinking,pattern-after=1,pattern-for=2} |
| 260 |
\lipsum[1-2] |
| 261 |
\end{multicols} |
| 262 |
|
| 263 |
\DeclareMCRulePattern{circlei}{width=3pt,line-style=loose-solid-circles,color=black} |
| 264 |
\DeclareMCRulePattern{circleii}{width=6pt,line-style=loose-solid-circles,color=black!75} |
| 265 |
\DeclareMCRulePattern{circleiii}{width=9pt,line-style=loose-solid-circles,color=black!50} |
| 266 |
\DeclareMCRulePattern{circleiv}{width=12pt,line-style=loose-solid-circles,color=black!25} |
| 267 |
\SetMCRule{patterns={circlei,circleii,circleiii,circleiv}} |
| 268 |
\begin{multicols}{4}[Growing and fading circles] |
| 269 |
\raggedcolumns |
| 270 |
\lipsum[1-2] |
| 271 |
\end{multicols} |
| 272 |
|
| 273 |
\begin{multicols}{4}[The same, pattern cycling across environment boundary] |
| 274 |
\raggedcolumns |
| 275 |
\lipsum[1-2] |
| 276 |
\end{multicols} |
| 277 |
|
| 278 |
\DeclareMCRulePattern{invisible}{width=thin,line-style=strut} |
| 279 |
\SetMCRule{patterns={left-hand,invisible,right-hand}} |
| 280 |
\begin{multicols}{4}[Invisible middle divider with strut] |
| 281 |
\raggedcolumns |
| 282 |
\lipsum[1-2] |
| 283 |
\end{multicols} |
| 284 |
|
| 285 |
\DeclareMCRulePattern{blue-double}{width=thick,line-style=solid,color=blue,double=3pt} |
| 286 |
\DeclareMCRulePattern{orange-triple}{width=thick,line-style=solid,color=orange,triple=3pt} |
| 287 |
\begin{multicols}{2}[Nested multicols environments] |
| 288 |
\SetMCRule{patterns={blue-double,blue-double,orange-triple}} |
| 289 |
|
| 290 |
\lipsum[1][1-5] |
| 291 |
|
| 292 |
\begin{multicols}{2} |
| 293 |
\lipsum[1][1-3] |
| 294 |
\end{multicols} |
| 295 |
|
| 296 |
\lipsum[1][1-5] |
| 297 |
|
| 298 |
\lipsum[1][1-5] |
| 299 |
|
| 300 |
\begin{multicols}{2} |
| 301 |
\lipsum[1][1-3] |
| 302 |
\end{multicols} |
| 303 |
|
| 304 |
\lipsum[1][1-5] |
| 305 |
|
| 306 |
\end{multicols} |
| 307 |
|
| 308 |
\subsection*{RTL Test} |
| 309 |
|
| 310 |
\RLmulticolcolumns |
| 311 |
\SetMCRule{patterns={}} |
| 312 |
\begin{multicols}{2}[Reverse Columns Only] |
| 313 |
\SetMCRule{custom-tile={+}{8pt}{8pt}} |
| 314 |
\lipsum[1] |
| 315 |
\end{multicols} |
| 316 |
|
| 317 |
\begin{RTL} |
| 318 |
\begin{multicols}{2}[Mode RTL Full] |
| 319 |
\SetMCRule{line-style=dashed} |
| 320 |
\lipsum[1] |
| 321 |
\end{multicols} |
| 322 |
\end{RTL} |
| 323 |
|
| 324 |
|
| 325 |
\end{document} |