Skip to content

Commit

Permalink
Merge pull request ipython#3578 from jakobgager/latex_image_handle
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
minrk committed Jul 8, 2013
2 parents 8ef4a19 + 04f69b2 commit 998c830
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions IPython/nbconvert/templates/latex/base.tplx
Original file line number Diff line number Diff line change
Expand Up @@ -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 -*))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 998c830

Please sign in to comment.