Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conflict between full_width = TRUE and width? #669

Open
ericpgreen opened this issue Nov 3, 2021 · 2 comments
Open

conflict between full_width = TRUE and width? #669

ericpgreen opened this issue Nov 3, 2021 · 2 comments

Comments

@ericpgreen
Copy link

I'm using bookdown to create a Tufte-style PDF with margin notes. I use full_width = TRUE to constrain the table to the main column and prevent it from bleeding into the margin notes area. I get an error when I also try to set width in column_spec.

! Misplaced \noalign.
\toprule ->\noalign 
                    {\ifnum 0=`}\fi \@aboverulesep =\abovetopsep \global \@b...
l.577 \end{tabu}
# packages
  library(knitr)
  library(tidyverse)
  library(kableExtra)

# data
  test <- tribble(
    ~A, ~B,
    "Lorem ipsum", "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
    "Lorem ipsum", "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
  )

# table
  kable(test, format = "latex", booktabs = T, caption="Test") %>%
    row_spec(0, bold=TRUE) %>%
    column_spec(1, bold=TRUE, width="2cm") %>%   # works without width="2cm"
    kable_styling(full_width = TRUE, position = "left")
@christophsax
Copy link

I have the same issue. This is an issue with the tabu package and probably a duplicate of #625.

@ericpgreen
Copy link
Author

Thanks, @christophsax. I'm using tabu by default, so I'll need to look into how it's used and possible alternatives. If you find a solution I'd love to know more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants