Hedjour
Hedjour

Reputation: 101

Knitr emptyline after \include graphics

I have a little question, I'm not sure of the cause, but the following knitr code :

<<toto, echo=FALSE, comment=NA, results='asis'>>=
  #Data
     a<- c(1:100)
     b<- c(100:200)
  #Plot1
    plot(a)
  #Plot2
    plot(b)
@

produce this LaTeX code :

\includegraphics[width=\maxwidth]{figure/toto1}
  (empty line here)
\includegraphics[width=\maxwidth]{figure/toto2}
  (empty line here)

How can I remove this empty line?

Upvotes: 4

Views: 158

Answers (1)

Yihui Xie
Yihui Xie

Reputation: 30174

Use the chunk option fig.show='hold'.

Upvotes: 6

Related Questions