幻灯片ReporteRs R上的文本默认为垂直,对象太多

时间:2017-08-31 15:41:01

标签: r reporters

当我在幻灯片上放置九个以上的对象时,最新的对象默认为垂直(这种情况发生在文本中,不确定图或图像)。我的公司确实习惯于在幻灯片上放置太多信息,但是如果可能的话,他们希望保持相同的格式。我不确定ReporteRs包是否有选项来设置最大对象数,或者这可能是运行包的依赖项之一的问题。我将附上截图和代码。我创建了一个名为Presentation1.pptx的空白文档,并将其放在我的工作目录中。

enter image description here

代码:

library("ReporteRs")

pres <- pptx(template = "Presentation1.pptx")
pres <- addSlide(pres, slide.layout = 'Blank')

pres <- addParagraph(par.properties = parProperties(),
                 doc = pres, text.align = "left", value = pot("SOME TEXT", 
                 textBold(color = "black", font.size = 36, font.family = "Arial")),
                 offx = 0.5, offy = 0, width = 0, height = 1)

pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 1),
                doc = pres, text.align = "left", value = pot("Some Text",
                textBoldItalic(color = "black", font.size = 21, font.family = "Arial")),
                offx = 0.25, offy = 1, width = 0, height = 1)

pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
                doc = pres, text.align = "left", value = pot("Some Text",
                textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
                offx = 0.75, offy = 1.5, width = 0, height = 1)

pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
                doc = pres, text.align = "left", value = pot("Some Text",
                textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
                offx = 0.75, offy = 2, width = 0, height = 1)

pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 1),
                doc = pres, text.align = "left", value = pot("Some Text",
                textBoldItalic(color = "black", font.size = 21, font.family = "Arial")),
                offx = 0.25, offy = 2.5, width = 0, height = 1)

pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
                doc = pres, text.align = "left", value = pot("Some Text",
                textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
                offx = 0.75, offy = 3, width = 0, height = 1)

pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
                doc = pres, text.align = "left", value = pot("Some Text",
                textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
                offx = 0.75, offy = 3.5, width = 0, height = 1)

pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
                doc = pres, text.align = "left", value = pot("Some Text",
                textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
                offx = 0.75, offy = 4, width = 0, height = 1)

pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
                doc = pres, text.align = "left", value = pot("Some Text",
                textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
                offx = 0.75, offy = 4.5, width = 0, height = 1)

pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
                doc = pres, text.align = "left", value = pot("Some Text",
                textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
                offx = 0.75, offy = 5, width = 0, height = 1)

pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
                doc = pres, text.align = "left", value = pot("Copyright Text",
                textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
                offx = 3, offy = 7, width = 0, height = 1)

writeDoc(pres, file = "pres.pptx")

1 个答案:

答案 0 :(得分:3)

首先,如果可能,请转到@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { // Respond to the action bar's Up/Home button case android.R.id.home: NavUtils.navigateUpFromSameTask(this); return true; } return super.onOptionsItemSelected(item); } 打包并阅读该页面:https://davidgohel.github.io/officer/articles/powerpoint.html#append-text-sequentially-in-a-shape

在脚本中,您使用的宽度设置为0,并为每个新段落使用新形状。 # Required by IndoorAtlas SDK -keep public class com.indooratlas.algorithm.ClientProcessingManager { *; } -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 不是addParagraph的参数。所以让我们'简化:

officer