簡體   English   中英

如何更改flextable頁腳中第一個單詞的字體?

[英]How to change the font of the first word in the footer of a flextable?

我正在嘗試使用flextable構建一個 APA 樣式的表,它將導出為 .docx 格式。 我需要頁腳的第一個字為斜體,但不是以下(腳注等)。 我一直沒能做到。

下面是一個小例子:

require(flextable)

tab <- data.frame("Variable" = c("Reference Norm", "Suject", "Cutoff"), 
                  "Indicators"= c("Content 1", "Content 2", "Content 3"), 
                  "Reference Norm" = c("", "Content 4", "Content 5"), 
                  "Subject" = c("", "", "Content 6"))

tab <- flextable(tab)
tab <- add_footer_lines(tab, values = "Note.") # This is where I need italic font
tab <- footnote(tab, i= 2, j= 2:3 , part = "body", ref_symbols="a", value = as_paragraph("Method x"), inline=T)
require(flextable)

tab <- data.frame(
  "Variable" = c("Reference Norm", "Suject", "Cutoff"),
  "Indicators" = c("Content 1", "Content 2", "Content 3"),
  "Reference Norm" = c("", "Content 4", "Content 5"),
  "Subject" = c("", "", "Content 6")
)

tab <- flextable(tab)

# start with an empty line
tab <- add_footer_lines(tab, values = "")
# add "Note: "
tab <- compose(tab, i = 1, j = 1, value = as_paragraph(as_i("Note: ")), part = "footer")

# add some footnotes
tab <- footnote(tab, i = 2, j = 2:3, part = "body", ref_symbols = "a", sep = "", value = as_paragraph("Method x"), inline = T)
# add other footnotes
tab <- footnote(tab, i = 3, j = 1, part = "body", ref_symbols = "b", sep = "; ", value = as_paragraph("Method y"), inline = T)

tab <- fontsize(tab, part = "all", size = 13)
autofit(tab)

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM