-
Notifications
You must be signed in to change notification settings - Fork 6
/
expected.html
823 lines (800 loc) · 42.9 KB
/
expected.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="author" content="Julien Dutant" />
<title>Columns - Multiple columns support in Pandoc’s markdown</title>
<style>
html {
color: #1a1a1a;
background-color: #fdfdfd;
}
body {
margin: 0 auto;
max-width: 36em;
padding-left: 50px;
padding-right: 50px;
padding-top: 50px;
padding-bottom: 50px;
hyphens: auto;
overflow-wrap: break-word;
text-rendering: optimizeLegibility;
font-kerning: normal;
}
@media (max-width: 600px) {
body {
font-size: 0.9em;
padding: 12px;
}
h1 {
font-size: 1.8em;
}
}
@media print {
html {
background-color: white;
}
body {
background-color: transparent;
color: black;
font-size: 12pt;
}
p, h2, h3 {
orphans: 3;
widows: 3;
}
h2, h3, h4 {
page-break-after: avoid;
}
}
p {
margin: 1em 0;
}
a {
color: #1a1a1a;
}
a:visited {
color: #1a1a1a;
}
img {
max-width: 100%;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 1.4em;
}
h5, h6 {
font-size: 1em;
font-style: italic;
}
h6 {
font-weight: normal;
}
ol, ul {
padding-left: 1.7em;
margin-top: 1em;
}
li > ol, li > ul {
margin-top: 0;
}
blockquote {
margin: 1em 0 1em 1.7em;
padding-left: 1em;
border-left: 2px solid #e6e6e6;
color: #606060;
}
code {
font-family: Menlo, Monaco, Consolas, 'Lucida Console', monospace;
font-size: 85%;
margin: 0;
hyphens: manual;
}
pre {
margin: 1em 0;
overflow: auto;
}
pre code {
padding: 0;
overflow: visible;
overflow-wrap: normal;
}
.sourceCode {
background-color: transparent;
overflow: visible;
}
hr {
background-color: #1a1a1a;
border: none;
height: 1px;
margin: 1em 0;
}
table {
margin: 1em 0;
border-collapse: collapse;
width: 100%;
overflow-x: auto;
display: block;
font-variant-numeric: lining-nums tabular-nums;
}
table caption {
margin-bottom: 0.75em;
}
tbody {
margin-top: 0.5em;
border-top: 1px solid #1a1a1a;
border-bottom: 1px solid #1a1a1a;
}
th {
border-top: 1px solid #1a1a1a;
padding: 0.25em 0.5em 0.25em 0.5em;
}
td {
padding: 0.125em 0.5em 0.25em 0.5em;
}
header {
margin-bottom: 4em;
text-align: center;
}
#TOC li {
list-style: none;
}
#TOC ul {
padding-left: 1.3em;
}
#TOC > ul {
padding-left: 0;
}
#TOC a:not(:hover) {
text-decoration: none;
}
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { color: #008000; } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { color: #008000; font-weight: bold; } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<style>
/* Styles added by the columns.lua pandoc filter */
.columns :first-child {margin-top: 0;}
.column-span + * {margin-top: 0;}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header id="title-block-header">
<h1 class="title">Columns - Multiple columns support in Pandoc’s
markdown</h1>
<p class="author">Julien Dutant</p>
</header>
<h1 id="columns">Columns</h1>
<p>Multiple columns support in Pandoc’s markdown.</p>
<p>Copyright: ©2021-23 Julien Dutant <a
href="mailto:[email protected]"
class="email">[email protected]</a> License: MIT - see LICENSE
file for details.</p>
<h2 id="introduction">Introduction</h2>
<p>This Lua filter for Pandoc provides a flexible markdown syntax for
multicolumn support in <a href="https://pandoc.org/">Pandoc</a>
targetting both HTML and LaTeX/PDF output. Features:</p>
<ul>
<li>Multiple markdown syntaxes (“three-columns” Div, nested “columns”
and “column” Div, “columns” with explicit column breaks)</li>
<li>Column breaks can be automatic or explicit</li>
<li>Spanning elements breaking across all columns</li>
<li>Customizing gaps and separators</li>
<li>Automatically provides CSS header / LaTeX preamble</li>
<li>Automatic typographic adjustements (avoid empty space at the top of
the first column which sometimes appears in HTML).</li>
<li>Recursive (multi-columns within multi-columns)</li>
</ul>
<p>Html output relies on <a
href="https://drafts.csswg.org/css-multicol">CSS Multi-column layout</a>
and LaTeX/PDF outputs on the <a
href="https://www.ctan.org/pkg/multicol"><code>multicol</code> LaTeX
package</a>.</p>
<p>Limitations: in <code>html</code> output, support is limited to
recent browsers and variable across browsers.</p>
<p>This document also serves as a test document. To see the
multi-columns layouts of this document in action, you need to process it
with <code>pandoc</code> using this filter.</p>
<p><strong>NOTE</strong> This README.md is a demonstration file, it is
<a href="https://github.com/dialoa/columns/blob/master/test.pdf">better
viewed as PDF</a>.</p>
<h2 id="pre-requistes">Pre-requistes</h2>
<p>Requires <a href="https://pandoc.org/">Pandoc</a>. Copy the file
<code>columns.lua</code> in your working folder or in Pandoc’s
<code>filter</code> folder. Called from the command line with a
<code>-L</code> or <code>--lua-filter</code> option:</p>
<div class="sourceCode" id="cb1"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pandoc</span> <span class="at">--lua-filter</span> columns.lua SOURCE.md <span class="at">-o</span> DESTINATION.html</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="ex">pandoc</span> <span class="at">-L</span> columns.lua SOURCE.md <span class="at">-o</span> DESTINATION.pdf</span></code></pre></div>
<p>Or from a <code>filters</code> field in a Pandoc defaults file. See
the <a href="https://pandoc.org/MANUAL.html">Pandoc documentation</a>
for further details.</p>
<p>For instance, to process the present documentation use:</p>
<div class="sourceCode" id="cb2"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">pandoc</span> <span class="at">-L</span> columns.lua README.md <span class="at">-o</span> readme.html</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="ex">pandoc</span> <span class="at">-L</span> columns.lua README.md <span class="at">-o</span> readme.pdf</span></code></pre></div>
<h2 id="basic-usage">Basic usage</h2>
<h3 id="columns-1">Columns</h3>
<p>In Pandoc markdown source specify a multicolumn section as
follows:</p>
<div class="sourceCode" id="cb3"><pre
class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>::: columns</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a>...content that will be spread over several columns...</span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a>:::</span></code></pre></div>
<p>The filter will render this section as a multicolumns layout in
<code>html</code> and LaTeX, as illustrated below (you need to process
this document with <code>pandoc</code> using this filter to see the
results in <code>html</code> or <code>pdf</code>:</p>
<div class="columns" style="column-count: 2 ;">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a ante
in mi ornare volutpat sed sit amet diam. Nullam interdum erat a augue
faucibus, nec tempus tortor sagittis. Aenean imperdiet imperdiet
dignissim. Nam aliquam blandit ex, sed molestie nibh feugiat ac. Morbi
feugiat convallis semper. Ut et consequat purus. Fusce convallis
vehicula enim in vulputate. Curabitur a augue arcu. Mauris laoreet
lectus arcu, sed elementum turpis scelerisque id. Etiam porta turpis
quis ipsum dictum vulputate. In ut convallis urna, at imperdiet nunc.
Cras laoreet, massa lobortis gravida egestas, lacus est pellentesque
arcu, imperdiet efficitur nibh dolor vel sapien. Sed accumsan
condimentum diam non pellentesque.</p><p>Vestibulum cursus nisi risus,
sit amet consectetur massa suscipit nec. Sed condimentum, est id iaculis
ornare, purus risus finibus felis, posuere congue est nibh eget dui.
Maecenas orci erat, commodo auctor justo quis, vestibulum mollis ex.
Vivamus sed bibendum turpis. Donec auctor, leo a cursus efficitur, quam
urna dignissim enim, viverra condimentum orci est non sem. Donec ac
viverra nisl. Suspendisse ac auctor massa. Mauris porttitor purus vel
velit vehicula, sed efficitur odio lacinia. Fusce sed odio arcu. Ut
rhoncus lacus vel magna interdum tincidunt. Nunc imperdiet finibus
tincidunt.</p>
</div>
<p>This syntax is based on the <a
href="https://pandoc.org/MANUAL.html#divs-and-spans"><code>fenced_div</code>
syntax of Pandoc’s’ markdown</a>. At least three consecutive colons are
needed, both at the beginning and at then end of your multi-column
section (even if it runs until the end of your document). But more than
three are fine:</p>
<div class="sourceCode" id="cb4"><pre
class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>::: columns ::::::</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a>...content that will be spread over several columns...</span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a>::::::::::::::</span></code></pre></div>
<p>Each opening series of colons needs to be matched with a closing
ones. For readibility we usually match their number of colons but it’s
not necessary (as the above illustrates). If you enclose sections within
sections (see container syntax, nesting, column spans and column breaks
below) you need to make sure that each opening series of colons is
matched by a closing one, otherwise Pandoc will not recognize them or
interpret them incorrectly.</p>
<p>Here <code>columns</code> is a <em>attribute</em> of the fenced div
(section). As we’ll see below, these sections can have more than a
single attribute. When they have several, they need to be specified
within curly brackets and <code>columns</code> should be preceded by a
dot, as in:</p>
<div class="sourceCode" id="cb5"><pre
class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>::::: {.columns .someattribute property=value}</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a>...content that will be spread over several columns...</span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb5-5"><a href="#cb5-5" aria-hidden="true" tabindex="-1"></a>:::::</span></code></pre></div>
<h3 id="beware-of-divs-in-fluid-columns">Beware of Divs in fluid
columns</h3>
<p>With fluid columns, i.e. no explicit line breaks, browsers decide
where to put line breaks. Beware though that Divs elements within a
column are counted as unbreakable blocks in most browsers. For instance,
the following places a Div with classes “.only-in-format .html” within a
fluid multiple columns:</p>
<div class="sourceCode" id="cb6"><pre
class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>::::: columns</span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a>::: {.only-in-format .html}</span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a>First paragraph (...)</span>
<span id="cb6-6"><a href="#cb6-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-7"><a href="#cb6-7" aria-hidden="true" tabindex="-1"></a>Second paragraph (...)</span>
<span id="cb6-8"><a href="#cb6-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-9"><a href="#cb6-9" aria-hidden="true" tabindex="-1"></a>Third paragraph (...)</span>
<span id="cb6-10"><a href="#cb6-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-11"><a href="#cb6-11" aria-hidden="true" tabindex="-1"></a>:::</span>
<span id="cb6-12"><a href="#cb6-12" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb6-13"><a href="#cb6-13" aria-hidden="true" tabindex="-1"></a>:::::</span></code></pre></div>
<p>You might expect the columns to break between one of these paragraphs
or within them. But they won’t: browsers will usually treat the entire
three-paragraph Div as one block that will stay in a single column.
Solutions: either move the contained outside, or break it into multiple
ones.</p>
<p>Moving it outside:</p>
<div class="sourceCode" id="cb7"><pre
class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>::: {.only-in-format .html}</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a>::::: columns</span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a>First paragraph (...)</span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true" tabindex="-1"></a>Second paragraph (...)</span>
<span id="cb7-8"><a href="#cb7-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-9"><a href="#cb7-9" aria-hidden="true" tabindex="-1"></a>Third paragraph (...)</span>
<span id="cb7-10"><a href="#cb7-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-11"><a href="#cb7-11" aria-hidden="true" tabindex="-1"></a>:::::</span>
<span id="cb7-12"><a href="#cb7-12" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-13"><a href="#cb7-13" aria-hidden="true" tabindex="-1"></a>:::</span></code></pre></div>
<p>Breaking it up:</p>
<div class="sourceCode" id="cb8"><pre
class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>::::: columns</span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a>::: {.only-in-format .html}</span>
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a>First paragraph (...)</span>
<span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a>:::</span>
<span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-9"><a href="#cb8-9" aria-hidden="true" tabindex="-1"></a>::: {.only-in-format .html}</span>
<span id="cb8-10"><a href="#cb8-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-11"><a href="#cb8-11" aria-hidden="true" tabindex="-1"></a>Second paragraph (...)</span>
<span id="cb8-12"><a href="#cb8-12" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-13"><a href="#cb8-13" aria-hidden="true" tabindex="-1"></a>:::</span>
<span id="cb8-14"><a href="#cb8-14" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-15"><a href="#cb8-15" aria-hidden="true" tabindex="-1"></a>::: {.only-in-format .html}</span>
<span id="cb8-16"><a href="#cb8-16" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-17"><a href="#cb8-17" aria-hidden="true" tabindex="-1"></a>Third paragraph (...)</span>
<span id="cb8-18"><a href="#cb8-18" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-19"><a href="#cb8-19" aria-hidden="true" tabindex="-1"></a>:::</span>
<span id="cb8-20"><a href="#cb8-20" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-21"><a href="#cb8-21" aria-hidden="true" tabindex="-1"></a>:::::</span></code></pre></div>
<h3 id="specifying-the-number-of-columns">Specifying the number of
columns</h3>
<p>By default two columns are provided. You can specify the desired
number of columns in various ways:</p>
<div class="sourceCode" id="cb9"><pre
class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>::: twocolumns</span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a>::: three-columns</span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true" tabindex="-1"></a>::: five_columns</span>
<span id="cb9-6"><a href="#cb9-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb9-7"><a href="#cb9-7" aria-hidden="true" tabindex="-1"></a>::: {.columns column-count=3}</span></code></pre></div>
<p>Note that in <code>html</code> browsers may override your specified
number of columns.</p>
<h3 id="ragged-columns-latex-output-only">Ragged columns (LaTeX output
only)</h3>
<p>Default LaTeX/PDF output justifies columns vertically. That is, if
columns are explicitly broken at certain points, LaTeX ensures that the
text in each column occupies its full height by stretching
inter-paragraph space. In HTML output columns are always “ragged”, that
is, inter-paragraph space isn’t stretched and shorter columns have blank
space at the end.</p>
<p>If you want ragged columns in LaTeX, you can set this globally in the
document’s metadata or on locally on a give <code>columns</code> Div. In
the document data, either of these keys will work:</p>
<pre><code>ragged-columns: true
raggedcolumns: true</code></pre>
<p>Locally, add the <code>ragged</code> (or <code>raggedcolumns</code>
or <code>ragged-columns</code>) class to a <code>columns</code> Div:</p>
<div class="sourceCode" id="cb11"><pre
class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>::::: {.columns .ragged}</span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a>...</span>
<span id="cb11-4"><a href="#cb11-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb11-5"><a href="#cb11-5" aria-hidden="true" tabindex="-1"></a>:::::</span></code></pre></div>
<p>Note that this doesn’t work on individual <code>column</code> Divs,
only on the <code>columns</code> Div that contains them.</p>
<p>There is a corresponding <code>justifiedcolumns</code> (alias
<code>justified-columns</code>) global setting and a
<code>justified</code> (alias <code>justifiedcolumns</code>,
<code>justified-columns</code>) class for specific <code>columns</code>
Div.</p>
<div class="columns justified" style="column-count: 3 ;">
<div>
<p>This column</p>
<p>is vertically short.</p>
<div style="break-after: column ;">
</div>
</div><div>
<p>This column</p>
<p>is vertically short.</p>
<div style="break-after: column ;">
</div>
</div><div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a ante
in mi ornare volutpat sed sit amet diam. Nullam interdum erat a augue
faucibus, nec tempus tortor sagittis. Aenean imperdiet imperdiet
dignissim. Nam aliquam blandit ex, sed molestie nibh feugiat ac. Morbi
feugiat convallis semper. Ut et consequat purus. Fusce convallis
vehicula enim in vulputate.</p>
</div>
</div>
<p>Now in ragged columns mode:</p>
<div class="columns" style="column-count: 3 ;">
<div>
<p>This column</p>
<p>is vertically short.</p>
<div style="break-after: column ;">
</div>
</div><div>
<p>This column</p>
<p>is vertically short.</p>
<div style="break-after: column ;">
</div>
</div><div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a ante
in mi ornare volutpat sed sit amet diam. Nullam interdum erat a augue
faucibus, nec tempus tortor sagittis. Aenean imperdiet imperdiet
dignissim. Nam aliquam blandit ex, sed molestie nibh feugiat ac. Morbi
feugiat convallis semper. Ut et consequat purus. Fusce convallis
vehicula enim in vulputate.</p>
</div>
</div>
<h3 id="customizing-the-gap-and-rule-between-columns">Customizing the
gap and rule between columns</h3>
<p>The gap and rule between columns can be customized too. The gap is
specified with a <code>columngap</code> (or <code>column-gap</code> or
<code>columnsep</code> or <code>column-sep</code>) attribute. The rule
is specified with a <code>column-rule</code> (or
<code>columnrule</code>) attribute using CSS syntax.</p>
<div class="sourceCode" id="cb12"><pre
class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a>::: {.columns columngap=3em column-rule="1px solid black"}</span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a>::: {.threecolumns columngap=4em column-rule="3pt solid blue"}</span></code></pre></div>
<p>Here is an illustration:</p>
<div class="columns"
style="column-count: 3 ;; column-gap: 4em ;; column-rule: 3pt solid blue ;">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a ante
in mi ornare volutpat sed sit amet diam. Nullam interdum erat a augue
faucibus, nec tempus tortor sagittis. Aenean imperdiet imperdiet
dignissim. Nam aliquam blandit ex, sed molestie nibh feugiat ac. Morbi
feugiat convallis semper. Ut et consequat purus. Fusce convallis
vehicula enim in vulputate. Curabitur a augue arcu. Mauris laoreet
lectus arcu, sed elementum turpis scelerisque id. Etiam porta turpis
quis ipsum dictum vulputate. In ut convallis urna, at imperdiet nunc.
Cras laoreet, massa lobortis gravida egestas, lacus est pellentesque
arcu, imperdiet efficitur nibh dolor vel sapien. Sed accumsan
condimentum diam non pellentesque.</p><p>Vestibulum cursus nisi risus,
sit amet consectetur massa suscipit nec. Sed condimentum, est id iaculis
ornare, purus risus finibus felis, posuere congue est nibh eget dui.
Maecenas orci erat, commodo auctor justo quis, vestibulum mollis ex.
Vivamus sed bibendum turpis. Donec auctor, leo a cursus efficitur, quam
urna dignissim enim, viverra condimentum orci est non sem. Donec ac
viverra nisl. Suspendisse ac auctor massa. Mauris porttitor purus vel
velit vehicula, sed efficitur odio lacinia. Fusce sed odio arcu. Ut
rhoncus lacus vel magna interdum tincidunt. Nunc imperdiet finibus
tincidunt.</p>
</div>
<h3 id="spanning-elements">Spanning elements</h3>
<p>Elements that span across all columns are introduced as
<code>column-span</code> (or <code>columnspan</code>) sections:</p>
<pre class="columns"><code>::: columns ::::::::
content in columns
::::: column-span
# This heading spans across all columns
:::::
content in columns
:::</code></pre>
<p>Here is an illustration:</p>
<div class="columns"
style="column-count: 2 ;; column-rule: 1px solid black ;">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a ante
in mi ornare volutpat sed sit amet diam. Nullam interdum erat a augue
faucibus, nec tempus tortor sagittis. Aenean imperdiet imperdiet
dignissim. Nam aliquam blandit ex, sed molestie nibh feugiat ac. Morbi
feugiat convallis semper. Ut et consequat purus. Fusce convallis
vehicula enim in vulputate. Curabitur a augue arcu. Mauris laoreet
lectus arcu, sed elementum turpis scelerisque id. Etiam porta turpis
quis ipsum dictum vulputate. In ut convallis urna, at imperdiet nunc.
Cras laoreet, massa lobortis gravida egestas, lacus est pellentesque
arcu, imperdiet efficitur nibh dolor vel sapien. Sed accumsan
condimentum diam non pellentesque.</p><section
id="vestibulum-cursus-nisi-risus-sit-amet-consectetur-massa-suscipit-nec"
class="unnumbered column-span" style="column-span: all ;">
<h2 class="unnumbered">Vestibulum cursus nisi risus, sit amet
consectetur massa suscipit nec</h2>
</section><p>Sed condimentum, est id iaculis ornare, purus risus finibus
felis, posuere congue est nibh eget dui. Maecenas orci erat, commodo
auctor justo quis, vestibulum mollis ex. Vivamus sed bibendum turpis.
Donec auctor, leo a cursus efficitur, quam urna dignissim enim, viverra
condimentum orci est non sem. Donec ac viverra nisl. Suspendisse ac
auctor massa. Mauris porttitor purus vel velit vehicula, sed efficitur
odio lacinia. Fusce sed odio arcu. Ut rhoncus lacus vel magna interdum
tincidunt. Nunc imperdiet finibus tincidunt.</p>
</div>
<h3 id="explicitly-specifying-column-breaks">Explicitly specifying
column breaks</h3>
<p>Column breaks can be explicitly specified. This can be done using
<code>\columnbreak</code> or a <code>columnbreak</code> (or
<code>column-break</code>) section.</p>
<div class="sourceCode" id="cb14"><pre
class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a>::: columns</span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a>This content is in a first column.</span>
<span id="cb14-4"><a href="#cb14-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb14-5"><a href="#cb14-5" aria-hidden="true" tabindex="-1"></a>\columnbreak</span>
<span id="cb14-6"><a href="#cb14-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb14-7"><a href="#cb14-7" aria-hidden="true" tabindex="-1"></a>This content is in a second column.</span>
<span id="cb14-8"><a href="#cb14-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb14-9"><a href="#cb14-9" aria-hidden="true" tabindex="-1"></a>:::: columnbreak</span>
<span id="cb14-10"><a href="#cb14-10" aria-hidden="true" tabindex="-1"></a>::::</span>
<span id="cb14-11"><a href="#cb14-11" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb14-12"><a href="#cb14-12" aria-hidden="true" tabindex="-1"></a>This content is in a third column.</span>
<span id="cb14-13"><a href="#cb14-13" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb14-14"><a href="#cb14-14" aria-hidden="true" tabindex="-1"></a>:::: column-break</span>
<span id="cb14-15"><a href="#cb14-15" aria-hidden="true" tabindex="-1"></a>::::</span>
<span id="cb14-16"><a href="#cb14-16" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb14-17"><a href="#cb14-17" aria-hidden="true" tabindex="-1"></a>This content is in a fourth column.</span>
<span id="cb14-18"><a href="#cb14-18" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb14-19"><a href="#cb14-19" aria-hidden="true" tabindex="-1"></a>:::</span></code></pre></div>
<p>The result is:</p>
<div class="columns" style="column-count: 4 ;">
<p>This content is in a first column.</p><div
style="break-after: column ;">
</div><p>This content is in a second column.</p><div
style="break-after: column ;">
</div><p>This content is in a third column.</p><div
style="break-after: column ;">
</div><p>This content is in a fourth column.</p>
</div>
<p><strong>Warning and limitations</strong></p>
<ul>
<li>In <code>html</code>, browsers may ignore explicit column
breaks.</li>
<li>A <code>\columnbreak</code> break must be preceded by an empty line
and occupy a line on its own.</li>
<li>A <code>::: columnbreak</code> break must be followed by a closing
line of <code>:::</code>.</li>
</ul>
<p>When columnbreaks are explicitly specified, they are used to
determine the number of columns. If the section both speficies a number
of columns and includes explicit columnbreaks, the greatest number is
used.</p>
<h3 id="container-syntax">Container syntax</h3>
<p>A multicolumn section with explicit breaks can also be written using
a container syntax, with <code>column</code> sections included in a
<code>columns</code> section, as follows.</p>
<div class="sourceCode" id="cb15"><pre
class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a>:::::: columns</span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a>::: column</span>
<span id="cb15-4"><a href="#cb15-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb15-5"><a href="#cb15-5" aria-hidden="true" tabindex="-1"></a>First column content here</span>
<span id="cb15-6"><a href="#cb15-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb15-7"><a href="#cb15-7" aria-hidden="true" tabindex="-1"></a>:::</span>
<span id="cb15-8"><a href="#cb15-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb15-9"><a href="#cb15-9" aria-hidden="true" tabindex="-1"></a>::: column</span>
<span id="cb15-10"><a href="#cb15-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb15-11"><a href="#cb15-11" aria-hidden="true" tabindex="-1"></a>Second column content</span>
<span id="cb15-12"><a href="#cb15-12" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb15-13"><a href="#cb15-13" aria-hidden="true" tabindex="-1"></a>:::</span>
<span id="cb15-14"><a href="#cb15-14" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb15-15"><a href="#cb15-15" aria-hidden="true" tabindex="-1"></a>:::::</span></code></pre></div>
<p>This follows <a
href="https://pandoc.org/MANUAL.html#columns">Pandoc’s markdown syntax
for <code>beamer</code> output</a>. Note that individual column widths
and further column attributes available in <code>beamer</code> outputs
are not supported here.</p>
<p>Container syntax and columnbreak syntax can be mixed, as in the
example below:</p>
<div class="columns" style="column-count: 3 ;">
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a ante
in mi ornare volutpat sed sit amet diam. Nullam interdum erat a augue
faucibus, nec tempus tortor sagittis. Aenean imperdiet imperdiet
dignissim. Nam aliquam blandit ex, sed molestie nibh feugiat ac. Morbi
feugiat convallis semper. Ut et consequat purus. Fusce convallis
vehicula enim in vulputate. Curabitur a augue arcu.</p>
<div style="break-after: column ;">
</div>
</div><p>Mauris laoreet lectus arcu, sed elementum turpis scelerisque
id. Etiam porta turpis quis ipsum dictum vulputate. In ut convallis
urna, at imperdiet nunc. Cras laoreet, massa lobortis gravida egestas,
lacus est pellentesque arcu, imperdiet efficitur nibh dolor vel sapien.
Sed accumsan condimentum diam non pellentesque.</p><div
style="break-after: column ;">
</div><p>Vestibulum cursus nisi risus, sit amet consectetur massa
suscipit nec. Sed condimentum, est id iaculis ornare, purus risus
finibus felis, posuere congue est nibh eget dui. Maecenas orci erat,
commodo auctor justo quis, vestibulum mollis ex.</p>
</div>
<h2 id="advanced-usage">Advanced usage</h2>
<h3 id="nesting">Nesting</h3>
<p>Multicolumn sections can be nested. Support for nesting may vary
across browsers. Here is an illustration:</p>
<div class="columns" style="column-count: 3 ;">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a ante
in mi ornare volutpat sed sit amet diam. Nullam interdum erat a augue
faucibus, nec tempus tortor sagittis. Aenean imperdiet imperdiet
dignissim. Nam aliquam blandit ex, sed molestie nibh feugiat ac. Morbi
feugiat convallis semper. Ut et consequat purus. Fusce convallis
vehicula enim in vulputate. Curabitur a augue arcu.</p><div
style="break-after: column ;">
</div><p>Mauris laoreet lectus arcu, sed elementum turpis scelerisque
id. Etiam porta turpis quis ipsum dictum vulputate. In ut convallis
urna, at imperdiet nunc.</p><div class="columns"
style="column-count: 2 ;">
<p>This is a two-column section nested within the middle column of a
three-column section.</p>
</div><p>Cras laoreet, massa lobortis gravida egestas, lacus est
pellentesque arcu, imperdiet efficitur nibh dolor vel sapien. Sed
accumsan condimentum diam non pellentesque.</p><div
style="break-after: column ;">
</div><p>Vestibulum cursus nisi risus, sit amet consectetur massa
suscipit nec. Sed condimentum, est id iaculis ornare, purus risus
finibus felis, posuere congue est nibh eget dui. Maecenas orci erat,
commodo auctor justo quis, vestibulum mollis ex.</p>
</div>
<h3 id="number-of-columns">Number of columns</h3>
<p>Number of columns can be specified in English up to ten. Accepted
patterns are <code><number>columns</code>,
<code><number>-columns</code> and
<code><number>_columns</code>. Note that this is a “class”, and
should be preceded by a dot when specified along other attributes within
curly brackets:</p>
<pre><code>::: twocolumns
::: {.three-columns columnsep=2em}
:::
</code></pre>
<p>Alternatively, the <code>column-count</code> can be used to specify
any number of columns.</p>
<pre><code>::: {.columns column-count=3}</code></pre>
<p>If both English names and <code>column-count</code> are used, the
former prevails.</p>
<h3 id="html-output">HTML output</h3>
<p>The <code>html</code> output looks like this. Without column
breaks:</p>
<div class="sourceCode" id="cb18"><pre
class="sourceCode html"><code class="sourceCode html"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="kw"><div</span> <span class="er">class</span><span class="ot">=</span><span class="st">"columns"</span> <span class="er">style</span><span class="ot">=</span><span class="st">"column-count: 2; column-rule: 1px solid black;"</span><span class="kw">></span></span>
<span id="cb18-2"><a href="#cb18-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb18-3"><a href="#cb18-3" aria-hidden="true" tabindex="-1"></a>Content that distributed in columns...</span>
<span id="cb18-4"><a href="#cb18-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb18-5"><a href="#cb18-5" aria-hidden="true" tabindex="-1"></a><span class="kw"><div</span> <span class="er">class</span><span class="ot">=</span><span class="st">"column-span"</span> <span class="er">style</span><span class="ot">=</span><span class="st">";"</span><span class="kw">></span></span>
<span id="cb18-6"><a href="#cb18-6" aria-hidden="true" tabindex="-1"></a>Content that spreads across all columns</span>
<span id="cb18-7"><a href="#cb18-7" aria-hidden="true" tabindex="-1"></a><span class="kw"></div></span></span>
<span id="cb18-8"><a href="#cb18-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb18-9"><a href="#cb18-9" aria-hidden="true" tabindex="-1"></a>More content distributed in columns...</span>
<span id="cb18-10"><a href="#cb18-10" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb18-11"><a href="#cb18-11" aria-hidden="true" tabindex="-1"></a><span class="kw"></div></span></span></code></pre></div>
<p>With columnbreaks:</p>
<div class="sourceCode" id="cb19"><pre
class="sourceCode html"><code class="sourceCode html"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="kw"><div</span> <span class="er">class</span><span class="ot">=</span><span class="st">"columns"</span> <span class="er">style</span><span class="ot">=</span><span class="st">"column-count: 2;"</span><span class="kw">></span></span>
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb19-3"><a href="#cb19-3" aria-hidden="true" tabindex="-1"></a>Content of the first column.</span>
<span id="cb19-4"><a href="#cb19-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb19-5"><a href="#cb19-5" aria-hidden="true" tabindex="-1"></a><span class="kw"><div</span> <span class="er">style</span><span class="ot">=</span><span class="st">"break-after: column;"</span><span class="kw">></div></span></span>
<span id="cb19-6"><a href="#cb19-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb19-7"><a href="#cb19-7" aria-hidden="true" tabindex="-1"></a>Content of the second column.</span>
<span id="cb19-8"><a href="#cb19-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb19-9"><a href="#cb19-9" aria-hidden="true" tabindex="-1"></a><span class="kw"></div></span></span></code></pre></div>
<p>In CSS <code>break-after: column</code> means “after this element,
place a column break”.</p>
<p>The classes <code>columns</code> and <code>column-span</code> are
needed to ensure that the first element of a multiple columns
<code>div</code>, or the first element after an element spanning across
columns, have no top margin. If they had we would get unwanted space at
the beginning of the first column. Thus the filter adds the following to
the header:</p>
<div class="sourceCode" id="cb20"><pre
class="sourceCode html"><code class="sourceCode html"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a> <span class="kw"><style></span></span>
<span id="cb20-2"><a href="#cb20-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">.columns</span> <span class="in">:first-child</span> {<span class="kw">margin-top</span>: <span class="dv">0</span><span class="op">;</span>}</span>
<span id="cb20-3"><a href="#cb20-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">.column-span</span> <span class="op">+</span> <span class="op">*</span> {<span class="kw">margin-top</span>: <span class="dv">0</span><span class="op">;</span>}</span>
<span id="cb20-4"><a href="#cb20-4" aria-hidden="true" tabindex="-1"></a> <span class="kw"></style></span></span></code></pre></div>
<h3 id="latex-output">LaTeX output</h3>
<p>The LaTeX output looks as follows. Preamble:</p>
<div class="sourceCode" id="cb21"><pre
class="sourceCode latex"><code class="sourceCode latex"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">multicol</span>}</span></code></pre></div>
<p>Document body:</p>
<pre><code>{\begin{multicols}{2}
content distributed over two columns
\end{multicols}
}</code></pre>
<p>With properties and explicit column breaks:</p>
<pre><code>{\setlength{\columnsep}{4em}
\setlength{\columnseprule}{ 3pt}
\renewcommand{\columnseprulecolor}{\color{blue}}
\begin{multicols}{3}
content distributed over three columns
\end{multicols}
}</code></pre>
<p>Note that the <code>multicols</code> environment is wrapped within
<code>{...}</code>. This is to ensure that settings of
<code>\columnsep</code>, <code>\columnseprule</code> and
<code>\columnseprulecolor</code> do not affect subsequent
<code>multicol</code> environments.</p>
<h2 id="contributing">Contributing</h2>
<p>Issues and pull requests are welcome. They can be submitted <a
href="https://github.com/jdutant/columns">to the repository</a>.</p>
<h2 id="related">Related</h2>
<ul>
<li><a
href="https://github.com/mhwombat/pandoc-columns">pandoc-columns</a>, a
Pandoc filter written in Haskell.</li>
</ul>
<h2 id="references">References</h2>
<ul>
<li><code>html</code>: <a
href="https://drafts.csswg.org/css-multicol">CSS Multi-column
layout</a></li>
<li>LaTeX: <a
href="https://www.ctan.org/pkg/multicol"><code>multicol</code> LaTeX
package</a></li>
<li>Pandoc: https://pandoc.org/lua-filters.html</li>
<li>Pandoc lua filters: https://pandoc.org/lua-filters.html</li>
</ul>
</body>
</html>