title: Fold text and images in markdown output
body: <p>I'm trying to create an <code>HTML</code> file using <code>knitr</code> package in <code>R</code>. This sounds simple but I can't seem to find a solution to this:</p>
  
  <p>I would like to be able to fold the text and images in my output having the little <code>+</code> buttons. Would anybody happen to have an idea of how do I do that?</p>
  
  <p>For example, I'd like to fold the following image with some text in the next line:</p>
  
  <pre><code>```{r,echo=FALSE,warning=FALSE}
  p &lt;- ggplot(sumRevenue, aes(x=Date, y=Revenue, fill=clusters)) + scale_x_date(breaks=x_breaks, labels=x_labels) +
    geom_bar(stat="identity", position = "fill",alpha=0.6) +
    scale_y_continuous(labels = percent_format()) + xlab('') +
    ggtitle('Physical filing percent spread for segments') + theme_bw() + ylab('Percent Spread') +
    theme(axis.text.y=element_text(hjust=0, angle=0), 
          axis.text.x = element_text(hjust=1, angle=45),
          panel.grid.minor.x = element_blank(),
          panel.grid.minor.y = element_blank(),
          panel.grid.major.x=element_line(color='grey90',linetype='dashed'),
          panel.grid.major.y=element_line(color='grey90',linetype='dashed'),
          plot.title=element_text(size=20),
          axis.text=element_text(size=10),
          legend.key=element_blank(),
          legend.title=element_blank()) +
    scale_fill_manual(values=c("#a6cee3","#1f78b4","#b2df8a")) 
  p
  ```
  Some text here
  </code></pre>
  
  <p>Any pointers would be greatly appreciated.</p>