I'm writing a report where I have generated and included several TikZ pictures which I also want to use in my beamer presentation. However, some of the pictures (but not all) which fit in the report are too large for the slides. Hence, I wonder if there is any package or macro which shrinks a figure if it is too large, but leaves it alone if it already fits.
If the answer only works for TikZ then that's fine. I don't mind shrinking texts and lines along with the entire figure.
adjustboxis Scale included graphics to the higher ratio instead of the lower for given width, height. It is the other way around (scaling up if required) plus some more stuff (cropping). – Martin Scharrer Oct 03 '11 at 08:25.95\textwidthinstead of the whole\textwidth? – gablin Oct 03 '11 at 08:27\textwidth. Unfortunately the\textheightincludes the title and sub-title (if present) as well. There heights are theme specific and so you have to guess the maximum usable height. – Martin Scharrer Oct 03 '11 at 08:30