r - R官员包:当有多个几乎相同的占位符时如何指定某个占位符
问题描述
我在 Powerpoint 幻灯片上使用 R 官员包,我需要将文本插入到 5 个相同的占位符中,所有这些占位符在幻灯片底部彼此相邻。在不推荐使用 ph_with_text 函数之前,可以使用 body 和 index 参数来准确指定要插入文本的占位符。但是,我找不到使用较新的 ph_with 函数正确执行此操作的方法。
对于上下文,textholders 的 layout_properties 如下:
type id ph_label offx offy cx cy
body 25 Text Placeholder 24 2.4526826 5.9722200 1.340278 0.7065978
body 26 Text Placeholder 24 4.2022332 5.9722200 1.340278 0.7065978
body 27 Text Placeholder 24 5.9965278 5.9722211 1.340278 0.7065978
body 28 Text Placeholder 24 7.7013342 5.9722200 1.340278 0.7065978
body 29 Text Placeholder 24 9.4496063 5.9722200 1.340278 0.7065978
如果我使用 ph_location_label,我只能指定第一个,如下所示:
ph_with(location = ph_location_label(ph_label = "Text Placeholder 24"), value = "Blah blah"
我可以使用 position_right 位置参数来指定最后一个:
ph_with(location = ph_location_type(type = "body", position_top = F, position_right = T), value = "Blah blah")
但是我对中间的 3 感到很困惑——我该如何指定这些占位符?有什么办法可以更改它们的 ph_label,使它们不都是“文本占位符 24”吗?
解决方案
解决方案是在 PowerPoint 的主模板视图中按下Alt + F10
。Home > Arrange > Selection Pane
按照 Bernardo 的建议,您也可以通过 访问此菜单。这将打开模板中所有元素的标签,双击允许您重命名它们。然后你可以在officer中使用你的自定义标签
ph_with(location = ph_location_label(ph_label = "Custom Label"), value = "Blah blah")
推荐阅读
- python - 如何在句子(名称)中找到最近的邻居?
- html - div的响应式背景图像的CSS问题
- javascript - Having trouble with using AJAX to pass data from PHP to JavaScript
- flutter - 当内部滚动视图在颤动中到达末尾时如何滚动外部滚动视图?
- c++ - std::function 与 std::bind 完美配合 - 但为什么呢?
- mysql - 从 laravel 备份 .sql
- unity3d - Unity Hub 错误打开 Unity 版本 2019
- python - 如何在 tkinter 中设置用户选择的背景颜色?
- python - selenium.common.exceptions.NoSuchElementException:没有这样的元素:无法找到元素我试过这个 driver.implicitly_wait(20) 但不工作
- c# - 如果 TextBox_TextChanged 中不相等则不起作用