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

Unaligned italic numbers in table #64

Open
fabian-buerkin opened this issue Sep 26, 2022 · 1 comment
Open

Unaligned italic numbers in table #64

fabian-buerkin opened this issue Sep 26, 2022 · 1 comment

Comments

@fabian-buerkin
Copy link

fabian-buerkin commented Sep 26, 2022

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:

grafik

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)
@ulyngs
Copy link
Owner

ulyngs commented Oct 13, 2022

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?

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