vincentarelbundock / tinytable

Simple and Customizable Tables in `R`
https://vincentarelbundock.github.io/tinytable
GNU General Public License v3.0
211 stars 18 forks source link

Weird position of table in Quarto/PDF #309

Closed lorenzoFabbri closed 4 months ago

lorenzoFabbri commented 4 months ago

I am writing my CV in Quarto (here). Today I decided to switch from flextable to tinytable, but in the PDF the positioning of the table is weird, in the sense that there is a lot of space around it. The qmd can be found here (with the table on this line) while the partial for LaTeX here. I am using R version 4.4.0 (2024-04-24), Quarto version 1.5.54, and tinytable version 0.3.0.

# Skills

```{r}
skills <- tibble::tribble(
  ~what, ~details,
  "Languages", "Italian (native), English (C1, IELTS 7.0), Spanish (basic)",
  "Programming Languages", "R, Python, MATLAB, C",
  "Markup Languages", "LaTeX, RMarkdown",
  "Software Development", "git, SLURM, High Performance Scientific Computing"
) |>
  as.data.frame()
colnames(skills) <- NULL

tinytable::tt(skills) |>
  tinytable::theme_tt(
    theme = "void"
  ) |>
  tinytable::style_tt(
    j = 1,
    bold = TRUE
  )

<img width="668" alt="image" src="https://github.com/user-attachments/assets/c13f3126-4cab-4ced-8da0-377af98fadd1">

---
**EDIT**:

It seems that by adding

\usepackage{float} \floatplacement{table}{H}



in `header.tex`, solves the problem.
vincentarelbundock commented 4 months ago

Please look at the theme_tt() function with the "placement" option.

lorenzoFabbri commented 4 months ago

Thank, I missed that argument. The problem is that if I add the line placement = "H", the table disappears from the PDF.

vincentarelbundock commented 4 months ago

Please supply a fully reproducible example.