Whenever I make a presentation with LaTeX, it takes me a long time to include the graphics in the way I want them to look.
- I start with
\includegraphics{foo.jpg}
, - run
pdflatex
to see what it looks like, - then add
[trim=1cm 2cm 3cm 4cm]
, - run
pdflatex
to see what it looks like, - then add
[scale=.8]
, - then run
pdflatex
, - then change
[trim=...]
, - then change
[scale]....
etc.
Is there a tool that lets on manipulate the picture directly and then produces the LaTeX source? Or what is a better practice to achieve the results?
Best Answer
A good practice IMHO is, depending on the type of graphic:
Photos: Use the JPG format and crop it to the size and viewport your need using an image processing program, e.g. Gimp or Photoshop. DO NOT use JPG for anything else, it is really just thought for photos. It can handle other stuff as well but not as good as other formats.
Screenshoots and other Artificial Pixel-graphics: Use PNG format and again crop it to the size and viewport needed. The PNG format is lossless, i.e. doesn't create artifacts like JPG. Its compresses this kind of images well.
Diagrams, Pictures and other Vector-graphics: Should really be included as vector-graphics and not as pixel-graphics (and if so NOT as JPG!). You should export them as PDF or EPS which is then converted to PDF (e.g.
epstopdf
). Extra whitespace from margins etc. can be removed bypdfcrop
.To include your image:
width
(andheight
) option should IMHO be preferred beforescale
in many cases, e.g. larger graphics. Awidth=
x\textwidth
(x = 0.95 .. 0.8) normally includes larger images nicely. Thescale
options is better suited to increase smaller images or adjust middle sized images when they already have almost the correct size.beamer
presentation I had to watch theheight
as well. Note that inbeamer
the\textheight
spans over the frame title, soheight=\textheight
will not result in a good slide.About your current method:
trim
to remove white space (see also above), you might want to also use theclip
option to get fully rid of it. (Ok, with white space it doesn't make much difference)-pvc
mode oflatexmk
. Use it for the recompilation while you change the settings.beamer
has a\includeonlyframe
which allows you to only compile certain frame, which speeds things up during adjustments and creation of e.g. TikZ pictures.