From 3d0238c07fd4132a4e5d41ec1de19beb2c61eb4e Mon Sep 17 00:00:00 2001
From: Julien Dutant <34026710+jdutant@users.noreply.github.com>
Date: Fri, 25 Nov 2022 15:40:22 +0000
Subject: [PATCH] Update docs, version for release
---
Makefile | 4 +-
README.md | 2 +-
expected.html | 178 +++++++++++++++++++++++++++-----------------------
expected.tex | 2 +-
4 files changed, 99 insertions(+), 87 deletions(-)
diff --git a/Makefile b/Makefile
index c86227c..d19e382 100644
--- a/Makefile
+++ b/Makefile
@@ -4,11 +4,11 @@ DIFF ?= diff --strip-trailing-cr -u
test: test_html test_latex
-test_html: README.md columns.lua expected.html
+test_html: README.md columns.lua
@pandoc --lua-filter columns.lua --standalone --to=html $< \
| $(DIFF) expected.html -
-test_latex: README.md columns.lua expected.tex
+test_latex: README.md columns.lua
@pandoc --lua-filter columns.lua --standalone --to=latex $< \
| $(DIFF) expected.tex -
diff --git a/README.md b/README.md
index e717c70..9443199 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ Columns
Multiple columns support in Pandoc's markdown.
-v1.0. Copyright: © 2021 Julien Dutant Multiple columns support in Pandoc’s markdown. v1.0. Copyright: © 2021 Julien Dutant v1.1.2. Copyright: © 2021 Julien Dutant julien.dutant@kcl.ac.uk License: MIT - see LICENSE
file for details.Columns - Multiple columns support in Pandoc’s
Columns
Specifying the number of
number of columns.
Default LaTeX/PDF output justifies columns vertically. That is, LaTeX
-tries to make sure that each column but the last occupies the whole
-column height by stretching the space between paragraphs. If you want to
-avoid vertical stretching and leave space at the end of each columns
-instead, add the ragged
class to your columns
-div. (raggedcolumns
and ragged-columns
work
-too).
- ::::: {.columns .ragged}
-
- ...
- :::::
Here’s a illustration of the default behaviour:
-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.
+If you want ragged columns in LaTeX, you can set this globally in the
+document’s metadata or on locally on a give columns
Div. In
+the document data, either of these keys will work:
ragged-columns: true
+raggedcolumns: true
+Locally, add the ragged
(or raggedcolumns
+or ragged-columns
) class to a columns
Div:
+ ::::: {.columns .ragged}
+
+ ...
+ :::::
Note that this doesn’t work on individual column
Divs,
+only on the columns
Div that contains them.
There is a corresponding justifiedcolumns
(alias
+justified-columns
) global setting and a
+justified
(alias justifiedcolumns
,
+justified-columns
) class for specific columns
+Div.
This column
is vertically short.
@@ -395,7 +407,7 @@Now in ragged columns mode:
-This column
is vertically short.
@@ -424,10 +436,10 @@columnsep
or column-sep
) attribute. The rule
is specified with a column-rule
(or
columnrule
) attribute using CSS syntax.
-
- ::: {.columns columngap=3em column-rule="1px solid black"}
- ::: {.threecolumns columngap=4em column-rule="3pt solid blue"}
+ ::: {.columns columngap=3em column-rule="1px solid black"}
+ ::: {.threecolumns columngap=4em column-rule="3pt solid blue"}
Here is an illustration:
Column breaks can be explicitly specified. This can be done using
\columnbreak
or a columnbreak
(or
column-break
) section.
- ::: columns
-
- This content is in a first column.
-
- \columnbreak
-
- This content is in a second column.
-
- :::: columnbreak
- ::::
-
- This content is in a third column.
-
- :::: column-break
- ::::
-
- This content is in a fourth column.
- :::
+ ::: columns
+
+ This content is in a first column.
+
+ \columnbreak
+
+ This content is in a second column.
+
+ :::: columnbreak
+ ::::
+
+ This content is in a third column.
+
+ :::: column-break
+ ::::
+
+ This content is in a fourth column.
+ :::
The result is:
This content is in a first column.
A multicolumn section with explicit breaks can also be written using
a container syntax, with column
sections included in a
columns
section, as follows.
- :::::: columns
-
- ::: column
-
- First column content here
-
- :::
-
- ::: column
-
- Second column content
-
- :::
- :::::
+ :::::: columns
+
+ ::: column
+
+ First column content here
+
+ :::
+
+ ::: column
+
+ Second column content
+
+ :::
+ :::::
This follows Pandoc’s markdown syntax
for beamer
output. Note that individual column widths
@@ -646,29 +658,29 @@
The html
output looks like this. Without column
breaks:
<div class="columns" style="column-count: 2; column-rule: 1px solid black;">
-
-
- Content that distributed in columns...
-<div class="column-span" style=";">
-
- Content that spreads across all columns</div>
-
-
- More content distributed in columns...
-</div>
With columnbreaks:
<div class="columns" style="column-count: 2;">
+class="sourceCode html"><div class="columns" style="column-count: 2; column-rule: 1px solid black;">
-
+ Content of the first column.
Content that distributed in columns...
-<div style="break-after: column;"></div>
-
-
+ Content of the second column.<div class="column-span" style=";">
+
+ Content that spreads across all columns</div>
-</div>
With columnbreaks:
+<div class="columns" style="column-count: 2;">
+
+
+ Content of the first column.
+<div style="break-after: column;"></div>
+
+
+ Content of the second column.
+</div>
In CSS break-after: column
means “after this element,
place a column break”.
The classes columns
and column-span
are
@@ -677,15 +689,15 @@
<style>
- .columns :first-child {margin-top: 0;}
- .column-span + * {margin-top: 0;}
- </style>
<style>
+ .columns :first-child {margin-top: 0;}
+ .column-span + * {margin-top: 0;}
+ </style>
The LaTeX output looks as follows. Preamble:
-\usepackage{multicol}
\usepackage{multicol}
Document body:
{\begin{multicols}{2}
diff --git a/expected.tex b/expected.tex
index b085399..f49f623 100644
--- a/expected.tex
+++ b/expected.tex
@@ -100,7 +100,7 @@ \section{Columns}\label{columns}}
Multiple columns support in Pandoc's markdown.
-v1.0. Copyright: © 2021 Julien Dutant
+v1.1.2. Copyright: © 2021 Julien Dutant
\href{mailto:julien.dutant@kcl.ac.uk}{\nolinkurl{julien.dutant@kcl.ac.uk}}
License: MIT - see LICENSE file for details.