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

Left align tables #6

Open
WillemSleegers opened this issue May 11, 2022 · 6 comments
Open

Left align tables #6

WillemSleegers opened this issue May 11, 2022 · 6 comments

Comments

@WillemSleegers
Copy link

Is it possible to left align the tables when exporting the codebook to a PDF?

@annennenne
Copy link
Collaborator

What exactly do you mean, is it the adjustment of the "Result" column in the summary tables under each variable?

Or is it the placement of the tables on the page?

@WillemSleegers
Copy link
Author

My apologies! I meant the placement of the tables on the page.

@annennenne
Copy link
Collaborator

That's a good question. It should definitely be possible, but I don't immediately see a way to do it. If you're familiar with Rmarkdown and Latex, I can give you a few pointers on where in the rmarkdown code this should probably be done?

@WillemSleegers
Copy link
Author

I've checked out the R code and it looks like the pander options are being set in the code itself (without a way to modify it), so I'm not even sure if editing the R Markdown code helps.

@annennenne
Copy link
Collaborator

I don't think the pander options we are setting are causing this. They only control text alignment within the table. They do not control where the table is placed on the page.

If you do

makeCodebook(toydata, render = FALSE, output = "pdf")

you will get the .Rmarkdown file. Here, you can see that we use the minipage setup from Latex in order to place the tables and figures in two columns. I would have thought that adding a \flushleft command to the minipage part with the table would have solved the issue, but apparently it doesn't.

Maybe this is something that can be controlled through rendering options, in which case it could make sense to look into e.g.
rmarkdwon::render().

@WillemSleegers
Copy link
Author

Okay, I can take a look. Thanks!

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