title: Sphinx - images in PDF
body: <p>I am using Sphinx to document a project. I'd like to produce HTML and PDF formats. I’ve used rinohtype to export PDF, which works well. However, images are consistently rendered wider than the page width. Is there a way to configure image width for the entire document, rather than for each image individually?</p>
  <p>I’ve tried playing with Latex preamble, but no success so far. This is the Latex preamble I've placed into Sphinx' <code>conf.py</code>:</p>
  <pre><code>latex_elements = {
      # The paper size ('letterpaper' or 'a4paper').
      #
      'papersize': 'a4paper',
  
      # The font size ('10pt', '11pt' or '12pt').
      'pointsize': '10pt',
      
      # Latex preamble
      'preamble': '\usepackage{graphicx}\setkeys{Gin}{width=\linewidth}',
  
      # Latex figure (float) alignment
      'figure_align': 'htbp',
      'pxunit': '300px=1in',
  }
  </code></pre>