title: How to make fig.width and out.width consistent with knitr?
body: <p>I have recently discovered knitr and I mainly use it to produce plots with <code>dev=tikz</code> to get a Latex typesetting easily. However I don't understand how to set chunk options <code>fig.width</code> and <code>out.width</code> with consistency.</p>
  
  <p>I mean, I know that the first one is an R option while the second one is the latex option coming with <code>\includegraphics</code> but it seems like if <code>fig.width</code> is too large compared to <code>out.width</code> then the lines are very thin because latex shrink the picture. In the other hand if it's too small then latex streches it and everything is too big.</p>
  
  <p>Basically I'd like too have a setting in wich I only choose the <code>out.width</code>and then the thickness of the lines and texts is consistent with the text size of the document.</p>
  
  <p>I include a MWE illustrating my problem. Also I have set <code>fig.height</code> in the first example otherwise the picture was then bigger than the page, I don't really understand this as well.</p>
  
  <p>Any help is warmly welcome !</p>
  
  <pre><code>\documentclass[12pt,a4paper]{article}
  \usepackage[utf8]{inputenc}
  \usepackage[english]{babel}
  \usepackage[T1]{fontenc}
  \usepackage{graphicx}
  
  &lt;&lt;setup, include=FALSE, cache=FALSE&gt;&gt;=
    library(knitr)
    options(formatR.arrow=TRUE,width=50)
    opts_chunk$set(fig.path='figure/graphics-', 
                   cache.path='cache/graphics-', 
                   fig.align='center', 
                   dev='tikz')
  @
  
  \begin{document}
  \begin{figure}[!ht]
      &lt;&lt;fig_1,fig.width=2,  fig.height = 3,out.width = '\\textwidth',echo=FALSE&gt;&gt;=
      x = seq(1,3,l=100)
      plot(x,cos(x), type ="l", xlab = "x", ylab = "y")
      @
  \end{figure}
  \begin{figure}[!ht]
  &lt;&lt;fig_2,fig.width=10,  out.width = '\\textwidth',echo=FALSE&gt;&gt;=
      x = seq(1,3,l=100)
      plot(x,cos(x), type ="l", xlab = "x", ylab = "y")
      @
  \end{figure}
  
  \end{document}
  </code></pre>