Home > other >  flextable: `fontsize(size = 4, part = "all")` does not apply to the footnote
flextable: `fontsize(size = 4, part = "all")` does not apply to the footnote

Time:06-01

I had expected that the fontsize(size = 4, part = "all") would apply size = 4 on all parts of the table. It doesn't.

head(iris) %>%
  flextable() %>%
  fontsize(size = 4, part = "all") %>%
  footnote( i = 1, j = 1:2,
               value = as_paragraph(
                c("This is footnote one",
                   "This is footnote two")
               ),
               ref_symbols = c("a", "b"),
               part = "header") %>%
  footnote(i = 1, j = 3:4,
               value = as_paragraph(
                 c("This is footnote three",
                   "This is footnote four")
               ),
               ref_symbols = c("c","d"),
               part = "header")

enter image description here

CodePudding user response:

Order matters - move fontsize() to after the creation of the footnotes:

head(iris) %>%
  flextable() %>%
  footnote( i = 1, j = 1:2,
            value = as_paragraph(
              c("This is footnote one",
                "This is footnote two")
            ),
            ref_symbols = c("a", "b"),
            part = "header") %>%
  footnote(i = 1, j = 3:4,
           value = as_paragraph(
             c("This is footnote three",
               "This is footnote four")
           ),
           ref_symbols = c("c","d"),
           part = "header") %>%
  fontsize(size = 4, part = "all")

enter image description here

  • Related