title: Enabling vignette compression for R CMD build in RStudio
body: <p>I am using RStudio for package development in windows environment. I need to enable pdf vignette compression to avoid <code>'gs+qpdf' made some significant size reductions:</code> warning.</p>
  
  <p>I have added <code>--compact-vignettes="gs+qpdf"</code> as additional options to <strong>Project Options : Build Tools</strong> > <strong>Build Source Package</strong>, but there is no change in the size of pdf vignette in the source package built using <code>devtools::build()</code>.</p>
  
  <p>I have also added to the YAML header in the vignette latex compression options as follows.</p>
  
  <pre><code>header-includes:
  - \pdfminorversion=5
  - \pdfcompresslevel=9
  - \pdfobjcompresslevel=2
  </code></pre>
  
  <p>Still there is no change.</p>
  
  <p>However I am getting the desired compression while using <code>tools::compactPDF</code>
  with <code>gs_cmd = Sys.getenv("R_GSCMD")</code> and <code>gs_quality = "ebook</code> arguments.</p>
  
  <p>How to get the desired compression while building packages for avoiding the warning?</p>