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

Duplicated rows with \vphantom issue again #433

Closed
philturk opened this issue Oct 16, 2019 · 2 comments
Closed

Duplicated rows with \vphantom issue again #433

philturk opened this issue Oct 16, 2019 · 2 comments

Comments

@philturk
Copy link

Hi Hao, this question touches upon the same topic raised in Issues #161 and #145. Is there any way to stop kableExtra from using \vphantom space in the raw LaTeX code to "identify" a duplicated row in a table? I am not sure you need yet another reproducible example, but here you go:

```{r}
library(kableExtra)

toydata <- tibble(Var1 = c(1,2,2,3), Var2 = c("My stuff", "Hello world", "Hello world", "My stuff"))

kable(toydata, "latex", booktabs = T, align = "cr") %>%
  row_spec(0, bold = T, angle = 0) %>%  
  add_header_above(c("Toy Data" = 2)) %>%
  kable_styling(latex_options = c("striped"))
```

Upon execution, this produces LaTeX code containing extra whitespace (i.e., \vphantom{1}) between 'Hello' and 'world' in the second row, but none in the duplicate row immediately following. Of course, while I am grateful for your package, the pdf output does not suit my own personal taste :)

Best,

-- Phil

@haozhu233
Copy link
Owner

Hi, Phil, thanks for reporting this! \vphantom suppose to have zero space width. After reviewing my code, I realized that I accepted an PR from someone else a while ago which inserted an extra space after \vphantom. Now this behavior has been addressed. 👍

@philturk
Copy link
Author

Thank you. I'm looking forward to trying it.

Best,

-- Phil

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