我正在尝试使用officer. 的文档(v0.3.5,2019年6月23日)指出,body_end_section并且body_default_section被弃用,建议使用body_end_section_continuous,body_end_section_landscape,body_end_section_portrait,
body_end_section_columns,或body_end_section_columns_landscape代替。但是,这些函数都不接受margins参数。
当我尝试强制body_end_section_columns_landscape接受margins带有以下代码的参数时,出现以下错误:
my_doc %<>%
body_end_section_columns_landscape(
widths = c(4.75, 4.75),
space = 0.5,
sep = FALSE,
w = 8.5,
h = 11,
margins = c(top = 0.5, bottom = 0.5, left = 0.5, right = 0.5)
)
Error in body_end_section_columns_landscape(., widths = c(4.75, 4.75), :
unused argument (margins = c(top = 0.5, bottom = 0.5, left = 0.5, right = 0.5))
Run Code Online (Sandbox Code Playgroud)
文档body_end_section_columns_landscape说明w和h是“以英寸为单位的部分页面的宽度和高度。如果(reference_docx 文件的)默认部分已经具有宽度和高度,则这将被忽略。” 但我找不到任何文档reference_docx。
当我使用已弃用的函数时,body_end_section我收到警告并且输出有些混乱:
my_doc %<>%
body_end_section(
landscape = TRUE,
margins = c(top = 0.5, bottom = 0.5, left = 0.5, right = 0.5),
colwidths = c(0.5, 0.5),
space = 0.05
)
Warning message:
body_end_section is deprecated. See ?sections for replacement functions.
Run Code Online (Sandbox Code Playgroud)
当我说输出被破坏时,我的意思是:
我看不出有什么方法可以理解列和边距的宽度,甚至计算 A4 纸而不是信纸。
我也
我的问题是 3 倍:
body_end_section,谁能解释获得我想要的宽度所需的数学?谢谢!