-
Notifications
You must be signed in to change notification settings - Fork 0
pandoc tabularize
This is the documentation for pandoc-tabularize.pl.
pandoc-tabularize.pl - pandoc filter to use tabular instead of longtable in LaTeX
0.001
Date: 2015-07-06
pandoc -t latex -F pandoc-tabularize.pl [-M tabularize_all=true] [OPTIONS] FILE_NAME ...
pandoc-tabularize.pl
is a pandoc filter to use the tabular
environment instead of the longtable
package in LaTeX output. This is especially useful if you want to use twocolumn
mode, which doesn't work with longtable
.
There are two ways to get a tabular
environment -- possibly wrapped in a table
environment -- instead of a longtable
:
-
Put a key-value pair
tabularize_all: true
in your metadata block, (or pass-M tabularize_all=true
on the commandline).This will turn all tables into
tabularize
environments, and if they have a caption also wrap them in atable
environment. -
Wrap the table in a
<div>
with a classtabularize
.If you also add a class
float
thetabularize
environment will be wrapped in atable*
environment and hence become a float.If you add a class like
pos:t
orpos:p
there will also be atable*
environment, with whatever came afterpos:
in the class name as the optional argument to that environment.Any
id
on the<div>
will also be added as a\label{tab:ID}
. This is probably actually unnecessary since pandoc will add a generally much more useful\hyperdef{}{ID}{\label{ID}}
above the<div>
, but it's there in case you find some use for it
Note that the content of the div should be a normal Pandoc Markdown table (of any type!) with whatever Markdown markup normally works in a table.
In your Markdown document:
---
title: Test of twocolumn table hack filter
classoption: twocolumn
tabularize_all: true
...
<div id=firsttable class=tabularize>
Quia Iusto Et Quisquam Est Expedita
------------------ ------------------ -------------------
Facilis Aut Et Aut *Veritatis* Eveniet
Blanditiis Sit Eligendi Provident Sunt Ducimus
: This should be a non-floating tabularize
</div>
Minus Amet Pariatur Soluta Voluptate Consectetur
------------------ ------------------ ----------------------
Eos Possimus A Quasi Vel Autem
Est Magni Assumenda Volupta Id Laboriosam
: This also, with `tabularize_all: true`
<div class="tabularize float">
-------------------------------------------------------
Quia Ut Sint Ratione Voluptas Magnam
------------------ ------------------ ---------------
Blanditiis Enim Animi Ut Eaque Eum
Quidem Aut Et Vitae Nesciunt Voluptatem
Voluptatem Illo Iste Cupiditate Explicabo Vel
Est [Dolorem][] Consequuntur Eaque In Impedit
-------------------------------------------------------
: This should be a floating table*
</div>
<div class="tabularize pos:b">
Expedita Ut Fugit Numquam Quas Quia
-------------- ------------------ ---------
Nisi Aperiam Quasi Unde In Quis
Repellat Tenet Est Sit Facere Dolore
: this floats to the bottom of the page
</div>
Get perl: https://www.perl.org/get.html
How to install modules: http://www.cpan.org/modules/INSTALL.html
Benct Philip Jonsson <[email protected]>, https://github.com/bpj
Copyright 2015- Benct Philip Jonsson
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.