Skip to content

longtable + booktabs breaks on row starting with ( or [ #145

@vincentarelbundock

Description

@vincentarelbundock

Apparently, when using both booktabs and longtable, if a row starts with the characters ( or [, latex compilation doesn't work. This happened to me when attempting to compile a notebook where a table had "(Intercept)" as a cell in the left-column.

This weird behavior is not caused by gt per se. One solution is documented here: https://tex.stackexchange.com/questions/228755/undefined-control-sequence-on-left-parenthesis-after-midrule-in-longtable/228756#228756

That is to use \midrule\relax instead of just \midrule.

I could probably hack around this ingtsummary, but this problem may arise for other gt users as well.

What do you think?



---
title: "R Notebook"
output: pdf_document
---

```{r}
library(gt)
data.frame('a' = c('OK', 'OK'), 'b' = 1:2) %>% gt()

data.frame('a' = c('(BAD)', 'OK'), 'b' = 1:2) %>% gt()

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions