Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading