title: In `knitr` how can I test for if the output will be PDF or word?
body: <p>I would like to include specific content based on which format is being created. In this specific example, my tables look terrible in <code>MS word</code> output, but great in <code>HTML</code>. I would like to add in some test to leave out the table depending on the output.</p>
  
  <p>Here's some pseudocode:</p>
  
  <pre><code>output.format &lt;- opts_chunk$get("output")
  
  if(output.format != "MS word"){
  print(table1)
  }
  </code></pre>
  
  <p>I'm sure this is not the correct way to use <code>opts_chunk</code>, but this is the limit of my understanding of how <code>knitr</code> works under the hood. What would be the correct way to test for this?</p>