-
Notifications
You must be signed in to change notification settings - Fork 120
Open
Description
Should we deprecate the args position_right and position_top in ph_location_type() or change the defaults for more conistency?
Reasoning
Currently, the behaviour of ph_location_type("body") and phs_with(body = ..) is somewhat inconsistent.
ph_location_type()'s default isposition_right = TRUE. Hence, it will use the body ph on the right.phs_with(), however, usestype_idx = 1, if not explicitly specified.
The code below uses ph type body with the defaults in both cases.
library(officer)
library(doconv)
read_pptx() |>
add_slide("Two Content") |>
ph_with("<ph_location_type>", ph_location_type("body")) |>
phs_with(body = "<phs_with>") |>
print(tempfile(fileext = ".pptx")) |>
to_miniature(fileout = "tmp.png")Created on 2025-09-03 with reprex v2.1.1
Should we make this more consistent? There are several options:
- Do you see a necessity to keep the two args
position_rightandposition_topin the long run? I think withtype_idx, there is an easy to understand mechanism to choose a ph if there are several of the same type. Also,position_rightandposition_topfall short for more than 4 body phs. - If you find them useful, we might consider changing the defaults, i.e.
position_rightandposition_topareNULLand optional, while the default istype_idx = 1.
Let me know what you think :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
