Unaligned italic numbers in table
fabian-buerkin opened this issue · comments
I took your excellent template as a starting point for my thesis, in which I am now stuck with a formatting problem regarding numbers in tables: As soon as I select italic via the "row_spec" option, some numbers (like the 4 in my example) are no longer at the correct height:
I tried to use the suggested solutions from this link and manipulated several tex-files, but I am still facing the same problems.
I am only moderately versed with latex, if I have overlooked something essential I apologize!
I use the following code to generate the table:
library(knitr)
library(tidyverse)
library(kableExtra)
tbl <- data.frame(good= c("1.3%"),
bad=c("45.84%"))
kbl(tbl,
caption= "Caption",
"latex",
booktabs = TRUE) %>%
row_spec(1, italic=T)
Are you sure it is 'misaligned'? It looks to me like it's just a feature of the font -- i.e., that with this particular font, the bottom of the number 4 by design extends below the line?
You could try to also use kableExtra to change the font, if you don't like this typographical choice?