简体   繁体   中英

Second line of text in pptx subtitle

I have added a Title Slide to a pptx object, and want to add a second line in the subtitle location.

I've tried using ph_add_fpar function with no success. I'm still new with the package so probably not using the correct functions!

    mypowerpoint <- read_pptx() %>%
      add_slide("Title Slide","Office Theme") %>%
    ph_with("Flashy Title",ph_location_type("ctrTitle",position_right = TRUE)) %>%
    ph_with("Catchy Subtitle 1",ph_location_type("subTitle")) %>%
    ph_with("Catchy Subtitle 2",ph_location_type("subTitle")) 

Running the above gives me two subtitles overlaid on top of each other, rather than the second subtitle text as a new line in the same objects as the first. Can anyone please tell me what I'm missing, or a better function to use for this?

ph_with support vector with length > 1

library(magrittr)
library(officer)
mypowerpoint <- read_pptx() %>%
  add_slide("Title Slide","Office Theme") %>%
  ph_with("Flashy Title",ph_location_type("ctrTitle",position_right = TRUE)) %>%
  ph_with(c("Catchy Subtitle 1", "Catchy Subtitle 2"),ph_location_type("subTitle")) 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM