Using Pandoc to generate tables that are sourced from an R Markdown document.


Pandoc does not have a way to override the code generated for a Markdown table. As such, there does not seem to be a way to instruct Pandoc to include here or split. That is, Pandoc cannot generate the following code:

\startplacetable[location={here, split}]

Minimum Working Example

The following code shows the problem:

\startplacetable[title={Average Annual Temperatures}]
\startxcell[align=middle,width={0.10\textwidth}] Year \stopxcell
\startxcell[align=middle,width={0.14\textwidth}] Value \stopxcell
\startxcell[align=middle,width={0.10\textwidth}] 1880 \stopxcell
\startxcell[align=middle,width={0.14\textwidth}] 0.1146 \stopxcell
\startxcell[align=middle,width={0.10\textwidth}] 2018 \stopxcell
\startxcell[align=middle,width={0.14\textwidth}] 1.014 \stopxcell

This produces:

No Table Split

Changing the startplacetable command options produces the desired result, but requires modifying the output generated from pandoc:

\startplacetable[title={Average Annual Temperatures}, location={here,split}]

Splitting across pages is enabled:

Split Table


My first instinct was to change the setups for table:


This didn't work because the location parameter for the \setupfloat macro is different than the location option for the \startplacetable macro.

In the past, I've used sed in shell scripts to replace \startplacetable with \startplacetable[location={split}], but that's a brittle solution.

Using \setupxtable's split=yes option doesn't work, either, probably because the extreme table is embedded within a captioned float:


Another idea is to redefine \startplacetable. Something like:



That doesn't compile, though.


Without changing the code generated by pandoc, how would you allow all extreme tables inside a \startplacetable environment to split across pages?


The default location for floats is not called location but default.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.