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

Suggestion: Add an option to "pos" to insert a blank line before (or after?) adding the gt table, so Word doesn't see it as an extension of the prior gt table #6

Open
BorgeJorge opened this issue May 30, 2023 · 1 comment

Comments

@BorgeJorge
Copy link

I'd love to use gto to export multiple data.frame and table snippets but I'd like to be able to manipulate them separately, type in notes between them afterwards, etc. I realize I can use officer functions to do this, but it'd be handy to have a "pos" option that'll insert, say, a line (using body_add_par?) with a single space before (or after?) adding the table.

Anyway, thanks, I'm loving the package!

@thebioengineer
Copy link
Collaborator

Thanks for the feedback! Since body_add_gt is intended to be an analog to body_add_flextable, I an hesitant to add this feature in directly.

If this is a regular thing you do, you could write a wrapper to achieve your goal. This might get you somewhat on your way:

body_add_gt_and_notes <- function(doc, gt, notes){
  # add notes, then add table, putting notes below the table
  doc <- doc |> 
   officer::body_add_par("") %>%
   officer::body_add_par(notes, pos = "after") |>
   gto::body_add_gt(gt, pos = "after")
}

I can also leave this issue open to see if additional folks would like this added in too.

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