From 0e65ed03e131e8515e61cd67ffac5563d33b1042 2013-07-08 19:17:23 From: Min RK Date: 2013-07-08 19:17:23 Subject: [PATCH] Merge pull request #3578 from jakobgager/latex_image_handle Use adjustbox to specify figure size in nbconvert -> latex Instead of hardcoding the image size used when compiling latex, a maximum size is specified only. This way smaller images don't get enlarged. The Sphinx converter use the same approach. --- diff --git a/IPython/nbconvert/templates/latex/base.tplx b/IPython/nbconvert/templates/latex/base.tplx index d6ffc7a..4b6cae0 100644 --- a/IPython/nbconvert/templates/latex/base.tplx +++ b/IPython/nbconvert/templates/latex/base.tplx @@ -41,14 +41,14 @@ it introduces a new line ((*- block data_png -*)) \begin{center} -\includegraphics[width=0.7\textwidth, height=0.9\textheight, keepaspectratio]{(((output.key_png)))} +\includegraphics[max size={0.7\textwidth}{0.9\textheight}]{(((output.key_png)))} \par \end{center} ((*- endblock -*)) ((*- block data_jpg -*)) \begin{center} -\includegraphics[width=0.7\textwidth, height=0.9\textheight, keepaspectratio]{(((output.key_jpeg)))} +\includegraphics[max size={0.7\textwidth}{0.9\textheight}]{(((output.key_jpeg)))} \par \end{center} ((*- endblock -*)) @@ -144,6 +144,9 @@ unknown type (((cell.type))) \usepackage{ucs} \usepackage[utf8x]{inputenc} +% Scale down larger images +\usepackage[export]{adjustbox} + %fancy verbatim \usepackage{fancyvrb} % needed for markdown enumerations to work