You can't use Latex code to include a figure in a word output. You need to use Markdown syntax (
) which will be converted by Pandoc to the correct format expected by Word. Or you could use knitr::include_graphic
which will write the correct compatible syntax using chunk option if you provide some.
If you insert raw code in the input document that is Markdown syntax, this raw code will be ignore by Pandoc during the conversion if it is not compatible with the output format (here docx).
Why do you need to use LaTeX code ?