title: Why does the Knit drop-down in RStudio disappear?
body: <p>Q: Why does the Knit drop-down in RStudio disappear when I add a knit option to the YAML header of my R Markdown file?</p>
  
  <p>Normally I see the Knit button with drop-down option (like this <a href="https://i.stack.imgur.com/BhBfd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BhBfd.png" alt="knit01"></a>) when viewing a .Rmd in RStudio, . But the drop-down option disappears (so I only see <a href="https://i.stack.imgur.com/ZZwRB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZZwRB.png" alt="enter image description here"></a>) after I add the following code to the YAML header in my .Rmd:</p>
  
  <pre><code>knit: (function(inputFile, encoding) {
    rmarkdown::render(inputFile, encoding = encoding, output_dir = "../output") })
  </code></pre>
  
  <p>I add that code because I want my output to go to a different directory than my source .Rmd. </p>
  
  <p>I can change the ordering of my <code>output</code> fields (e.g., <code>pdf_document</code>, <code>word_document</code>) to Knit (without drop-down) to get a .pdf or .docx as I need. But go back and forth between the two often. So this work-around becomes very tedious. </p>
  
  <p>This question appears to relate to <a href="https://stackoverflow.com/questions/27881289/what-does-knit-html-do-in-rstudio-0-98">What does “Knit HTML” do in Rstudio 0.98?</a> and <a href="https://support.rstudio.com/hc/en-us/community/posts/115000814347-Knit-Directory-drop-down-menu" rel="nofollow noreferrer">Knit Directory drop down menu</a>. </p>