I cannot use knit to word ,pdf

Can you format your code correctly so that we can check that the Rmd file is ok ?

FAQ: How to Format R Markdown Source

Also can you share the results of rmarkdown::pandoc_version() ?

Thank you !