A Weird Imagination

LaTeX table environment in Madoko

Posted in

What is Madoko?#

Madoko is an extension of Markdown for scholarly papers. In essence, it is a competitor to LaTeX, which, along with Microsoft Word, is the way the vast majority of such papers are presently authored.

Madoko targets both HTML and LaTeX output in order to be compatible with existing workflows while encouraging the creation of HTML versions of papers which are presently rare as PDF is the default for publishing even though it is sub-optimal for reading on a screen.

A major downside of using a new technology is the small community and lack of support. Although LaTeX may be arcane at times, web searches for how to do something in LaTeX often finds an answer, and if not, the TeX StackExchange is a great place to get your questions answered. With Madoko, all you have is the manual and the source code.

Tables and figures in Madoko#

One advantage of Markdown over LaTeX is that tables are much simpler in Markdown. Markdown tables just look like ASCII art of the table you want to generate with a few special rules to control the layout:

| num  |  name  |
|:-----|:------:|
| 1    |   foo  |
| 2    |   bar  |

To put a table in a floating figure in LaTeX, you use the table environment, which is basically a figure labelled with Table 1 instead of Figure 1. Actual tables in LaTeX are created with the tabular environment. Madoko fixes this confusion by naming its environment for tables, Table.

The manual gives the following example Figure which translates to something like LaTeX's figure environment:

~ Figure { #fig-monarch caption="A Monarch butterfly." }
The ![monarch] image.
~

But the manual doesn't say how to create a table environment and the obvious thing to try

~ Table
...
~

doesn't work because Table means tabular, not table.

Madoko happens to have support for the table environment built-in, named TableFigure, it just isn't documented:

~ TableFigure { #tab-example caption="An example table." }
| num  |  name  |
|:-----|:------:|
| 1    |   foo  |
| 2    |   bar  |
~

Comments

Have something to add? Post a comment by sending an email to comments@aweirdimagination.net. You may use Markdown for formatting.

There are no comments yet.