Does shinyapps.io not support xelatex or lualatex latex rendering engines in rmarkdown file?

Apparently the rendering of Rmarkdown with lualatex/xelatex output works, when a simple template .tex file is referenced in the YAML header of the Rmarkdown:

template.tex:

\documentclass[12pt,a4paper,oneside]{article}
\begin{document}
$body$
\end{document}

lualatex.Rmd :

---
output:
   pdf_document:
     template: template.tex
     latex_engine: lualatex
---

Hello! This is lualatex

I do not understand why this would work, but it does.