title: How to force bookdown to render document with xelatex engine instead of pdflatex?
body: <p>I use bookdown to render html books. How can render the same book using LaTeX enging xelatex instead of pdflatex?</p>
  <p>This is the main code I use:</p>
  <pre><code>bookdown::render_book('index.Rmd', output_file='mybook.pdf','bookdown::pdf_book')
  </code></pre>
  <p>It keeps on saying <code>! Sorry, but C:\PROGRA~1\MIKTEX~1.9\miktex\bin\x64\pdflatex.exe did not succeed.</code>. Because when rendering other kinds of pdf documents I use xelatex as an enging, I know it should be available in my system. How can I force bookdown to use xelatex?</p>
  <p><a href="https://github.com/rstudio/bookdown/issues/201" rel="nofollow noreferrer">Here</a> this answer seemed to be asked before, but I have no idea how to use the mentioned solution: <code>pandoc_options(args = c(&quot;--latex-engine&quot;, &quot;xelatex&quot;))</code>.</p>
  <p>When I do something like this:</p>
  <pre><code>bookdown::render_book('index.Rmd', output_file='mybook.pdf','bookdown::pdf_book',pandoc_options(latex_engine = 'xelatex'))
  </code></pre>
  <p>There is an error: <code>Error in pandoc_options(latex_engine = &quot;xelatex&quot;) :  argument &quot;to&quot; is missing, with no default</code></p>
  <p>Does anyone know how to deal with this problem?</p>